No.5005 3-SAT
タグ : / 解いたユーザー数 30
作問者 :
trineutron
/ テスター :
butsurizuki
Problem Statement
Choose a $256$-digit binary number so that it satisfies as many of the following conditions as possible, in order from the first one.
Condition $i (0 \le i \lt 2048)$: at least one of the following 1, 2, 3 holds.
- The $(a_i + 1)$-th digit from the bottom is $p_i$
- The $(b_i + 1)$-th digit from the bottom is $q_i$
- The $(c_i + 1)$-th digit from the bottom is $r_i$
The score of a case is the smallest index among the conditions that are not satisfied. If all conditions are satisfied, the score of that case is 2048 points.
There are 100 test cases. The score of a submission is the sum of the scores of all cases.
Input
$a_0\ b_0\ c_0\ p_0\ q_0\ r_0$
$a_1\ b_1\ c_1\ p_1\ q_1\ r_1$
$\dots$
$a_{2047}\ b_{2047}\ c_{2047}\ p_{2047}\ q_{2047}\ r_{2047}$
All input values are integers, chosen uniformly at random from the following ranges.
- $0 \le a_i, b_i, c_i \lt 256$
- $p_i, q_i, r_i$ is $0$ or $1$
Output
Output a 256-digit binary number. If the first character is not '0' or '1', the verdict is WA. Otherwise, if fewer digits than required are read, '0' is prepended for the missing number of digits. If there are too many digits, only the first 256 digits are read.
Sample
Sample 1
Input
78 174 4 1 0 1 101 61 23 1 0 1 80 117 81 1 1 1 218 198 151 1 1 1 146 189 208 0 1 1 206 248 18 1 1 0 109 48 42 1 1 1 237 231 134 0 0 1 199 34 120 0 1 0 239 65 8 1 1 0 124 219 151 0 0 1 21 59 145 0 0 0 237 161 93 1 1 1 85 1 13 1 1 1 170 178 21 1 1 0 161 252 75 1 1 1 210 172 224 1 0 1 235 226 121 1 0 0 119 82 63 1 0 1 162 177 62 1 1 0 127 34 145 0 1 1 0 242 103 1 1 1 168 210 40 1 1 0 40 251 187 0 0 0
Output
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
This input is shorter than the actual one for the sake of explanation. The first unsatisfied condition is condition 11, so the score of this case is 11 points.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。