結果
| 問題 |
No.429 CupShuffle
|
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2016-10-02 22:53:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,195 bytes |
| コンパイル時間 | 976 ms |
| コンパイル使用メモリ | 88,228 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 13:25:03 |
| 合計ジャッジ時間 | 1,989 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 13 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define LONGINF 1000000000000000000
int first_one[200000] = {};
int second_one[200000] = {};
int main(){
int n, k, x;
cin >> n >> k >> x;
vector<pair<int, int>> hoge;
REP(i, k) {
char a, b;
cin >> a >> b;
if (a != '?') {
hoge.push_back(make_pair(a-'0', b - '0'));
}
}
REP(i, n) {
first_one[i + 1] = i + 1;
cin >> second_one[i+1];
}
for (int i = 0;i < x - 1;++i) {
swap(first_one[hoge[i].first], first_one[hoge[i].second]);
}
for (int i = hoge.size()-1;i >= x-1;--i) {
swap(second_one[hoge[i].first], second_one[hoge[i].second]);
}
for (int i = 1;i <= n;++i) {
if (first_one[i] != second_one[i]) {
cout << i << " ";
}
}
cout << endl;
return 0;
}
kotamanegi