結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2015-05-04 00:33:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 124 ms / 5,000 ms |
コード長 | 717 bytes |
コンパイル時間 | 3,946 ms |
コンパイル使用メモリ | 165,248 KB |
実行使用メモリ | 9,344 KB |
最終ジャッジ日時 | 2024-12-22 07:34:52 |
合計ジャッジ時間 | 4,057 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d%d",&x,&y); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> using namespace std; int N; set<int>S[20001]; 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(20001,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.0){ 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; }