Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

問題: Three Coins #21

Merged
merged 6 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion three-coins/PROBLEM
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pid='three-coins'

problem(
time_limit=1.0,
time_limit=2.0,
id=pid,
title="Three Coins",
)
18 changes: 15 additions & 3 deletions three-coins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@

より形式的には、集合 $S$ を $S = \{ X_1, X_2, \ldots, X_M \} = \{ A_i + A_j + A_k \mid 1 \le i \le j \le k \le N \}$ と定めます。
このとき、 $S$ のすべての要素について XOR をとった結果、すなわち $X_1 \oplus X_2 \oplus \ldots \oplus X_M$ を求めてください。
ただし、 $\oplus$ は bitwise XOR を表します。
ただし、 $\oplus$ は XOR を表します。

<details>
<summary>XOR とは?</summary>
整数 $a, b$ の XOR $a \oplus b$ は、以下のように定義されます。

- $a \oplus b$ を二進表記した際の $2^k (k \ge 0)$ の位の数は、$a, b$ を二進表記した際の $2^k$ の位の数のうち一方のみが $1$ であれば $1$ 、そうでなければ $0$ である。

例えば、 $3 \oplus 5 = 6$ となります (二進表記すると: $011 \oplus 101=110$) 。

なお、この演算において、計算する順序によらず求める値は一意に定まります。

</details>

## 制約

Expand All @@ -25,8 +37,8 @@
この問題には部分点が設定されている。
以下の条件を満たすテストケースすべてに正解した場合、記載された点数が得られる。

thirofoo marked this conversation as resolved.
Show resolved Hide resolved
- (1 点) $N \le 200$
- (99 点) 追加の制約はない。
- (10 点) $N \le 200$
- (90 点) 追加の制約はない。

## 入力

Expand Down
2 changes: 1 addition & 1 deletion three-coins/sol-cpp-partial1/SOLUTION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8; mode: python -*-
cxx_solution(src='main.cc', flags=["-std=c++2a", "-O2"], challenge_cases=["*_all.in"])
expected_score(1)
expected_score(10)
2 changes: 1 addition & 1 deletion three-coins/sol-cpy-partial1/SOLUTION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8; mode: python -*-
script_solution(src='main.py', challenge_cases=["*_all.in"])
expected_score(1)
expected_score(10)
2 changes: 1 addition & 1 deletion three-coins/sol-pypy-partial1/SOLUTION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8; mode: python -*-
script_solution(src='main.py', challenge_cases=["*_all.in"])
expected_score(1)
expected_score(10)
4 changes: 2 additions & 2 deletions three-coins/tests/TESTSET
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
cxx_validator(src='validator.cc', dependency=['testlib.h'], flags=["-std=c++2a", "-O2"])
cxx_judge(src='judge.cc', dependency=['testlib.h'], variant=testlib_judge_runner, flags=["-std=c++2a", "-O2"])
id='three-coins'
subtask_testset(name='Task 1', score=1, input_patterns=['*_task1.in'])
subtask_testset(name='All', score=99, input_patterns=['*_all.in'])
subtask_testset(name='Task 1', score=10, input_patterns=['*_task1.in'])
subtask_testset(name='All', score=90, input_patterns=['*_all.in'])