結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2017-11-15 11:04:11 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,275 bytes |
コンパイル時間 | 759 ms |
コンパイル使用メモリ | 73,640 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-12-31 06:06:07 |
合計ジャッジ時間 | 1,168 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include<iostream>#include<iomanip>#include<cmath>#include<string>#include<algorithm>#include<vector>#include<math.h>#include<stack>using namespace std;int main(){int day[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int cnt = 0;for(int i = 0; i < 12; i++){if(day[i] == 31){for(int j = 0; j <= 3; j++){if(j == 3){for(int k = 0; k <=1; k++){if(i+1 == j+k) cnt++;}}else{for(int k = 0; k <= 9; k++){if(i+1 == j+k) cnt++;}}}}else if(day[i] == 30){for(int j = 0; j <= 3; j++){if(j == 3){if(i+1 == j) cnt++;}else{for(int k = 0; k <= 9; k++){if(i+1 == j+k) cnt++;}}}}else{for(int j = 0; j <= 2; j++){for(int k = 0; k <= 8; k++){if(i+1 == j+k) cnt++;}}}}cout << cnt << endl;return 0;}