結果

問題 No.429 CupShuffle
コンテスト
ユーザー testestest
提出日時 2016-12-04 10:00:00
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 286 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 138 ms
コンパイル使用メモリ 36,664 KB
最終ジャッジ日時 2026-02-23 23:14:09
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 2 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | i,j,a,b,p[1<<17],q[1<<17];
      | ^
main.c: In function 'main':
main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         for(scanf("%d%d%d",&n,&k,&x);k/++i;)p[i]=q[i]=i;
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | i,j,a,b,p[1<<17],q[1<<17];
main.c:6:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    6 |         a=!printf("%d %d",a<b?a:b,a<b?b:a);
      |            ^~~~~~
main.c:6:12: note: include '<stdio.h>' or provide a declaration of 'printf'
/usr/bin/ld: /tmp/cc2C8QF4.o: in function `main':
main.c:(.text.startup+0x128): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

i,j,a,b,p[1<<17],q[1<<17];
main(n,k,x,y,z){
	for(scanf("%d%d%d",&n,&k,&x);k/++i;)p[i]=q[i]=i;
	for(;k--;)--x?scanf("%d%d ",&y,&z),x>0?p[y]^=p[z]^=p[y]^=p[z]:(q[y]^=q[z]^=q[y]^=q[z]):gets(&y);
	for(;n/++j;x-p[q[j]]?*(a?&b:&a)=q[j]:0)scanf("%d",&x);
	a=!printf("%d %d",a<b?a:b,a<b?b:a);
}
0