結果

問題 No.934 Explosive energy drink
ユーザー dot_haraaidot_haraai
提出日時 2021-04-03 12:36:21
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 952 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 86,024 KB
最終ジャッジ日時 2024-04-27 03:45:11
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 18) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(22, 13) Error: attempting to call routine: 'n'
  found 'n' [var declared in /home/judge/data/code/Main.nim(19, 5)]

ソースコード

diff #

import times, strutils, sequtils, math, algorithm, tables, sets, lists, intsets
import critbits, future, strformat, deques
template `max=`(x,y) = x = max(x,y)
template `min=`(x,y) = x = min(x,y)
template `mod=`(x,y) = x = x mod y
template scan2 = (scan(), scan())
template scan3 = (scan(), scan())
let read* = iterator: string {.closure.} =
    while true: (for s in stdin.readLine.split: yield s)
proc scan(): int = read().parseInt
proc scanf(): float = read().parseFloat
proc toInt(c:char): int =
    return int(c) - int('0')



proc solve()=
  var
    n = scan()
    recipe = newseqwith(n,true)
  for i in 0..<n:
    echo fmt"? {n-1}"
    var t = newseq[int]()
    for j in 0..<n:
      if i!=j:
        t.add(j+1)
    echo t.join(" ")
    var
      ans = scan()
    if ans == 1:
      recipe[i] = false
    #else:

  var
    a = newseq[int]()
  for i in 0..<n:
    if recipe[i]:
      a.add(i+1)
  echo fmt"! {a.len}"
  echo a.join(" ")

  
solve()
0