結果

問題 No.1149 色塗りゲーム
ユーザー tanimani364
提出日時 2021-03-23 18:05:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 82,268 KB
実行使用メモリ 82,640 KB
平均クエリ数 19.88
最終ジャッジ日時 2024-07-17 11:05:04
合計ジャッジ時間 9,852 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#coding:utf-8

import math
import string
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt

	
def main():
	read=stdin.readline

	#edit here!
	n=int(read())

	if n%2==1:
		print(1,(n+1)//2,flush=True)
	else:
		print(2,n//2,flush=True)
	
	while True:
		t=int(read())
		if t==0:
			break
		else:
			k,x=map(int,read().split())
			if x>(n+1)//2:
				y=n//2+1
				print(k,x-y,flush=True)
			else :
				y=n//2+1
				print(k,x+y,flush=True)
if __name__ == '__main__':
	main()
0