結果

問題 No.3081 HQ9+
ユーザー testestesttestestest
提出日時 2021-04-01 20:04:15
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 154 bytes
コンパイル時間 961 ms
コンパイル使用メモリ 25,644 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-22 22:34:35
合計ジャッジ時間 1,664 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 0 ms
4,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 0 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 0 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:3:9: 警告: 関数 ‘scanf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    3 |         scanf("%*d %s",s);
      |         ^~~~~
main.c:1:1: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | char s[100010];
main.c:3:9: 警告: 組み込み関数 ‘scanf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
    3 |         scanf("%*d %s",s);
      |         ^~~~~
main.c:3:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:5:14: 警告: 関数 ‘strchr’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    5 |         if(p=strchr(s,'Q')){
      |              ^~~~~~
main.c:1:1: 備考: include ‘<string.h>’ or provide a declaration of ‘strchr’
  +++ |+#include <string.h>
    1 | char s[100010];
main.c:5:14: 警告: 組み込み関数 ‘strchr’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
    5 |         if(p=strchr(s,'Q')){
      |              ^~~~~~
main.c:5:14: 備考: include ‘<string.h>’ or provide a declaration of ‘strchr’
main.c:6:36: 警告: 関数 ‘puts’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    6 |                 if(strchr(p+1,'Q'))puts("-1");
      |                                    ^~~~
main.c:6:36: 備考: 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