結果
| 問題 | No.188 HAPPY DAY |
| コンテスト | |
| ユーザー |
sper_air_reader
|
| 提出日時 | 2018-02-22 10:33:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 291 bytes |
| コンパイル時間 | 1,508 ms |
| コンパイル使用メモリ | 167,960 KB |
| 実行使用メモリ | 6,812 KB |
| 最終ジャッジ日時 | 2024-09-24 17:23:42 |
| 合計ジャッジ時間 | 1,710 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:7:21: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
7 | int dayMax = days[i];
| ^~~~~~
main.cpp:6:22: note: within this loop
6 | for(int i=1;i<13;i++){
| ~^~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int ans = 0;
for(int i=1;i<13;i++){
int dayMax = days[i];
for(int day=1;day<dayMax+2;day++){
if(i+1==day/10+day%10)ans++;
}
}
cout<<(ans)<<endl;
return 0;
}
sper_air_reader