結果

問題 No.594 壊れた宝物発見機
ユーザー 6soukiti296soukiti29
提出日時 2017-11-10 23:59:56
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 1,644 bytes
コンパイル時間 3,211 ms
コンパイル使用メモリ 67,808 KB
実行使用メモリ 24,516 KB
平均クエリ数 125.10
最終ジャッジ日時 2023-09-23 14:59:22
合計ジャッジ時間 6,570 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils

var
    P : array[3, array[2, int]]
P = [[-100, 100], [-100, 100], [-100, 100]]

for i in 0..2:
    while P[i][0] < P[i][1]:
        var
            m = (P[i][0] + P[i][1]) div 2
            a = 0
            b = 0
            c = 0
        if i == 0:
            echo "? ",@[P[i][0], 0, 0].join(" ")
            a = stdin.readline.parseInt
            echo "? ",@[m, 0, 0].join(" ")
            b = stdin.readline.parseInt
            echo "? ",@[P[i][1], 0, 0].join(" ")
            c = stdin.readline.parseInt
        if i == 1:
            echo "? ",@[0, P[i][0], 0].join(" ")
            a = stdin.readline.parseInt
            echo "? ",@[0, m, 0].join(" ")
            b = stdin.readline.parseInt
            echo "? ",@[0, P[i][1], 0].join(" ")
            c = stdin.readline.parseInt
        if i == 2:
            echo "? ",@[0, 0, P[i][0]].join(" ")
            a = stdin.readline.parseInt
            echo "? ",@[0, 0, m].join(" ")
            b = stdin.readline.parseInt
            echo "? ",@[0, 0, P[i][1]].join(" ")
            c = stdin.readline.parseInt
    
        if a > b and b >= c:
            P[i][0] = m
        elif a > b and b > c:
            P[i][0] = P[i][1]
        elif a > b and b < c and a < c:
            P[i][1] = m
        elif a > b and b < c and a > c:
            P[i][0] = m
        elif a > b and b < c and a == c:
            P[i][0] = m
            P[i][1] = m
        elif a <= b and b < c and P[i][0] == m:
            P[i][1] = m + 1
        elif a < b and b < c:
            P[i][1] = P[i][0]
echo "! ",@[P[0].join(" "), P[1].join(" "), P[2].join(" ")].join(" ")
    
0