結果

問題 No.188 HAPPY DAY
ユーザー evawenis
提出日時 2020-03-18 14:30:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 3,443 ms
コンパイル使用メモリ 192,128 KB
最終ジャッジ日時 2025-01-09 07:39:23
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int ans=0;
	for(int i=1,n;i<=12;++i){
		if(i==2)n=28;
		else if(i<8&&i%2==1||i>=8&&i%2==0)n=31;
		else n=30;
		for(int j=1,t,t2;j<=n;++j){
			t=j;
			while(t){
				t2=t%10;
				t/=10;
			}
			if(t2==i)++ans;
		}
	}
	cout<<ans<<"\n"s;
}
0