結果

問題 No.188 HAPPY DAY
ユーザー marimom7
提出日時 2015-10-09 10:01:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 498 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 53,980 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 20:41:46
合計ジャッジ時間 981 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main(){
	//ちょっとだけ変化球
	int mouth = 12,day = -1,ans = 0;
	int guregorio = 2015;
	int table_30 = 1320;

	for(int i = 1; i <=12; ++i){
		if(table_30 & (1 << i-1)){
			//30
			day = 30;
		}else if(i == 2){
			//28
			day = (guregorio / 100 == 0 && guregorio % 400 != 0) ? 28 : guregorio/4 == 0 ? 29 : 28;
		}else{
			//31
			day = 31;
		}

		for(int j = 1; j <= day; j++)if(i == j/10+j%10)ans++;
		
	}

	cout << ans << endl;

	return 0;
}
0