結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
Lay_ec
|
| 提出日時 | 2015-05-04 00:50:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 916 bytes |
| コンパイル時間 | 1,137 ms |
| コンパイル使用メモリ | 95,780 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-12-22 07:56:41 |
| 合計ジャッジ時間 | 12,193 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 23 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>
using namespace std;
int main()
{
map<int,vector<int> > t;
for(int i=-19;i<=19;i++){
for(int j=-19;j<=19;j++){
if(i*i+j*j<400) t[i].push_back(j);
}
}
map<pair<int,int>,bool > coin;
int n;
cin>>n;
long res=0;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
bool ok=true;
for(int dx=-19;dx<=19 && ok;dx++){
for(int j=0;j<t[i].size() && ok;j++){
int nx=x+dx,ny=y+t[dx][j];
//cout<<nx<<" "<<ny<<endl;
if(coin[make_pair(nx,ny)]==false) continue;
//cout<<"exist:"<<nx<<" "<<ny<<endl;
if(dx*dx+t[dx][j]*t[dx][j]<400)ok=false;
}
}
if(ok){res++; coin[make_pair(x,y)]=true;}
}
cout<<res<<endl;
return 0;
}
Lay_ec