結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2016-10-04 23:02:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 301 ms / 5,000 ms |
コード長 | 688 bytes |
コンパイル時間 | 938 ms |
コンパイル使用メモリ | 66,308 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-22 10:49:40 |
合計ジャッジ時間 | 4,576 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) vector<int> center[20100]; int main(void){ int n; cin >> n; int ans = 0; rep(i, n){ int cx, cy; cin >> cx >> cy; int xl = max(0, cx - 20); int xr = cx + 20; bool flag = true; for (int nx = xl; nx <= xr; ++nx){ for(auto ny : center[nx]){ int len = (nx - cx) * (nx - cx) + (ny - cy) * (ny - cy); if(len < 400){//長さの二乗 flag = false; break; } } } if(flag){ ans++; center[cx].push_back(cy); } } printf("%d\n", ans); return 0; }