QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#326156#2509. Right-Coupled NumbersRabeya#AC ✓1ms3656kbC++20898b2024-02-12 13:50:332024-02-12 13:50:34

Judging History

你现在查看的是最新测评结果

  • [2024-02-12 13:50:34]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3656kb
  • [2024-02-12 13:50:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef unordered_map<int,int> umap;
typedef long double ld;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define popcount __builtin_popcount
#define case cout<<"Case "<<__testcase-testcase<<": ";
#define endl '\n'

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int testcase=1;
    cin>>testcase;
    int __testcase=testcase;
    while(testcase--){
        int x;
        cin>>x;
        int ok=0;
        for(int i=1;i*i<=x;i++)
        {
            if(x%i==0){
                int a=i;
                int b=x/i;
                if(2*a>=b) ok=1;
            }
        }
        cout<<ok<<endl;

    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

input:

4
66
55
105
150

output:

1
0
0
1

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3656kb

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