結果
問題 | No.1265 Balloon Survival |
ユーザー | mot |
提出日時 | 2020-10-23 23:00:53 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 407 ms / 2,000 ms |
コード長 | 1,156 bytes |
コンパイル時間 | 1,783 ms |
コンパイル使用メモリ | 97,760 KB |
実行使用メモリ | 20,872 KB |
最終ジャッジ日時 | 2023-09-28 17:31:43 |
合計ジャッジ時間 | 8,047 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,376 KB |
testcase_11 | AC | 1 ms
4,376 KB |
testcase_12 | AC | 2 ms
4,376 KB |
testcase_13 | AC | 2 ms
4,376 KB |
testcase_14 | AC | 37 ms
5,012 KB |
testcase_15 | AC | 27 ms
5,244 KB |
testcase_16 | AC | 11 ms
4,380 KB |
testcase_17 | AC | 190 ms
19,472 KB |
testcase_18 | AC | 15 ms
4,380 KB |
testcase_19 | AC | 12 ms
4,380 KB |
testcase_20 | AC | 35 ms
5,080 KB |
testcase_21 | AC | 83 ms
8,268 KB |
testcase_22 | AC | 50 ms
8,312 KB |
testcase_23 | AC | 55 ms
8,244 KB |
testcase_24 | AC | 407 ms
19,912 KB |
testcase_25 | AC | 403 ms
19,876 KB |
testcase_26 | AC | 398 ms
20,872 KB |
testcase_27 | AC | 395 ms
20,328 KB |
testcase_28 | AC | 400 ms
20,148 KB |
testcase_29 | AC | 402 ms
20,032 KB |
testcase_30 | AC | 395 ms
19,968 KB |
testcase_31 | AC | 397 ms
19,780 KB |
testcase_32 | AC | 404 ms
19,708 KB |
testcase_33 | AC | 400 ms
19,624 KB |
testcase_34 | AC | 1 ms
4,380 KB |
testcase_35 | AC | 1 ms
4,380 KB |
ソースコード
#include<iostream> #include<iomanip> #include<cmath> #include<string> #include<cstring> #include<vector> #include<list> #include<algorithm> #include<map> #include<set> #include<queue> #include<stack> using namespace std; typedef long long ll; #define fi first #define se second #define mp make_pair #define mt make_tuple #define pqueue priority_queue const int inf=1e9+7; const ll mod=1e9+7; const ll mod1=998244353; const ll big=1e18; const double PI=2*asin(1); int main() { int N; cin>>N; ll x[N], y[N]; for(int i=0;i<N;++i) cin>>x[i]>>y[i]; priority_queue<tuple<ll, int, int>, vector<tuple<ll, int, int> >, greater<tuple<ll, int, int> > > que; for(int i=0;i<N;++i) { for(int j=0;j<N;++j) { if(i==j) continue; que.push(mt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]), i, j)); } } map<int, int> amap; int ans = 0; tuple<ll, int, int> state; int x1, y1; while(!que.empty()) { state = que.top();que.pop(); x1 = get<1>(state); y1 = get<2>(state); if(amap[x1]>0 || amap[y1]>0) continue; if(x1==0 || y1==0) ans++; if(x1!=0) amap[x1]++; if(y1!=0) amap[y1]++; } cout<<ans<<endl; }