結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2015-05-04 00:06:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 742 bytes |
コンパイル時間 | 1,516 ms |
コンパイル使用メモリ | 164,732 KB |
実行使用メモリ | 9,216 KB |
最終ジャッジ日時 | 2024-12-22 06:44:56 |
合計ジャッジ時間 | 3,829 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 8 WA * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d%d",&x,&y); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> using namespace std; int N; set<int>S[20001]; const double EPS=1e-8; int main(){ scanf("%d",&N); for(int _=0;_<N;_++){ int x,y; scanf("%d%d",&x,&y); bool flag=true; for(int i=max(x-20,0);i<min(20000,x+21)&&flag;i++){ set<int>::iterator it; it=S[i].lower_bound(y-20); for(;it!=S[i].end();it++){ if(*it>y+20)break; if(hypot(i-x,*it-y)<20+EPS){ flag=false; break; } } } if(flag){ S[x].insert(y); } } int ans=0; for(int i=0;i<=20000;i++)ans+=S[i].size(); printf("%d\n",ans); return 0; }