QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#565804 | #8470. Deep Abyss | MIT Isn’t Training (Jiangqi Dai, Ziqian Zhong, Peter Zhou)# | WA | 59ms | 11340kb | Python3 | 3.1kb | 2024-09-15 22:17:48 | 2024-09-15 22:17:49 |
Judging History
answer
import copy
L = 128
class S:
u: list[list[int]]
def __init__(self, num = None):
self.u = []
if num is not None:
self.u = [None] * L
for w in range(L):
if num&(1<<w):
self.u[w] = 1<<128
else:
self.u[w] = 0
def __and__(self, num):
p = copy.deepcopy(self)
for w in range(L):
if num&(1<<w):
pass
else:
p.u[w] = 0
return p
def __rand__(self, num):
return self.__and__(num)
def __or__(self, num):
p = copy.deepcopy(self)
for w in range(L):
if num&(1<<w):
p.u[w] = 1<<128
return p
def __ror__(self, num):
return self.__or__(num)
def __xor__(self, num):
p = copy.deepcopy(self)
if type(num) != S:
num = S(num)
for w in range(L):
p.u[w] = p.u[w]^num.u[w]
return p
def __rxor__(self, num):
return self.__xor__(num)
def __lshift__(self, x):
p = S(0)
for w in range(L):
if w+x<L: p.u[w+x]=self.u[w]
return p
def __rshift__(self, x):
p = S(0)
for w in range(L):
if w-x>=0: p.u[w-x]=self.u[w]
return p
def __invert__(self):
p = copy.deepcopy(self)
for w in range(L):
p.u[w]^=1<<128
return p
def X():
u = S()
for w in range(L):
u.u.append(1<<w)
return u
x_ = X()
x0 = copy.deepcopy(x_)
def FIXX(W):
if type(W)!=S:
W = S(W)
return W
while True:
try:
U = input()
U = U.strip()
assert U!=''
except:
break
U = U.split(' ')
UP = []
for SS in range(len(U)):
if (not any('0'<=P<='9' for P in U[SS])) and any('a'<=P<='z' for P in U[SS]):
U[SS] = U[SS]+'_'
UP.append(U[SS])
U = ' '.join(U)
while True:
try:
exec(U)
except NameError as e:
try:
exec(f'{e.name} = 0')
except:
pass
continue
break
LL = UP[0]
exec(f'{LL} = FIXX({LL})')
x = x0^x_ # make sure it's zero!
xx = copy.deepcopy(x)
S = 0
R = [0] * 128 + [1]
for i in range(L):
J = -1
ii = 1<<i
for j in range(S,L):
if x.u[j]&ii:
J=j
break
if J == -1:
continue
if J != S:
x.u[J],x.u[S] = x.u[S],x.u[J]
for u in range(0,L):
if u!=S and (x.u[u]&ii):
x.u[u] = x.u[u]^x.u[S]
S += 1
for i in range(L):
if not (x.u[i]&(1<<L)):
continue
out = -1
for j in range(L):
if x.u[i]&(1<<j):
out = j
break
R[out] = 1
#print(x.u)
bad = 0
for a in xx.u:
ss = 0
for i,u in enumerate(R):
if u:
ss += (a>>i)&1
if ss%2:
bad = 1
if bad:
print(':(')
else:
ans = 0
for u in range(L):
if R[u]: ans|=1<<u
print('0x{:x}'.format(ans))
詳細信息
Test #1:
score: 100
Accepted
time: 18ms
memory: 10612kb
input:
x = x | 0x19260817
output:
0x19260817
result:
ok single line: '0x19260817'
Test #2:
score: 0
Accepted
time: 19ms
memory: 10700kb
input:
x = x ^ 0xdeadbeef
output:
:(
result:
ok single line: ':('
Test #3:
score: 0
Accepted
time: 21ms
memory: 10680kb
input:
y = ~x << 3 z = ~x >> 2 w = x & ~0xa k = ~x ^ 0xc k = k << 1 k = k >> 2 x = y ^ z p = k ^ w x = x ^ p
output:
0x9a83dcd41ee6a0f73507b9a83dcd41ef
result:
ok single line: '0x9a83dcd41ee6a0f73507b9a83dcd41ef'
Test #4:
score: 0
Accepted
time: 12ms
memory: 10636kb
input:
x = x | 0x1 x = x << 128
output:
0x0
result:
ok single line: '0x0'
Test #5:
score: 0
Accepted
time: 55ms
memory: 11252kb
input:
a = ~0x85522c8627b00dcca8fced5dd3a64c94 << 106 a = 0x5729d5527c42197253400fdf189d7efe ^ ~a a = a << 100 a = ~a << 43 b = 0xac8fc62f86ad065e524cc53a43d0b6de b = b | ~0xe3efc9deb90a9ad986dc134ce403b83d b = ~b << 7 b = a ^ ~b c = a >> 58 c = c << 110 c = c & ~0xe42400e7403aaf75fc20b521bc485f98 c = ~0x4...
output:
:(
result:
ok single line: ':('
Test #6:
score: 0
Accepted
time: 57ms
memory: 11200kb
input:
a = x >> 85 a = a >> 65 a = a ^ a a = a >> 82 b = a b = ~b >> 60 b = ~b << 36 b = ~b << 61 c = b | 0x17573a1781dd3f679609d22ce4db0666 c = ~c << 77 c = c >> 103 c = ~c >> 48 d = x >> 9 d = ~d ^ ~b d = ~0xc71fc143f736086e7f113b93d916b348 ^ d d = d & ~0xf48b941d3507567c1322e6a557c5e3c e = ~0x6e52970528...
output:
:(
result:
ok single line: ':('
Test #7:
score: 0
Accepted
time: 54ms
memory: 11220kb
input:
a = ~x >> 110 a = 0x15fcaef00b3585d57c1b41bd1ad2bfcc | a a = a >> 111 a = a ^ a b = ~0x404ab8f69f6cb54940a6dfe99b96dbe0 >> 92 b = ~b << 18 b = ~b ^ a b = b & ~0x93008f6cb90c170667e2295c625615b4 c = x ^ a c = ~c | ~0x1e58837cc4eb3f176c3c05565e1afefe c = ~c | ~0xff0b4962a3bc6f76471ca8b1ad1e8af9 c = ~c...
output:
:(
result:
ok single line: ':('
Test #8:
score: 0
Accepted
time: 53ms
memory: 11192kb
input:
a = ~x | ~0x8e8108f82603469f8d93f085dc45aceb a = ~0x3844dd2935e3e0dba867fb3021c21648 | ~a a = ~a << 15 a = a & 0x5d7f0ee530493f4a65de9ac441fde92b b = ~a & ~0xb111eeb7f9e46413798b64bb0540aa29 b = b | ~0x8064d0a029a2239d5cba346aa0bee63b b = ~x ^ ~b b = b >> 103 c = 0xcddb750f7d6a4f74ee2328e04b8c09f7 |...
output:
:(
result:
ok single line: ':('
Test #9:
score: 0
Accepted
time: 55ms
memory: 11068kb
input:
a = ~x << 80 a = ~a ^ ~x a = ~0x1437ce68867e688cb13ef7d81cc79e17 | ~a a = ~a >> 73 b = x b = ~b | ~0xb593eb967efb4dca56f67ba8058df029 b = b ^ b b = b << 48 c = 0xb3beb750dee9d4379ccc662d40d17c06 ^ ~0x8312f1126867ef4ec3a57b6edc8fb37e c = c ^ ~c c = c >> 39 c = c >> 44 d = 0xc163f007eab0588badf3879edf...
output:
:(
result:
ok single line: ':('
Test #10:
score: 0
Accepted
time: 59ms
memory: 11340kb
input:
a = ~x >> 93 a = ~a ^ x a = ~0x80203f340797211509b14f8456eed1b & ~a a = a << 61 b = a ^ x b = b >> 113 b = 0x6808f87a970d6b70e42fc846e2477b3c & b b = ~b >> 91 c = ~a << 50 c = c & 0x77717a13d93bb6f822e1ab03e5331315 c = 0x499d2dec131e1395aae280fb3e917840 & c c = 0x86def2b0e5a1d801aad161b7d5a28d4a | c...
output:
:(
result:
ok single line: ':('
Test #11:
score: 0
Accepted
time: 53ms
memory: 11180kb
input:
a = ~x << 95 a = a << 92 a = 0xbb6d86590920ae9b5a70a27e6efa1cd9 & ~a a = a >> 106 b = x & 0xe7ae251ade1849232e0f07c02b2df719 b = 0xaab45b8bbabd8abd9826c22297217243 & ~b b = ~b << 91 b = ~b << 128 c = a << 24 c = ~c << 32 c = c ^ c c = ~c ^ 0x4bed4b4c16baa5f614784d7e7a5a9625 d = x >> 36 d = ~0x26edc6...
output:
:(
result:
ok single line: ':('
Test #12:
score: 0
Accepted
time: 57ms
memory: 11200kb
input:
a = x a = ~a >> 104 a = a >> 66 a = ~a << 49 b = ~a | ~0xa4f7e28a42e342c43fb391e8eb6df3af b = ~b >> 34 b = b | 0x9d9dc9e561f7191c896ff19eb8fc9062 b = ~b | 0xdb3d55d6398ea033fdb45a2b329f0170 c = ~0x6be34acaed2e9f9efae152afd2040d2a & x c = c ^ ~c c = c >> 82 c = c & ~0x36a20d75017b0a5a6b6c2e6589e5d1f1...
output:
:(
result:
ok single line: ':('
Test #13:
score: 0
Accepted
time: 52ms
memory: 11236kb
input:
a = 0x732d0cbe99fe691bf194ea7ba7ccdd3e | x a = 0x79bd54d0d45175c049aa147c252b86c4 | a a = a ^ ~0x20bc6ffdb6d591c57be232e8a9e7e697 a = a ^ a b = ~x ^ ~0xe839978003fdb1e980c5f8cb233519c b = 0x42cfdad806de5594fad905ec09050b3 & ~b b = 0xd39418c02d03ead4d8170e7c52034999 | ~b b = ~b ^ x c = b ^ ~a c = c &...
output:
:(
result:
ok single line: ':('
Test #14:
score: 0
Accepted
time: 50ms
memory: 11208kb
input:
a = x & ~0xb69640b9b5147df6990b4c387fc8c2fe a = ~a >> 24 a = ~0xa530774832b64b014f7366b83797cd6b & ~a a = a >> 94 b = ~a >> 111 b = b | 0xdd7e50549c09b3f42929465d1c75354b b = ~b << 19 b = ~b ^ x c = ~b c = ~c << 36 c = 0xe6e983f693009a57eeed40d3b4f4f0a9 | ~c c = c >> 58 d = ~b << 6 d = ~d ^ 0xa72bb8...
output:
:(
result:
ok single line: ':('
Test #15:
score: 0
Accepted
time: 58ms
memory: 11328kb
input:
a = ~0xe74a512b28afeefb695cfed97f9bc8b >> 78 a = ~a << 119 a = ~a | ~0xb3efe7fd70660e0c8620cb2788d7f7d2 a = a >> 5 b = ~0x94f86e473733de2b27dd23c1b139fc8e ^ ~a b = b >> 86 b = 0x5dfa33cfcf3dd25cd3939d934af83a67 ^ ~b b = ~x ^ b c = ~x & ~0xebaaf8bbcefde483c2817287fe4cecbb c = ~0x16b8736320361ccb07063...
output:
:(
result:
ok single line: ':('
Test #16:
score: 0
Accepted
time: 59ms
memory: 11208kb
input:
a = x a = a ^ x a = a << 23 a = 0x686a2c9a9cfd83793e5f1bfadb35320a & ~a b = x ^ x b = ~b ^ ~0x24292184494d1955c121ba1eb2587f5f b = ~b ^ b b = b | ~0x6e21170b4854e048264e28236be3021e c = x c = 0xb72949e49fffc0fc4b4d09c2602109e0 & c c = ~c << 17 c = c >> 107 d = b << 71 d = ~0xef75c7663576561cb6822057...
output:
:(
result:
ok single line: ':('
Test #17:
score: 0
Accepted
time: 53ms
memory: 11180kb
input:
a = x << 23 a = a & 0xb8e61bc39e45ac845978f66584283844 a = ~a << 41 a = x ^ ~a b = ~a >> 120 b = ~b | ~0x93fdb80ad864f0c827f23504ba5c468 b = ~b | 0xb9757f7a2acf28271a5e8bc73e4b8764 b = ~b | 0x61ba30b5ead8c06f3d46019bc5d0844f c = b >> 79 c = 0xd72ad330fe7fc6e3287a5b53686a8220 & c c = c << 125 c = ~c ...
output:
:(
result:
ok single line: ':('
Test #18:
score: 0
Accepted
time: 56ms
memory: 11200kb
input:
a = 0xa3494bc8d1d65fc128b30f1e9fb0a2bc a = ~0x485bbb8fcbfe2d85b7ea249bc1e95d68 | a a = ~a << 0 a = a >> 107 b = a b = 0x3103d5fcbe3823975c480b96d57fe95 & b b = ~b | ~0xf22fd621bf632ac28afbac67c10cea7b b = ~b << 6 c = x & ~0xc15be9a075ead8681295e85ea2e1fe7b c = 0x63a0843c0a3d4a5e56ba7dd75873aa4 | c c...
output:
:(
result:
ok single line: ':('
Test #19:
score: 0
Accepted
time: 57ms
memory: 11328kb
input:
a = 0xb75829257f84201bd87795a3fe6501fc & ~x a = ~a & 0x8a52ea715a960c085eff26fce82e0b53 a = a << 104 a = a ^ ~a b = ~0x5aa570eb7c9590ce03e87d464513c918 & 0x81e2a8a5e90db15c3ef9086c9f21f35d b = 0x5ae00d0b91470d15d846a95339b4c1d1 & b b = ~a ^ b b = ~0x5eae9a893ac5d8fb8a4b548f17746505 & ~b c = ~x ^ ~0x...
output:
:(
result:
ok single line: ':('
Test #20:
score: 0
Accepted
time: 48ms
memory: 11144kb
input:
a = 0x77510aee1fb2d691de55b3838139ce99 a = ~x ^ ~a a = ~a >> 43 a = a << 60 b = a ^ 0x5e8e573a92db4c582529e09dd55bdd0a b = b << 127 b = ~b ^ b b = b & ~0x969eed7850d32574b92a01b7acc05673 c = ~x >> 18 c = ~c ^ ~x c = ~c & 0x10a073d0b6e394a384affe816f581921 c = ~c | ~0x86807a1d36714466cdae5d4d137cf6d1...
output:
:(
result:
ok single line: ':('
Test #21:
score: 0
Accepted
time: 49ms
memory: 11196kb
input:
a = ~x << 128 a = ~a ^ ~a a = a >> 61 a = 0xeae457aa1722d8aa9200964f3419cc4 | ~a b = ~0x897c8454b73b1c66fec91400868f14ef & 0xd051d6c54d4142819649314420c9e761 b = ~b << 61 b = ~b >> 21 b = ~b & ~0xed06e34010222055f6652d8d01caf9fe c = ~b c = a ^ c c = b ^ ~c c = c ^ b d = 0x56fe7a257152befec0d9c021033...
output:
:(
result:
ok single line: ':('
Test #22:
score: 0
Accepted
time: 43ms
memory: 11212kb
input:
a = ~x ^ x a = a & 0x7c29888356e35c8dd0d47533c9e6fbe1 a = ~a | ~0xf2ecaa47d9c712c55cebde841b2e2c48 a = a >> 34 b = a b = ~b >> 9 b = 0xd242179ab1c887e514ed91c37d8bd96c & b b = b & 0x9f3697c410a8ea7a6e236892aa6af184 c = b c = 0x5379d490a577b5ad0b77325a7f106796 & ~c c = ~c ^ c c = ~c & ~0x4031d0ea662b...
output:
:(
result:
ok single line: ':('
Test #23:
score: 0
Accepted
time: 58ms
memory: 11340kb
input:
a = ~x << 36 a = ~a ^ ~a a = ~a >> 56 a = ~a ^ x b = a ^ ~a b = b ^ 0xcfa4442b7c53968bbe65c7ce1c5cedd9 b = ~b >> 33 b = b ^ x c = ~0xd19924ca1c09437b8adf36d46127220a | x c = ~c & ~0x745d0ee79b95e683de8358bda3f18fe7 c = c << 10 c = c >> 90 d = b d = 0x686f4f77819e9e2b677e6d3fa3f15325 | ~d d = d << 6 ...
output:
:(
result:
ok single line: ':('
Test #24:
score: 0
Accepted
time: 51ms
memory: 11332kb
input:
a = x a = 0x75f4b15d7c5eaa02c84b7530d5f1fc73 | a a = a >> 62 a = ~a >> 67 b = ~a >> 32 b = ~0x402492a8a967219f48054afc31c355e7 | b b = b ^ b b = b ^ ~x c = ~x ^ 0x320b31ae5db6361f03ce2475496a3b98 c = ~c << 106 c = c << 66 c = ~c & 0xcebfaee8dc2e1e5c128dc4c317959b0c d = c << 108 d = d ^ ~c d = ~d & 0...
output:
:(
result:
ok single line: ':('
Test #25:
score: 0
Accepted
time: 59ms
memory: 11164kb
input:
a = x ^ x a = ~a ^ x a = a << 65 a = ~0xe12ef78630502540cd2177f2804d5398 & a b = 0x544e18cb321682e5c5f815d3ea2cf381 b = b << 126 b = b >> 25 b = ~0x21988e5bb13cd035d992c50d547cfddd | ~b c = ~a << 72 c = c ^ ~c c = ~c | 0x640a20a90d00685883087790cb7065d0 c = 0xa15fd8eb7042d7edeb16e7e4c58e2ade | ~c d ...
output:
0x98449c368629954c7323cb5298860d26
result:
ok single line: '0x98449c368629954c7323cb5298860d26'
Test #26:
score: -100
Wrong Answer
time: 51ms
memory: 11148kb
input:
a = ~x >> 87 a = ~a | 0xbcca93ceb3f420658c0b9b490cbdf562 a = a << 107 a = ~a ^ a b = ~a ^ ~x b = b >> 84 b = ~b & ~0x9ff9beafd33264a43fd0e365a2d43afd b = ~b | 0xdd07bf4d7f35aa00eb12c93879fc6a46 c = ~b >> 69 c = c & 0x9882b3e46f32e2e529516e4a404474a3 c = 0xfd83f514e8238d9911c99e36bff43505 | c c = c <...
output:
0x791774002b90cca08815065036c2497d
result:
wrong answer 1st lines differ - expected: '0x59516400090ee1b08c7700c21e40c87d', found: '0x791774002b90cca08815065036c2497d'