結果

問題 No.202 1円玉投げ
ユーザー naimonon77naimonon77
提出日時 2016-02-15 15:13:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 985 ms / 5,000 ms
コード長 740 bytes
コンパイル時間 1,150 ms
コンパイル使用メモリ 144,160 KB
実行使用メモリ 400,228 KB
最終ジャッジ日時 2023-08-23 23:15:34
合計ジャッジ時間 13,271 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 309 ms
13,760 KB
testcase_01 AC 985 ms
400,228 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 60 ms
26,940 KB
testcase_06 AC 711 ms
270,844 KB
testcase_07 AC 784 ms
297,356 KB
testcase_08 AC 803 ms
298,964 KB
testcase_09 AC 445 ms
184,868 KB
testcase_10 AC 195 ms
85,656 KB
testcase_11 AC 372 ms
156,244 KB
testcase_12 AC 377 ms
159,600 KB
testcase_13 AC 214 ms
94,244 KB
testcase_14 AC 72 ms
31,048 KB
testcase_15 AC 427 ms
179,616 KB
testcase_16 AC 314 ms
26,316 KB
testcase_17 AC 307 ms
14,140 KB
testcase_18 AC 305 ms
13,960 KB
testcase_19 AC 404 ms
169,852 KB
testcase_20 AC 620 ms
249,172 KB
testcase_21 AC 397 ms
169,036 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 5 ms
4,376 KB
testcase_24 AC 5 ms
4,376 KB
testcase_25 AC 4 ms
4,376 KB
testcase_26 AC 18 ms
7,432 KB
testcase_27 AC 19 ms
7,416 KB
testcase_28 AC 6 ms
4,380 KB
testcase_29 AC 5 ms
4,380 KB
testcase_30 AC 18 ms
7,344 KB
testcase_31 AC 4 ms
4,376 KB
testcase_32 AC 18 ms
7,368 KB
testcase_33 AC 8 ms
4,872 KB
testcase_34 AC 5 ms
4,376 KB
testcase_35 AC 308 ms
15,152 KB
testcase_36 AC 300 ms
11,612 KB
testcase_37 AC 844 ms
314,796 KB
testcase_38 AC 310 ms
15,120 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <string>
#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))

int main() {
  int i,j,k;
  int N;
  static int itien[20020][20020] = {0};
  /*          y      x          */
  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][x+k] == 0) continue;
		else if(400 > SQR(j) + SQR(k) ) valid = false;
	  }
	}
	if(valid) {
	  itien[y][x] = 1; sum++;
	  // printf("i = %d\n",i);
	}
  }
  cout << sum << endl;
  return 0;
}
0