結果

問題 No.202 1円玉投げ
ユーザー naimonon77naimonon77
提出日時 2016-02-15 15:37:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 635 ms / 5,000 ms
コード長 721 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 163,676 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2024-06-01 20:43:45
合計ジャッジ時間 9,866 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 248 ms
8,960 KB
testcase_01 AC 635 ms
8,960 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 18 ms
5,376 KB
testcase_06 AC 488 ms
7,680 KB
testcase_07 AC 585 ms
8,192 KB
testcase_08 AC 579 ms
8,064 KB
testcase_09 AC 265 ms
6,528 KB
testcase_10 AC 82 ms
5,376 KB
testcase_11 AC 202 ms
6,272 KB
testcase_12 AC 209 ms
6,272 KB
testcase_13 AC 94 ms
5,504 KB
testcase_14 AC 19 ms
5,376 KB
testcase_15 AC 255 ms
6,528 KB
testcase_16 AC 312 ms
8,960 KB
testcase_17 AC 229 ms
9,088 KB
testcase_18 AC 230 ms
9,088 KB
testcase_19 AC 236 ms
6,400 KB
testcase_20 AC 428 ms
7,552 KB
testcase_21 AC 233 ms
6,272 KB
testcase_22 AC 4 ms
5,376 KB
testcase_23 AC 5 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 AC 4 ms
5,376 KB
testcase_26 AC 4 ms
5,376 KB
testcase_27 AC 4 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 4 ms
5,376 KB
testcase_30 AC 4 ms
5,376 KB
testcase_31 AC 3 ms
5,376 KB
testcase_32 AC 4 ms
5,376 KB
testcase_33 AC 4 ms
5,376 KB
testcase_34 AC 4 ms
5,376 KB
testcase_35 AC 231 ms
9,088 KB
testcase_36 AC 268 ms
9,088 KB
testcase_37 AC 627 ms
8,448 KB
testcase_38 AC 231 ms
8,960 KB
testcase_39 AC 4 ms
5,376 KB
testcase_40 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |         scanf("%d %d",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~~
main.cpp:32:9: warning: ‘k’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   32 |         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;

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;
	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;
  return 0;
}
0