結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  IJMP320 | 
| 提出日時 | 2015-04-22 00:05:54 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 684 bytes | 
| コンパイル時間 | 1,627 ms | 
| コンパイル使用メモリ | 158,412 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-30 19:44:07 | 
| 合計ジャッジ時間 | 2,048 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 1 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:28: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
   21 |                 FOR(j,1,a[i]+1) {
      |                         ~~~^
main.cpp:6:40: note: in definition of macro ‘FOR’
    6 | #define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
      |                                        ^
main.cpp:6:33: note: within this loop
    6 | #define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
      |                                 ^
main.cpp:20:9: note: in expansion of macro ‘FOR’
   20 |         FOR(i,1,13) {
      |         ^~~
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define F first
#define S second
const int INF = 2000000000;
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
struct P{int x;int y;P(int X=0,int Y=0){x=X;y=Y;}};
int main() {
	int a[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int ans = 0;
	FOR(i,1,13) {
		FOR(j,1,a[i]+1) {
			int b,c;
			b = a[i] / 10;
			c = a[i] - b*10;
			if(i==b+c) ans++;
		}
	}
	cout << ans << endl;
	return 0;
}
            
            
            
        