QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#788514 | #9225. Fibonacci Fusion | ucup-team2179# | RE | 7ms | 10604kb | Python3 | 434b | 2024-11-27 17:15:39 | 2024-11-27 17:15:39 |
Judging History
answer
base = 131
mod = 1e18 +21
def hash(x):
res = 0
while (x):
res = (res * base + x % 10)
x //= 10
return res
n = int(input())
arr = []
for i in range(n):
x = int(input())
arr.append(x)
arr.sort()
fib1 = 1
fib2 = 1
ans = 0
dict = {}
for x in arr:
while fib2 <= x:
fib2 = fib1 + fib2
fib1 = fib2 - fib1
val = dict.get(hash(fib2 - x))
if (val != None):
ans = ans + 1
dict[hash(x)] = 1
print(ans)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 7ms
memory: 10604kb
input:
6 50 8 8 5 72 354224848179261915070
output:
4
result:
ok 1 number(s): "4"
Test #2:
score: -100
Dangerous Syscalls
input:
28 200878223506436882933619847964496455022155117513398820563747455993172799881403389571477889821109288771413214004090719097929400406252135763028179112130390003528046316900603668569910008417315162907579003880220844686222148696041857432602133894827753998572080650383305777912447151917272483538029469449...