結果
問題 |
No.652 E869120 and TimeZone
|
ユーザー |
![]() |
提出日時 | 2019-03-10 21:14:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 959 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 63,440 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 15:21:59 |
合計ジャッジ時間 | 1,555 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 28 WA * 2 |
ソースコード
#include <iostream> #include <vector> #include <utility> #include <algorithm> #include <string> typedef long long ll; using namespace std; double strNum(string s) { double n = 0; int dec = 0; for (int i = 0; i < (int)s.length(); i++) { if (s[i] == '.') { dec = true; } else if (dec){ double d = 1; for(int i = 0; i < dec; i++) { d *= 0.1; } n += (s[i] - '0') * d; dec++; } else if (s[i] - '0' >= 0 && s[i] - '0' <= 9){ n *= 10; n += (s[i] - '0'); } } if (s[0] == '-') { n *= -1; } return n; } int main(){ int a,b,t; string s; cin >> a >> b >> s; t = 24 * 60 + (int)(a * 60 + b - (9 - strNum(s.substr(3,s.length()-3))) * 60); t %= 24 * 60; cout << t/60%24/10 << t/60%24%10 << ":" << t%60/10 << t%60%10 << endl; return 0; }