結果
| 問題 |
No.652 E869120 and TimeZone
|
| コンテスト | |
| ユーザー |
かぼちゃ
|
| 提出日時 | 2018-04-22 18:17:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 632 bytes |
| コンパイル時間 | 522 ms |
| コンパイル使用メモリ | 71,104 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 13:27:44 |
| 合計ジャッジ時間 | 1,551 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 29 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d %d UTC%c%lf",&a,&b,&c,&d);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <stack>
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define REP(i,a,n) for(int i = (a);i < (n);i++)
#define PI 3.14159265359
#define MOD 1000000007
#define chmax(a,b) if(a < b)a = b
using namespace std;
int main(){
int a,b;
char c;
double d;
scanf("%d %d UTC%c%lf",&a,&b,&c,&d);
a = (24+a)*60 + b;
d *= c == '-' ? -1 : 1;
d = 9 - d;
a -= 60*d;
b = a%60;
a /= 60;
a %= 24;
printf("%02d:%02d\n",a,b);
return 0;
}
かぼちゃ