結果
問題 |
No.188 HAPPY DAY
|
ユーザー |
![]() |
提出日時 | 2017-06-24 13:03:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 564 bytes |
コンパイル時間 | 312 ms |
コンパイル使用メモリ | 23,424 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 01:44:31 |
合計ジャッジ時間 | 728 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 1 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 2 | main(){ | ^~~~
ソースコード
#include<stdio.h> main(){ int count = 0; int maxd[] = {31,28,31,30,31,30,31,31,30,31,30,31}; //1~9month //0nday,1(n-1)day,2(n-2)day,3(n-3)dayが存在する for(int i = 0;i < 10;i++){ for(int j = 0;j < 4;j++){ if(i-j >= 0 && j*10 + (i-j) <= maxd[i]){ count++; } } } //10~12month for(int i = 10;i < 13;i++){ for(int j = 1;j < 4;j++){ if(i-j < 10 && j*10 + (i-j) <= maxd[i]){ count++; } } } printf("%d\n",count); }