結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2015-05-03 23:35:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,047 bytes |
コンパイル時間 | 1,322 ms |
コンパイル使用メモリ | 165,492 KB |
実行使用メモリ | 9,856 KB |
最終ジャッジ日時 | 2024-12-22 06:11:12 |
合計ジャッジ時間 | 3,970 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<to;x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- int N; int X[101000],Y[101000]; set<int> S[20200]; int ret; void solve() { int i,j,k,l,r,x,y; string s; cin>>N; FOR(i,N) { cin>>X[i]>>Y[i]; int ok=1; for(x=max(0,X[i]-20);x<=min(20000,X[i]+20) && ok;x++) { int dy=sqrt(400-x*x+0.0001); for(y=max(0,Y[i]-dy);y<=min(20000,Y[i]+dy);y++) if(x>=0 && S[x].count(y)) ok=0; } if(ok) ret++, S[X[i]].insert(Y[i]); } cout<<ret<<endl; } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }