結果

問題 No.188 HAPPY DAY
ユーザー hamrayhamray
提出日時 2017-11-15 11:04:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 1,275 bytes
コンパイル時間 549 ms
コンパイル使用メモリ 72,208 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-30 01:31:44
合計ジャッジ時間 985 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}

           
0