結果

問題 No.202 1円玉投げ
ユーザー ttkkggwwttkkggww
提出日時 2022-09-20 05:51:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 933 bytes
コンパイル時間 3,906 ms
コンパイル使用メモリ 261,852 KB
実行使用メモリ 321,412 KB
最終ジャッジ日時 2023-08-24 00:25:34
合計ジャッジ時間 22,952 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 446 ms
9,148 KB
testcase_01 AC 979 ms
321,412 KB
testcase_02 AC 219 ms
4,376 KB
testcase_03 AC 220 ms
4,376 KB
testcase_04 AC 220 ms
4,376 KB
testcase_05 AC 260 ms
26,724 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 383 ms
89,364 KB
testcase_14 AC 266 ms
30,520 KB
testcase_15 WA -
testcase_16 AC 425 ms
9,548 KB
testcase_17 AC 456 ms
11,600 KB
testcase_18 AC 454 ms
11,396 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 227 ms
7,464 KB
testcase_23 AC 226 ms
7,452 KB
testcase_24 AC 226 ms
7,572 KB
testcase_25 AC 225 ms
7,584 KB
testcase_26 AC 220 ms
4,380 KB
testcase_27 AC 221 ms
4,376 KB
testcase_28 AC 221 ms
4,376 KB
testcase_29 AC 222 ms
4,380 KB
testcase_30 AC 227 ms
7,444 KB
testcase_31 WA -
testcase_32 AC 227 ms
7,468 KB
testcase_33 WA -
testcase_34 AC 223 ms
4,380 KB
testcase_35 AC 447 ms
7,212 KB
testcase_36 AC 464 ms
10,692 KB
testcase_37 WA -
testcase_38 AC 451 ms
7,252 KB
testcase_39 AC 222 ms
4,512 KB
testcase_40 AC 222 ms
4,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
int n;
vector<ll> x,y;
bool is[20001][20001];
vector<int> dx,dy;

bool dist20(int sx,int sy){
	return sx*sx+sy*sy<400;
}

void solve(){
	for(int i = -30;i<30;i++){
		for(int j = -30;j<30;j++){
			if(dist20(i,j)){
				dx.push_back(i);
				dy.push_back(j);
			}
		}
	}
	for(int i = 0;i<n;i++){
		bool canon = true;
		for(int j = 0;j<dx.size();j++){
			int nx = x[i]+dx[j];
			int ny = y[i]+dy[j];
			if(0<=nx&&nx<20001){
				if(0<=ny&&ny<20001){
					if(is[nx][ny]){
						canon = false;
					}
				}
			}
		}
		is[x[i]][y[i]] = canon;
	}
	int ans = 0;
	for(int i = 0;i<20001;i++){
		for(int j = 0;j<20001;j++){
			ans += is[i][j];
		}
	}
	cout<<ans<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> n;
	x = y = vector<ll>(n);
	for(int i =0;i<n;i++){
		cin >> x[i] >> y[i];
	}
	solve();
}
0