結果

問題 No.188 HAPPY DAY
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2017-09-26 21:31:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 74,188 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-30 01:28:29
合計ジャッジ時間 1,147 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    int happy = 0;
    int x[4] = { 4,6,9,11 };
    
    for ( int m = 1; m <= 12; m++ ) {
        
        int D = m == 2 ? 28 : m == 4 || m == 6 || m == 9 || m == 11 ? 30 : 31;
        for ( int d = 1; d <= D; d++ ) {
            
            if ( to_string(d)[0] - '0' + to_string(d)[1] - '0' == m ) { happy++; }
            
        }
    }
    
    cout << happy << endl;
    
    return 0;
}
0