結果

問題 No.525 二度寝の季節
コンテスト
ユーザー u-sho
提出日時 2017-06-09 22:55:02
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,328 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 401 ms
コンパイル使用メモリ 74,432 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-10 23:09:14
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:13: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   20 |         T[3]=="0";
      |         ~~~~^~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:56,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:46,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
                 from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/basic_string.h:4062:5: note: declared here
 4062 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
using namespace std;
int main() {
    string T[5];
    cin>>T[0]>>T[1]>>T[2]>>T[3]>>T[4];
    if(T[4]=="0"){T[4]="5";}
    else if(T[4]=="1"){T[4]="6";}
    else if(T[4]=="2"){T[4]="7";}
    else if(T[4]=="3"){T[4]="8";}
    else if(T[4]=="4"){T[4]="9";}
    else{
      if(T[4]=="5"){T[4]="0";}
      else if(T[4]=="6"){T[4]="1";}
      else if(T[4]=="7"){T[4]="2";}
      else if(T[4]=="8"){T[4]="3";}
      else if(T[4]=="9"){T[4]="4";}

      if(T[3]=="5"){
        T[3]=="0";
        if(T[0]=="2" && T[1]=="3"){T[0]="0"; T[1]="0";}
        else if(T[1]=="0"){T[1]="1";}
        else if(T[1]=="1"){T[1]="2";}
        else if(T[1]=="2"){T[1]="3";}
        else if(T[1]=="3"){
          T[1]="4";
          if(T[0]=="2"){T[0]="0"; T[1]="0";}
        }
        else if(T[1]=="4"){T[1]="5";}
        else if(T[1]=="5"){T[1]="6";}
        else if(T[1]=="6"){T[1]="7";}
        else if(T[1]=="7"){T[1]="8";}
        else if(T[1]=="8"){T[1]="9";}
        else if(T[1]=="9"){
          T[1]="0";
          if(T[0]=="0"){T[0]="1";}
          else{T[0]="2";}
        }
      }else if(T[3]=="0"){T[3]="1";}
      else if(T[3]=="1"){T[3]="2";}
      else if(T[3]=="2"){T[3]="3";}
      else if(T[3]=="3"){T[3]="4";}
      else if(T[3]=="4"){T[3]="5";}
    }
    cout << T << endl;

    return 0;
}
0