結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2015-06-17 22:52:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 806 ms / 5,000 ms |
コード長 | 771 bytes |
コンパイル時間 | 919 ms |
コンパイル使用メモリ | 73,820 KB |
実行使用メモリ | 394,112 KB |
最終ジャッジ日時 | 2024-12-22 09:32:00 |
合計ジャッジ時間 | 15,188 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <iomanip> #include <map> using namespace std; typedef long long LL; char board[20001][20001]; void place(int sy, int sx){ for(LL y = sy - 20; y <= sy + 20; y++){ if(y < 0 || 20000 < y) continue; for(LL x = sx - 20; x <= sx + 20; x++){ if(x < 0 || 20000 < x) continue; if((x-sx)*(x-sx) + (y-sy)*(y-sy) >= 400) continue; board[y][x] = 1; } } } int main(){ LL N; cin >> N; LL ans = 0; for(int i = 0; i < N; i++){ int x, y; cin >> x >> y; if(board[y][x] == 0){ place(y, x); ans++; } } cout << ans << endl; return 0; }