結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2015-05-16 00:35:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 997 ms / 5,000 ms |
コード長 | 276 bytes |
コンパイル時間 | 1,778 ms |
コンパイル使用メモリ | 171,076 KB |
実行使用メモリ | 9,984 KB |
最終ジャッジ日時 | 2024-12-22 09:11:17 |
合計ジャッジ時間 | 11,261 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<bits/stdc++.h> | ^~~~~~ main.cpp:3:35: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 3 | using namespace std;int n,x,y,f,r;main(){map<int,set<int>> a;for(cin>>n;cin>>x>>y;!f?a[x].insert(y),++r:(f=0))F(i,a,x)F(j,i->second,y)f|=hypot(x-i->first,y-*j)<20;cout<<r<<endl;} | ^~~~
ソースコード
#import<bits/stdc++.h> #define F(i,a,x)for(auto i=a.lower_bound(x-20);i!=a.upper_bound(x+40);++i) using namespace std;int n,x,y,f,r;main(){map<int,set<int>> a;for(cin>>n;cin>>x>>y;!f?a[x].insert(y),++r:(f=0))F(i,a,x)F(j,i->second,y)f|=hypot(x-i->first,y-*j)<20;cout<<r<<endl;}