結果

問題 No.188 HAPPY DAY
ユーザー DahnDahn
提出日時 2021-11-23 23:32:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 532 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 198,572 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-08 04:07:06
合計ジャッジ時間 2,507 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int i, months = 12, a, b, count=0;
    for(i=1; i< months; i++){
        for(a=0; a<= 3; a++){
            b = i-a;
            if ( (b < 10 and b >= 0) \
            and (( (i==1 or i==3 or i==5 or i==7 or i==8 or i==10 or i==12) and a*10+b <=31 )  \
            or (i==2 and a*10+b <=28 ) \
            or ( (i==4 or i==6 or i==9 or i==11) and a*10+b <=30 ))){
                    count++;
            }
        }
    }
    
    cout << count << endl;
    return 0;
}
0