結果

問題 No.188 HAPPY DAY
ユーザー IJMP320IJMP320
提出日時 2015-04-22 00:07:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 678 bytes
コンパイル時間 1,322 ms
コンパイル使用メモリ 143,584 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-29 01:47:03
合計ジャッジ時間 1,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:14: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations]
   FOR(j,1,a[i]+1) {
           ~~~^
main.cpp:6:40: note: in definition of macro ‘FOR’
 #define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
                                        ^
main.cpp:6:33: note: within this loop
 #define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
                                 ^
main.cpp:20:2: note: in expansion of macro ‘FOR’
  FOR(i,1,13) {
  ^~~

ソースコード

diff #

#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 = j / 10;
			c = j - b*10;
			if(i==b+c) ans++;
		}
	}
	cout << ans << endl;
	return 0;
}
0