結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
moshiya02
|
| 提出日時 | 2018-03-14 15:55:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 248 bytes |
| コンパイル時間 | 542 ms |
| コンパイル使用メモリ | 54,364 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 19:23:15 |
| 合計ジャッジ時間 | 963 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:21: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
8 | for(j=1;j<=day[i];j++){
| ~~~~~^
main.cpp:7:12: note: within this loop
7 | for(i=1;i<=12;i++){
| ~^~~~
ソースコード
#include<iostream>
using namespace std;
int main(){
int i,j,c=0;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
for(i=1;i<=12;i++){
for(j=1;j<=day[i];j++){
if(j%j+j/10 == i)c++;
}
}
cout << c << endl;
return 0;
}
moshiya02