結果

問題 No.202 1円玉投げ
ユーザー naimonon77naimonon77
提出日時 2016-02-15 15:39:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 729 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 1,170 ms
コンパイル使用メモリ 149,692 KB
実行使用メモリ 9,108 KB
最終ジャッジ日時 2023-08-23 23:19:41
合計ジャッジ時間 10,252 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 264 ms
9,024 KB
testcase_01 AC 729 ms
9,000 KB
testcase_02 AC 2 ms
4,508 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 17 ms
4,788 KB
testcase_06 AC 556 ms
7,732 KB
testcase_07 AC 632 ms
8,116 KB
testcase_08 AC 634 ms
8,152 KB
testcase_09 AC 273 ms
6,752 KB
testcase_10 AC 80 ms
5,448 KB
testcase_11 AC 204 ms
6,300 KB
testcase_12 AC 209 ms
6,284 KB
testcase_13 AC 93 ms
5,592 KB
testcase_14 AC 20 ms
4,644 KB
testcase_15 AC 257 ms
6,468 KB
testcase_16 AC 295 ms
9,044 KB
testcase_17 AC 219 ms
9,008 KB
testcase_18 AC 221 ms
9,108 KB
testcase_19 AC 234 ms
6,388 KB
testcase_20 AC 456 ms
7,596 KB
testcase_21 AC 234 ms
6,336 KB
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 5 ms
4,472 KB
testcase_24 AC 4 ms
4,376 KB
testcase_25 AC 4 ms
4,376 KB
testcase_26 AC 4 ms
4,548 KB
testcase_27 AC 5 ms
4,468 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 4 ms
4,380 KB
testcase_30 AC 5 ms
4,408 KB
testcase_31 AC 3 ms
4,376 KB
testcase_32 AC 4 ms
4,544 KB
testcase_33 AC 4 ms
4,376 KB
testcase_34 AC 5 ms
4,380 KB
testcase_35 AC 218 ms
8,972 KB
testcase_36 AC 258 ms
9,104 KB
testcase_37 AC 720 ms
8,352 KB
testcase_38 AC 218 ms
9,008 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:26:2: warning: ‘k’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if(j == 20 && k == 20) {
  ^~

ソースコード

diff #

#include <bits/stdc++.h>
#include <string>
#include <set>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
#define SQR(X) ((X)*(X))
set<int> itien[20020];
int main() {
  int i,j,k;
  int N;
  int sum = 0;
  cin >> N;
  rep(i,N) {
	int y,x;
	scanf("%d %d",&x,&y);
	for(j=-19;j<20;j++) {
	  if(y+j < 0) continue;
	  for(k=-19;k<20;k++) {
		if(x+k < 0) continue;
		if(itien[y+j].find(x+k) == itien[y+j].end()) continue;
		else if(400 > SQR(j) + SQR(k) ) goto end;
	  }
	}
  end:
	if(j == 20 && k == 20) {
	  itien[y].insert(x); sum++;
	  // printf("i = %d\n",i);
	}
  }
  cout << sum << endl;
}
0