結果

問題 No.282 おもりと天秤(2)
コンテスト
ユーザー kurenaif
提出日時 2016-06-14 20:07:10
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 702 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 535 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 40,020 KB
平均クエリ数 3.00
最終ジャッジ日時 2026-03-30 22:26:31
合計ジャッジ時間 18,588 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:16: SyntaxWarning: "is" with 'int' literal. Did you mean "=="?
  if num is 0:

ソースコード

diff #
raw source code

import sys
import math


def Q(nums):
    print("?", end=" ")
    for num in nums:
        print(num, end=" ")

    print()
    sys.stdout.flush()

def A(nums):
    print("!", end = " ")
    for num in nums:
        if num is 0:
            break
        print(num, end=" ")
    print()

n = int(input())
n*=2
array = [0]*n
for i in range(int(n/2)):
    array[i] = i+1

for count in range(n):
    off = ((count%2))
    Q([0] + array[off:] if off == 1 else array)
    res = list(map(str, input().split()))
    for j in range(math.ceil(n/2.0)):
        if res[j] == ">" and array[2*j+1+off] != 0:
            array[2*j+off], array[2*j+1+off] = array[2*j+1+off], array[2*j+off]
    print(array)

A(array)
0