結果

問題 No.202 1円玉投げ
ユーザー naimonon77naimonon77
提出日時 2016-02-15 15:35:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 841 ms / 5,000 ms
コード長 726 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 149,604 KB
実行使用メモリ 9,140 KB
最終ジャッジ日時 2023-08-23 23:16:03
合計ジャッジ時間 11,090 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 305 ms
9,060 KB
testcase_01 AC 729 ms
8,968 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 20 ms
4,656 KB
testcase_06 AC 587 ms
7,764 KB
testcase_07 AC 669 ms
8,144 KB
testcase_08 AC 705 ms
8,156 KB
testcase_09 AC 302 ms
6,580 KB
testcase_10 AC 91 ms
5,412 KB
testcase_11 AC 226 ms
6,176 KB
testcase_12 AC 236 ms
6,244 KB
testcase_13 AC 105 ms
5,436 KB
testcase_14 AC 24 ms
4,680 KB
testcase_15 AC 285 ms
6,688 KB
testcase_16 AC 362 ms
9,140 KB
testcase_17 AC 275 ms
9,004 KB
testcase_18 AC 276 ms
8,968 KB
testcase_19 AC 260 ms
6,476 KB
testcase_20 AC 503 ms
7,440 KB
testcase_21 AC 260 ms
6,396 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 6 ms
4,508 KB
testcase_24 AC 5 ms
4,416 KB
testcase_25 AC 5 ms
4,500 KB
testcase_26 AC 5 ms
4,380 KB
testcase_27 AC 5 ms
4,376 KB
testcase_28 AC 5 ms
4,504 KB
testcase_29 AC 4 ms
4,376 KB
testcase_30 AC 5 ms
4,568 KB
testcase_31 AC 5 ms
4,384 KB
testcase_32 AC 5 ms
4,384 KB
testcase_33 AC 6 ms
4,380 KB
testcase_34 AC 5 ms
4,488 KB
testcase_35 AC 272 ms
9,012 KB
testcase_36 AC 286 ms
8,984 KB
testcase_37 AC 841 ms
8,408 KB
testcase_38 AC 274 ms
9,028 KB
testcase_39 AC 3 ms
4,384 KB
testcase_40 AC 3 ms
4,504 KB
権限があれば一括ダウンロードができます

ソースコード

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;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#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;
	bool valid = true;
	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) ) valid = false;
	  }
	}
	if(valid) {
	  itien[y].insert(x); sum++;
	  // printf("i = %d\n",i);
	}
  }
  cout << sum << endl;
  return 0;
}
0