結果
| 問題 |
No.652 E869120 and TimeZone
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-05 05:32:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 1,000 ms |
| コード長 | 325 bytes |
| コンパイル時間 | 2,207 ms |
| コンパイル使用メモリ | 190,892 KB |
| 最終ジャッジ日時 | 2025-01-10 06:41:03 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | double d; scanf("%d%d UTC%lf",&h,&m,&d);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const double EPS=1e-7;
int main(){
int h,m;
double d; scanf("%d%d UTC%lf",&h,&m,&d);
double h2=h+m/60.0+d-9;
while(h2>=24-EPS) h2-=24;
while(h2<-EPS) h2+=24;
printf("%02d:%02d\n",int(h2),int((h2-int(h2))*60+0.5));
return 0;
}