QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#717841 | #2509. Right-Coupled Numbers | yuto1115# | AC ✓ | 1ms | 3640kb | C++20 | 846b | 2024-11-06 19:05:35 | 2024-11-06 19:05:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define rep2(i,j,k) for(ll i = ll(j); i < ll(k); i++)
#define rep(i,k) rep2(i,0,k)
#define rrep2(i,j,k) for(ll i = ll(j)-1; i >= ll(k); i--)
#define rrep(i,k) rrep2(i,k,0)
#define all(a) a.begin(), a.end()
#define SZ(a) ll(a.size())
#define eb emplace_back
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<P>;
using vvp = vector<vp>;
const ll inf = LLONG_MAX/4;
bool chmin(auto& a, auto& b) {return a > b ? a = b, 1 : 0; }
bool chmax(auto& a, auto& b) {return a < b ? a = b, 1 : 0; }
void solve() {
int x;
cin >> x;
for(int i = 1; i*i <= x; i++) {
if(x%i) continue;
if(i*2 >= x/i) {
cout << 1 << '\n';
return;
}
}
cout << 0 << '\n';
}
int main(){
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
rep(_, n) solve();
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
4 66 55 105 150
output:
1 0 0 1
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3584kb
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