結果
問題 | No.429 CupShuffle |
ユーザー |
![]() |
提出日時 | 2016-10-02 22:53:12 |
言語 | C++11 (gcc 11.4.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 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 2 ms
5,248 KB |
ソースコード
#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; }