結果

問題 No.652 E869120 and TimeZone
ユーザー shikakushikaku
提出日時 2018-04-27 17:02:03
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,238 bytes
コンパイル時間 1,241 ms
コンパイル使用メモリ 53,076 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-10 06:13:55
合計ジャッジ時間 3,998 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,384 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 2 ms
4,384 KB
testcase_33 AC 1 ms
4,384 KB
testcase_34 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
using namespace std;
                                                                                                
  
int main(){


    int a, b, d, t, m;

    string s;


    
    cin >> a >> b >> s;


    d = s.size() - 2;

    if( s.at(d) == '.'){

        sscanf( s.c_str(),"UTC%d.%d", &t, &m );

        t = t - 9;

        m = ( 10 - m ) % 10;

        }

    else{

          sscanf( s.c_str(),"UTC%d", &t);
          
          t = t - 9;

          m = 0;

          }
    


    if( ( a + t ) % 24 < 0 ){

        if( 10 > ( b + m * 6 ) % 60 ) cout << ( 24 + ( a + t ) ) % 24 << ":" << "0" << ( b + m * 6 ) % 60 << endl;

        else cout << ( 24 + ( a + t ) ) % 24 << ":" << ( b + m * 6 ) % 60 << endl;        

        }

    else if( 10 > ( a + t ) % 24 ) cout << "0" << ( a + t ) % 24 << ":" << ( b + m * 6 ) % 60 << endl;

    else if( 10 > ( b + m * 6 ) % 60 ) cout << ( a + t ) % 24 << ":" << "0" << ( b + m * 6 ) % 60 << endl;

    else if( 10 > ( a + t ) % 24 && 10 > ( b + m * 6 ) % 60 ) cout << "0" << ( a + t ) % 24 << ":" << "0" << ( b + m * 6 ) % 60 << endl;


    else cout << ( a + t ) % 24 << ":" << ( b + m * 6 ) % 60 << endl;                       


    return 0;

}
0