結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-16 00:42:56 |
| 言語 | Scala(Beta) (3.10.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 557 ms / 5,000 ms |
| + 835µs | |
| コード長 | 528 bytes |
| 記録 | |
| コンパイル時間 | 10,966 ms |
| コンパイル使用メモリ | 271,120 KB |
| 実行使用メモリ | 60,456 KB |
| 最終ジャッジ日時 | 2026-10-12 14:33:46 |
| 合計ジャッジ時間 | 22,194 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
import scala.io.StdIn.readLine
object Main{
def ipow(x : Integer,n : Integer) : Integer=
if(x == n)
1
else if(n % 2 == 0)
ipow(x*x,n/2)
else
x * ipow(x*x,n/2)
def main(args: Array[String]) = {
val n = readLine().toInt
val a = readLine().split(" ").map(_.toInt).sorted.distinct
val dp = Array.fill(ipow(2,15))(false)
dp(0) = true
for(ia <- a){
for(i <- 0 until dp.length){
dp(i ^ ia) = dp(i ^ ia) || dp(i)
}
}
println(dp.count(_ == true))
}
}