結果
問題 |
No.190 Dry Wet Moist
|
ユーザー |
![]() |
提出日時 | 2015-11-19 21:12:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 524 bytes |
コンパイル時間 | 1,789 ms |
コンパイル使用メモリ | 163,576 KB |
実行使用メモリ | 13,760 KB |
最終ジャッジ日時 | 2024-09-13 17:04:15 |
合計ジャッジ時間 | 7,658 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 WA * 9 TLE * 2 -- * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; n*=2; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; sort(a.begin(),a.end()); int s=0,t=a.size()-1; int dry=0,moist=0,wet=0; while(s<t){ if(a[s]+a[t]<0){ dry++; s++; t--; } else t--; } for(int i=0;i<(int)a.size()&&a[i]<=0;i++){ if(find(a.begin(),a.end(),-a[i])!=a.end()) moist++; } s=0,t=a.size()-1; while(s<t){ if(a[s]+a[t]>0){ wet++; s++; t--; } else s++; } cout<<dry<<" "<<wet<<" "<<moist<<endl; return 0; }