結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-02-14 16:37:43 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 310 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 06:31:09 |
| 合計ジャッジ時間 | 595 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &N);
| ^~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d", &M);
| ^~~~~~~~~~~~~~~
main.c:15:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d %d", &P, &Q);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int N, M, P, Q;
int cup[4] = {0};
int i, j;
scanf("%d", &N);
scanf("%d", &M);
cup[N] = 1;
for(i = 0; i < M; i++){
scanf("%d %d", &P, &Q);
j = cup[P];
cup[P] = cup[Q];
cup[Q] = j;
}
for(i = 0; i < 4; i++)
if(cup[i] == 1)
printf("%d\n", i);
return 0;
}
mosmos_21