結果
| 問題 | No.188 HAPPY DAY |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-19 16:48:10 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 323 bytes |
| 記録 | |
| コンパイル時間 | 1,027 ms |
| コンパイル使用メモリ | 37,888 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-19 16:48:13 |
| 合計ジャッジ時間 | 2,233 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
main.c: In function 'main':
main.c:11:38: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
11 | for (j = 1; j <= days[i]; j++) {
| ~~~~^~~
main.c:10:23: note: within this loop
10 | for (i = 1; i <= 12; i++)
| ~~^~~~~
ソースコード
#include <stdio.h>
int main(void)
{
int i, j;
int sumday;
int count = 0;
int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
for (i = 1; i <= 12; i++)
for (j = 1; j <= days[i]; j++) {
sumday = j % 10;
sumday += j / 10;
if (i == sumday)
count++;
}
printf("%d\n", count);
return 0;
}