結果

問題 No.26 シャッフルゲーム
ユーザー lice6613
提出日時 2019-04-29 17:30:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 1,739 ms
コンパイル使用メモリ 167,620 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 16:30:32
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(M), Q(M);
  for (int i = 0; i < M; i++)
    cin >> P[i] >> Q[i];
  bool cup[4] = {};
  cup[N] = true;
  for (int i = 0; i < M; i++)
    swap(cup[P[i]], cup[Q[i]]);
  if (cup[1])
    cout << 1 << endl;
  if (cup[2])
    cout << 2 << endl;
  if (cup[3])
    cout << 3 << endl;
}
0