結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  sk3388607083 | 
| 提出日時 | 2018-06-21 15:06:58 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 333 bytes | 
| コンパイル時間 | 148 ms | 
| コンパイル使用メモリ | 22,656 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 17:36:06 | 
| 合計ジャッジ時間 | 669 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%d", &N);
      |   ~~~~~^~~~~~~~~~
main.cpp:10:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |   scanf("%d", &M);
      |   ~~~~~^~~~~~~~~~
main.cpp:15:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |     scanf("%d %d", &P, &Q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(void){
  int i;
  int N, M, P, Q;
  int S[4] = {};
  int tmp;
  scanf("%d", &N);
  scanf("%d", &M);
  S[N] = 1;
  for(i = 0 ; i < M; i ++){
    scanf("%d %d", &P, &Q);
    tmp = S[P];
    S[P] = S[Q];
    S[Q] = tmp;
  }
  for(i = 0; i < 4; i++){
    if(S[i] == 1) printf("%d\n", i);
  }
  return 0;
}
            
            
            
        