結果

問題 No.201 yukicoderじゃんけん
コンテスト
ユーザー %20
提出日時 2016-12-22 02:19:18
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 201 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 193 ms
コンパイル使用メモリ 36,664 KB
最終ジャッジ日時 2026-02-23 23:55:43
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | i;char S[2][101],P[2][100000];
      | ^
main.c: In function 'main':
main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         scanf("%s%s%*s%s%s%*s",S[0],P[0],S[1],P[1]);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | i;char S[2][101],P[2][100000];
main.c:4:16: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    4 |         if(!(t=strlen(P[0])-strlen(P[1])))
      |                ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | i;char S[2][101],P[2][100000];

ソースコード

diff #
raw source code

i;char S[2][101],P[2][100000];
main(t){
	scanf("%s%s%*s%s%s%*s",S[0],P[0],S[1],P[1]);
	if(!(t=strlen(P[0])-strlen(P[1])))
		for(;i<strlen(*P)&!(t=P[0][i]-P[1][i]);++i);
	i=!puts((*P)[i]?S[t<0]:"-1");
}
0