結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2019-01-05 22:10:14
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 531 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 56,796 KB
最終ジャッジ日時 2023-09-13 22:07:26
合計ジャッジ時間 1,323 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(23, 7) Error: undeclared identifier: 'lc'
candidates (edit distance, scope distance); see '--spellSuggest': 
 (2, 0): 'n' [let declared in /home/judge/data/code/Main.nim(22, 3)]
 (2, 2): '!=' [template declared in /nim-1.6.12/lib/system/comparisons.nim(128, 10)]
 (2, 2): '$' [func declared in /nim-1.6.12/lib/system/dollars.nim(25, 8)]
 (2, 2): '$' [func declared in /nim-1.6.12/lib/system/dollars.nim(25, 8)]

ソースコード

diff #

import sugar, strutils, sets


proc nextString: string =
  result = ""
  while not endOfFile stdin:
    let nextChar = readChar stdin
    case nextChar
    of '\r':
      discard
    of "\n"[0], ' ':
      break
    else:
      add result, nextChar


proc nextInt: int =
  parseInt nextString()


let
  n = nextInt()
  A = lc[nextInt() | (i <- 0 ..< n), int]

var
  B = [0].toSet

proc main: void =
  for j in 0 ..< 2:
    for i in 0 ..< n:
      for b in B:
        incl B, A[i] xor b
  echo B.len
  

when isMainModule:
  main()
0