QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#57761 | #2509. Right-Coupled Numbers | As3b_team_f_masr# | AC ✓ | 3ms | 3704kb | C++ | 1.2kb | 2022-10-22 20:35:30 | 2022-10-22 20:35:32 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define EPS 1e-9
#define PI acos(-1.0)
#define ll long long
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define pb push_back
#define ft first
#define sc second
#define pi pair<ll,ll>
#define vi vector<ll>
#define sz(s) s.size()
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll N = 2e5+5, M = 250, MOD = (1LL<<32), INF = 1e18;
int dx[] = {-1, 1, 0, 0}, Dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};;
int dy[] = {0, 0, 1, -1}, Dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
ll n, m, t, a[N];
int main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);//freopen("lines.in", "r", stdin);
cin >> t;
while(t--)
{
cin >> n;
int ok = 0;
for(ll i = 1; i *i <= n ;++i)
{
if(n%i == 0)
{
ll y = n/i;
if(i * 2 >= y) ok =1;
}
}
cout << ok << '\n';
}
return 0;
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3584kb
input:
4 66 55 105 150
output:
1 0 0 1
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 3704kb
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