結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  Bantako | 
| 提出日時 | 2017-06-24 13:05:26 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 0 ms / 1,000 ms | 
| コード長 | 569 bytes | 
| コンパイル時間 | 267 ms | 
| コンパイル使用メモリ | 23,552 KB | 
| 実行使用メモリ | 6,816 KB | 
| 最終ジャッジ日時 | 2024-12-31 01:46:33 | 
| 合計ジャッジ時間 | 634 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 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 = 1;i <= 9;i++){
        for(int j = 0;j < 4;j++){
            if(i-j >= 0 && j*10 + (i-j) <= maxd[i-1]){
                count++;
            }
        }
    }
    //10~12month
    for(int i = 10;i <= 12;i++){
        for(int j = 1;j < 4;j++){
            if(i-j < 10 && j*10 + (i-j) <= maxd[i-1]){
                count++;
            }
        }
    }
    printf("%d\n",count);
}
            
            
            
        