結果

問題 No.652 E869120 and TimeZone
ユーザー shikakushikaku
提出日時 2018-04-27 18:59:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,333 bytes
コンパイル時間 1,199 ms
コンパイル使用メモリ 53,016 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-10 06:16:20
合計ジャッジ時間 2,290 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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


    int a, b, d, t, m, x, y;

    string s;


    
    cin >> a >> b >> s;


    d = s.size() - 2;

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

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

        if( m == 0 ){

            t = t - 9;

            m = ( 10 - m ) % 10;

            }

        if( m != 0 ){

            t = t - 8;

            m = ( m - 10 ) % 10;
     
            }

        }

    else{

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

          m = 0;

          }
       


    x = ( a * 60 + b + ( t * 60 + m * 6 ) );

    y = ( a * 60 + b + ( t * 60 + m * 6 ) );


    if( x < 0 ) x = 24 + ( x / 60 );

    else x = x / 60;

    if( x >= 24 ) x = x % 24;


    if( x == 0 && y < 0 ){

        x = 24 - 1;

        y = y = 60 + ( y % 60 );

        }


    if( y < 0 ) y = 60 + ( y % 60 );

    else y = y % 60;


    if( y >= 60 ) y = y % 60;



    if( 10 > x && 10 > y ) cout << "0" << x << ":" << "0" << y << endl;

    else if( 10 > x ) cout << "0" << x << ":" << y << endl;

    else if( 10 > y ) cout << x << ":" << "0" << y << endl;


    else cout << x << ":" << y << endl;                       


    return 0;

}
0