[Codeforces 816A]Karen and Morning
題目大意:給你一個時間(hh:mm),求最少經過多少分鐘才能使這個時間變成回文。
解題思路:模擬,先判斷0的情況,然後每過1分鐘判斷一次即可。
C++ Code:
#include<cstdio> int main(){ int h,m; scanf("%d:%d",&h,&m); if(h==m%10*10+m/10){ puts("0"); return 0; } for(int i=1;;++i){ ++m; if(m==60){ m=0; ++h; if(h==24)h=0; } if(h==m%10*10+m/10){ printf("%d\n",i); return 0; } } }
[Codeforces 816A]Karen and Morning
相關推薦
CodeForces - 816A Karen and Morning 解題
str1 urn int spa return col 比較 scan pri 這個題比較水~~~ 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int a
[Codeforces 816A]Karen and Morning
++ puts font urn cst cpp sca pri -s 題目大意:給你一個時間(hh:mm),求最少經過多少分鐘才能使這個時間變成回文。 解題思路:模擬,先判斷0的情況,然後每過1分鐘判斷一次即可。 C++ Code: #include<cs
CodeForces-816A A - Karen and Morning 思維
CodeForces-816A A - Karen and Morning 題意: 給定一個時間格式為 小時:分鐘 判斷到下一個迴文時間所需要的分鐘數. 分析: 每個小時只會對應一個迴文時間(有些沒有), 打表出每一個對應的迴文時間, 然後從當前實踐計算即可. 程式碼: #in
#419(div2) A. Karen and Morning
return main name spa ring 思路 clas 判斷 bit 題意:給出某個時刻,問多少秒後時刻變成回文的了 思路:A題就直接暴力咯,一秒一秒加,判斷,註意:24點為0點 1 #include<bits/stdc++.h> 2 usin
CodeForces 816B Karen and Coffee(前綴和,大量查詢)
pre div 準備 nes 個數 contain 端點 -i integer CodeForces 816B Karen and Coffee(前綴和,大量查詢) Description Karen, a coffee aficionado, wants to know
CodeForces - 816B Karen and Coffee (線段樹的區間插入+單點查詢)
one 代碼 recipe http contain att amp next splay To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee afic
Codeforces 816B Karen and Coffee
Description To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee aficionado, wants to know the optimal temperatu
CodeForces - 816C Karen and Game(簡單模擬)
Problem Description On the way to school, Karen became fixated on the puzzle game on her phone! The game is played as follows. In each level
CodeForces-816C Karen and Game 水題
CodeForces-816C Karen and Game 題意: 給定一個矩陣, 可以把一個全是0的矩陣通過給一行或一列加1到達這個矩形, 問方式(spical judge), 若不能輸出-1. 分析: 純暴力模擬一下, 矩陣的大小不超過100. 程
CodeForces-816B Karen and Coffee
CodeForces-816B Karen and Coffee 題意: 給定一些區間和查詢以及一個數k, 查詢[l, r]區間內出現了大於等於k次的區間長度的總和. 分析: 預處理區間, 給定區間的首和尾記錄下來, 在判斷是否大於等於k, 進行累加即可, 詳情見程式碼. 程
Codeforces 816B Karen and Coffee(字首和)
To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee aficionado, wants to know the optimal temperature for brewing
【貪心】 Codeforces Round #419 (Div. 1) A. Karen and Game
blog true 刪除 round 貪心 cnblogs pac names namespace 容易發現,刪除的順序不影響答案。 所以可以隨便刪。 如果行數大於列數,就先刪列;否則先刪行。 #include<cstdio> #include<algo
【找規律】【遞推】【二項式定理】Codeforces Round #419 (Div. 1) B. Karen and Test
main turn logs pow 分享 string ren () 奇數 打個表出來看看,其實很明顯。 推薦打這倆組 11 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000 10000000
codeforces round #419 E. Karen and Supermarket
end png head perm struct 復雜 .com pac section On the way home, Karen decided to stop by the supermarket to buy some groceries. She needs
Codeforces 816C/815A - Karen and Game
操作 判斷 spa contest printf define font 技術 大於 傳送門:http://codeforces.com/contest/816/problem/C 本題是一個模擬問題。 有一個n×m的矩陣。最初,這個矩陣為零矩陣O。現有以下操作: a.行
Codeforces Round #460 D. Karen and Cards
lec ready bits one img beat possible node pac Description Karen just got home from the supermarket, and is getting ready to go to sleep.
Codeforces 815 C Karen and Supermarket
dex diff fall sizeof imu rain brush AD because On the way home, Karen decided to stop by the supermarket to buy some groceries. She need
Karen and Coffee 【CodeForces - 816B】【字首和思想】
題目連結 很好的一道題,剛看到這道題的時候,我們看法各不一,敲了線段樹、還有敲了個狀壓DP的,但是最後T在第9發,然後想到了其他的做法,真的很有意思的字首思想。 看看程式碼吧,會很驚喜的: #include <iostream> #incl
Karen and Coffee 【CodeForces
題目連結 很好的一道題,剛看到這道題的時候,我們看法各不一,敲了線段樹、還有敲了個狀壓DP的,但是最後T在第9發,然後想到了其他的做法,真的很有意思的字首思想。 看看程式碼吧,會很驚喜的: #include <iostream> #include &
Karen and Game CodeForces - 816C (暴力+構造)
ems ++ his center bsp uil -i define ldl On the way to school, Karen became fixated on the puzzle game on her phone! The game is played