結果
問題 | No.999 てん vs. ほむ |
ユーザー | cosmosky |
提出日時 | 2020-03-07 15:02:00 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 1,550 ms |
コンパイル使用メモリ | 164,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-04-22 15:57:50 |
合計ジャッジ時間 | 13,014 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | WA | - |
testcase_04 | RE | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | RE | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | RE | - |
testcase_18 | WA | - |
testcase_19 | RE | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n,ten,hom; cin >> n; ten=0; hom=0; vector<int> a(2*n); for(int i=0;i<a.size();i++){ cin >> a.at(i); } for(int i=0;i<n;i++){ if(a.at(0)-a.at(1)>a.at(a.size()-1)-a.at(a.size()-2)){ hom+=a.at(0); ten+=a.at(1); a.erase(a.begin()); a.erase(a.begin()+1); }else{ hom+=a.at(a.size()-1); ten+=a.at(a.size()-2); a.erase(a.begin()+a.size()-1); a.erase(a.begin()+a.size()-2); } } cout << hom-ten << endl; }