結果

問題 No.1026 OGAWA's New Keyboard
ユーザー tails
提出日時 2020-04-14 16:04:55
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 24 ms / 1,000 ms
コード長 135 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 27,264 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-16 04:57:40
合計ジャッジ時間 944 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int]
    4 | main(n,t,s){
      | ^~~~
main.c: In function 'main':
main.c:4:1: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:4:1: warning: type of 't' defaults to 'int' [-Wimplicit-int]
main.c:4:1: warning: type of 's' defaults to 'int' [-Wimplicit-int]
main.c:5:13: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         for(scanf("%d",&n);~scanf("%d%s",&t,&s);){
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char a[410000];
main.c:5:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         for(scanf("%d",&n);~scanf("%d%s",&t,&s);){
      |             ^~~~~
main.c:5:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:9: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    8 |         puts(a+i);
      |         ^~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'puts'

ソースコード

diff #

char a[410000];
int i=205000;
int j=205000;
main(n,t,s){
	for(scanf("%d",&n);~scanf("%d%s",&t,&s);){
		a[t?--i:j++]=s;
	}
	puts(a+i);
}
0