結果

問題 No.652 E869120 and TimeZone
ユーザー tecchaxntecchaxn
提出日時 2018-02-23 22:49:36
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,010 bytes
コンパイル時間 1,231 ms
コンパイル使用メモリ 145,524 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-22 14:14:37
合計ジャッジ時間 2,324 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:34:19: warning: ‘d’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     int dh=(int)(d*60)/60;
                 ~~^~~~

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define INF 1e18
#define SIZE 100005

using namespace std;
typedef pair<int,int> P;

//-----------------------------------------------------------------------


signed main()
{   
    int a,b; cin>>a>>b;
    string s,t; cin>>s;
    t=s.substr(4);

    double d;
    if(s[3]=='-'){
        if(t.size()==1) d=t[0]-'0';
        if(t.size()==2) d=(t[0]-'0')*10+(t[1]-'0');
        if(t.size()==3) d=(t[0]-'0')+(double)(t[2]-'0')/10;
        if(t.size()==4) d=(t[0]-'0')*10+(t[1]-'0')+(double)(t[3]-'0')/10;
        d=24-d;
    }
    else{
        if(t.size()==1) d=t[0]-'0';
        if(t.size()==2) d=(t[0]-'0')*10+(t[1]-'0');
        if(t.size()==3) d=(t[0]-'0')+(double)(t[2]-'0')/10;
        if(t.size()==4) d=(t[0]-'0')*10+(t[1]-'0')+(double)(t[3]-'0')/10;
    }

    int dh=(int)(d*60)/60;
    int dm=(int)(d*60)%60;
    b+=dm; if(b>=60) b-=60,a++;
    a=(a+dh+15)%24;

    printf("%02d:%02d\n",a,b);
    
}
0