結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
ikd
|
| 提出日時 | 2018-07-15 19:27:53 |
| 言語 | Nim (2.2.8) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 3,179 ms |
| コンパイル使用メモリ | 68,316 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-03-21 20:16:44 |
| 合計ジャッジ時間 | 24,234 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 TLE * 10 |
ソースコード
import strutils, sequtils
var
n=stdin.readLine.parseInt
a=stdin.readLine.split.map(parseInt)
proc f(bit: int): int=
if bit==(1 shl n)-1:
return 0
else:
var ret=0
for i in 0..<n:
if (bit and (1 shl i))>0:
continue
for j in 0..<i:
if (bit and (1 shl j))>0:
continue
ret=max(ret, (a[i] xor a[j])+f(bit xor (1 shl i) xor (1 shl j)))
return ret
echo f(0)
ikd