結果

問題 No.3081 HQ9+
ユーザー testestesttestestest
提出日時 2021-04-01 20:04:15
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 154 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 25,856 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-10 04:11:41
合計ジャッジ時間 2,093 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         scanf("%*d %s",s);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char s[100010];
main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         scanf("%*d %s",s);
      |         ^~~~~
main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:14: warning: implicit declaration of function 'strchr' [-Wimplicit-function-declaration]
    5 |         if(p=strchr(s,'Q')){
      |              ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strchr'
  +++ |+#include <string.h>
    1 | char s[100010];
main.c:5:14: warning: incompatible implicit declaration of built-in function 'strchr' [-Wbuiltin-declaration-mismatch]
    5 |         if(p=strchr(s,'Q')){
      |              ^~~~~~
main.c:5:14: note: include '<string.h>' or provide a declaration of 'strchr'
main.c:6:36: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    6 |                 if(strchr(p+1,'Q'))puts("-1");
      |                                    ^~~~
main.c:6:36: note: include '<stdio.h>' or provide a declaration of 'puts'

ソースコード

diff #

char s[100010];
int main(){
	scanf("%*d %s",s);
	char*p;
	if(p=strchr(s,'Q')){
		if(strchr(p+1,'Q'))puts("-1");
		else puts(s);
	}else{
		puts("-1");
	}
}
0