結果

問題 No.188 HAPPY DAY
ユーザー hryshtkhryshtk
提出日時 2015-08-12 00:36:12
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 531 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 143,752 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-29 02:51:39
合計ジャッジ時間 1,731 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

using namespace std;
#include <bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I))
#define ALL(C) (C).begin(),(C).end()
inline void solve()
{
	int DAY[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int ans=0;
	FOR(month,1,13) 
	{
		FOR(day,1,DAY[month]+1)
		{
			int x=day,y=0;
			while(x) 
			{
				y+=x%10;
				x/=10;
			}
			if(month==y) ans++;
		}
	}
	cout<<ans<<endl; 
}
int main(int argc,char**argv)
{
	BEGIN
	solve();
	END
}
0