結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
158b
|
| 提出日時 | 2015-06-11 02:37:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,202 bytes |
| コンパイル時間 | 1,255 ms |
| コンパイル使用メモリ | 84,300 KB |
| 実行使用メモリ | 6,016 KB |
| 最終ジャッジ日時 | 2024-12-22 09:31:10 |
| 合計ジャッジ時間 | 3,939 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 19 |
ソースコード
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
#include <utility>
using namespace std;
//#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vecy[4] = {0,-1,0,1};
const int Vecx[4] = {1,0,-1,0};
const int Xy = 20000;
const int Pat = 100;
const int Kazu = Xy / Pat + 1;
vector<vector<vector<pair<int,int> > > > field;
bool check(int testy, int testx){
int fy = testy / Pat;
int fx = testx / Pat;
double kyori;
for(int i=0; i<field[fy][fx].size(); i++){
kyori = pow(testy - field[fy][fx][i].first , 2) + pow(testx - field[fy][fx][i].second , 2);
if(kyori < 400){
return false;
}
}
//データ追加
field[fy][fx].push_back(make_pair(testy, testx));
return true;
}
int main(){
int n;
int ans = 0;
int y,x;
//vector
field = vector<vector<vector<pair<int,int> > > >(Kazu, vector<vector<pair<int,int> > >(Kazu, vector<pair<int,int> >()));
cin >> n;
rep(i,n){
cin >> x >> y;
if(check(y,x)){
ans ++;
}
}
cout << ans << endl;
return 0;
}
158b