結果

問題 No.3274 Arithmetic Right Shift
ユーザー Yakumo221
提出日時 2025-09-20 01:45:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 1,500 ms
コード長 262 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 80,296 KB
最終ジャッジ日時 2025-09-20 01:45:23
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

q = int(input())
while q:
	q -= 1
	k = int(input())
	s = list(input())
	
	n = len(s)
	
	if k >= n:
		ans = s[0] * n
		print(ans)
		continue
	
	s = deque(s)
	for i in range(k):
		s.appendleft(s[0])
		s.pop()
	
	print("".join(s))
	
	
0