結果
問題 | No.525 二度寝の季節 |
ユーザー |
![]() |
提出日時 | 2017-06-09 22:25:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 306 bytes |
コンパイル時間 | 1,227 ms |
コンパイル使用メモリ | 159,960 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 15:04:57 |
合計ジャッジ時間 | 2,188 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 13 | printf("%02d:%02d\n",h,m); | ~~~^ ~ | | | | int long long int | %02lld main.cpp:13:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=] 13 | printf("%02d:%02d\n",h,m); | ~~~^ ~ | | | | int long long int | %02lld
ソースコード
#include<bits/stdc++.h>using namespace std;#define int long longsigned main(){string s;cin>>s;//cout<<s.substr(0,2)<<" "<<s.substr(3,2)<<endl;int h=stoll(s.substr(0,2));int m=stoll(s.substr(3,2));m+=5;if(m>=60) m-=60,h++;if(h==24) h=0;printf("%02d:%02d\n",h,m);return 0;}