結果

問題 No.8081 HQ9+
ユーザー 👑 testestest
提出日時 2021-04-01 20:06:32
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 190 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 26,240 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-18 01:21:09
合計ジャッジ時間 986 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 if(strchr(s,'H'))puts("-1");
		else puts(s);
	}else{
		puts("-1");
	}
}
0