結果
| 問題 |
No.429 CupShuffle
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-10-12 13:42:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 967 bytes |
| コンパイル時間 | 1,137 ms |
| コンパイル使用メモリ | 80,796 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 20:28:51 |
| 合計ジャッジ時間 | 3,975 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 4 RE * 9 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef pair<int,int> Paint;
int main(){
int n,k,x;cin>>n>>k>>x;
vector<Paint> z;
for(int i = 0; k > i; i++){
char a,b;cin>>a>>b;
if(a=='?'){
z.push_back({0,0});
}else{
z.push_back({a-'0',b-'0'});
}
}
vector<int> mae;
for(int i = 0; n > i; i++){
mae.push_back(i+1);
}
vector<int> usi(n);
for(int i = 0; n > i; i++){
cin>>usi[i];
}
for(int i = 0; k > i; i++){
if(!z[i].first)break;
swap(mae[z[i].first-1],mae[z[i].second-1]);
}
for(int i = k-1; 0 <= i; i--){
if(!z[i].first)break;
swap(usi[z[i].first-1],usi[z[i].second-1]);
}
vector<int> ans;
for(int i = 0; n > i; i++){
if(mae[i]!=usi[i]){
ans.push_back(i+1);
}
}
cout << ans[0] << " " << ans[1] << endl;
}