結果

問題 No.188 HAPPY DAY
ユーザー TearonTearon
提出日時 2016-09-03 19:59:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 51,068 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-29 22:19:34
合計ジャッジ時間 790 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:16: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
     REP(j,day[i]){
           ~~~~~^
main.cpp:2:39: note: in definition of macro ‘REP’
 #define REP(i,n) for( int i = 1; i <= n; i++ )
                                       ^
main.cpp:2:36: note: within this loop
 #define REP(i,n) for( int i = 1; i <= n; i++ )
main.cpp:8:7:
   REP(i,12){
       ~~~~                          
main.cpp:8:3: note: in expansion of macro ‘REP’
   REP(i,12){
   ^~~

ソースコード

diff #

#include<iostream>
#define REP(i,n) for( int i = 1; i <= n; i++ )
using namespace std;
int main(){
  int cnt = 0;
  int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

  REP(i,12){
    REP(j,day[i]){
      if( (j / 10) + (j % 10) == i ) cnt++;
    }
  }
  cout << cnt << endl;
}
0