Submit solution
Points:
120.00 (partial)
Time limit:
2.0s
Memory limit:
1G
Input:
stdin
Output:
stdout
Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text
Một số nguyên dương
Chẳng hạn: 12 là một số "gần hoàn hảo" vì: 2*12 < 1+2+3+4+6+12.
Yêu cầu: Với
Dữ liệu vào:
- Dòng đầu tiên chứa số nguyên dương
( ≤ 100). số nguyên dương , ,…, ( ≤ với 1 ≤ ≤ ).
Dữ liệu ra: Gồm
Ví dụ:
INPUT
Copy
3
6 16 12
OUTPUT
Copy
1
0
1
Giới hạn: Subtask 1: Có 60% điểm tương ứng với trường hợp
Comments
include<bits/stdc++.h>
define ll long long
define N 100000008
using namespace std; ll a[N]; ll tu(ll n) { ll t=0,i; for(i=1;i<=sqrt(n);i++) if(n%i==0) { t=t+i; if(n/i!=i) { t=t+n/i; } } return t; } int main() { ll n,i; cin>>n; for(i=1;i<=n;i++) { cin>>a[i]; } for(i=1;i<=n;i++) { if(tu(a[i])>=2*a[i]) cout<<1; else cout<<0; cout<<endl; } }
iloveamelia
simppppppppppppppppppp