QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#727503 | #2509. Right-Coupled Numbers | vwxyz# | AC ✓ | 20ms | 10608kb | Python3 | 493b | 2024-11-09 13:18:01 | 2024-11-09 13:18:02 |
Judging History
answer
def Divisors(N):
divisors=[]
for i in range(1,N+1):
if i**2>=N:
break
elif N%i==0:
divisors.append(i)
if i**2==N:
divisors+=[i]+[N//i for i in divisors[::-1]]
else:
divisors+=[N//i for i in divisors[::-1]]
return divisors
T=int(input())
for t in range(T):
N=int(input())
D=Divisors(N)
ans=0
for a in D:
b=N//a
if a<=b and 2*a>=b:
ans=1
print(ans)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 15ms
memory: 10608kb
input:
4 66 55 105 150
output:
1 0 0 1
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 20ms
memory: 10540kb
input:
1000 1 2 3 66 55 105 150 27757 14706 2141 7400 28642 6269 23121 25421 27118 21018 17067 15563 10085 29055 30316 20985 10636 3562 371 15868 20269 17415 2485 7091 4954 21331 28145 2339 4772 1769 17980 2246 7596 2869 5782 16953 3207 19832 3788 1263 26206 12365 14846 20304 23160 13287 25388 3083 16957 1...
output:
1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1 1 0 1 ...
result:
ok 1000 lines