QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#604818 | #2509. Right-Coupled Numbers | ucup-team3474 | AC ✓ | 1ms | 3860kb | C++20 | 532b | 2024-10-02 14:04:59 | 2024-10-02 14:05:01 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1919810;
typedef long long ll;
typedef pair<ll,ll> PII;
ll n,m,k;
ll a[N],b[N];
char s[N];
bool tf[N];
void __(){
scanf("%d",&n);
if(tf[n]) puts("1");
else puts("0");
}
int main(){
int tot=(1<<15);
for(int i=1;i<tot;i++){
for(int j=i,cnt=1;j<tot;j+=i,cnt++){
int u=min(i,cnt),v=max(i,cnt);
if(u*2>=v) tf[j]=1;
}
}
int _=1;
cin>>_;
while(_--){
__();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3720kb
input:
4 66 55 105 150
output:
1 0 0 1
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3860kb
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