結果

問題 No.1026 OGAWA's New Keyboard
ユーザー fura
提出日時 2020-04-18 00:26:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 314 bytes
コンパイル時間 2,464 ms
コンパイル使用メモリ 197,248 KB
最終ジャッジ日時 2025-01-09 20:56:08
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         int n; scanf("%d",&n);
      |                ~~~~~^~~~~~~~~
main.cpp:12:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 char c; scanf("%d %c",&t,&c);
      |                         ~~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n; scanf("%d",&n);
	deque<char> D;
	rep(i,n){
		int t;
		char c; scanf("%d %c",&t,&c);
		if(t==0) D.emplace_back(c);
		else     D.emplace_front(c);
	}

	rep(i,D.size()) putchar(D[i]); puts("");

	return 0;
}
0