結果
| 問題 | No.188 HAPPY DAY |
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-04-13 10:48:07 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 607 bytes |
| コンパイル時間 | 134 ms |
| コンパイル使用メモリ | 30,080 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 23:40:55 |
| 合計ジャッジ時間 | 528 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
// yukicoder: No.188 HAPPY DAY
// 2019.4.13 bal4u
#include <stdio.h>
int daysOfMonth(int year, int month)
{
static int days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
if (month < 1 || month > 12) month = 1;
if (month == 2) return days[1] +
(year % 4 == 0 && year % 100 != 0 || year % 400 == 0);
else return days[month - 1];
}
int s[35];
int main()
{
int i, m, d, ans;
for (i = 1; i <= 31; i++) s[i] = (i % 10) + (i / 10);
ans = 0;
for (m = 1; m <= 12; m++) {
d = daysOfMonth(2015, m);
for (i = 1; i <= d; i++) if (s[i] == m) ans++;
}
printf("%d\n", ans);
return 0;
}
bal4u