結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2016-03-27 23:51:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,280 bytes |
| コンパイル時間 | 1,039 ms |
| コンパイル使用メモリ | 77,200 KB |
| 実行使用メモリ | 30,080 KB |
| 最終ジャッジ日時 | 2024-12-22 10:12:41 |
| 合計ジャッジ時間 | 6,522 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 RE * 22 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <limits.h>
#include <time.h>
#include <string>
#include <string.h>
#include <sstream>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
struct Coord {
int y;
int x;
Coord(int y = -1, int x = -1){
this->y = y;
this->x = x;
}
};
vector<Coord> field[1001][1001];
int main(){
int n;
cin >> n;
int x, y;
int cnt = 0;
for(int i = 0; i < n; i++){
cin >> x >> y;
int cy = y/20;
int cx = x/20;
bool success = true;
for(int curY = cy-1; curY <= cy+1 && success; curY++){
for(int curX = cx-1; curX <= cx+1 && success; curX++){
if(curY < 0 || 2001 <= curY || curX < 0 || 2001 <= curX) continue;
int size = field[curY][curX].size();
for(int j = 0; j < size; j++){
Coord coord = field[curY][curX][j];
int dy = coord.y - y;
int dx = coord.x - x;
int dist = dy*dy + dx*dx;
if(dist < 400){
success = false;
}
}
}
}
if(success){
field[cy][cx].push_back(Coord(y,x));
cnt++;
}
}
cout << cnt << endl;
return 0;
}
siman