結果
問題 | No.26 シャッフルゲーム |
ユーザー |
|
提出日時 | 2018-01-02 13:24:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 1,523 ms |
コンパイル使用メモリ | 168,708 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 01:04:13 |
合計ジャッジ時間 | 2,202 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> a(4); a[n] = 1; REP(i, m) { int p, q; cin >> p >> q; swap(a[p], a[q]); } REP(i, 4) if (a[i] == 1) cout << i << endl; return 0; }