2 solutions
-
0
#include <bits/stdc++.h> using namespace std; #define accelerate ios::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define endl "\n"; #define mod 12345 #define ll long long #define PII pair<int,int> #define INF 0x3f3f3f3f const int N=1e5+10; ll n,m,k,x,y,T; ll a[N]; ll pre[N]; bool f(int x){ int sum=0; for(int i=1;i<x;i++){ sum+=x%i==0?i:0; } return (x==sum); } int main(){ accelerate; cin>>n>>m; for(int i=n;i<=m;i++){ if(f(i)) cout<<i<<" "; } return 0; }
- 1
Information
- ID
- 476
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- 8
- Tags
- # Submissions
- 11
- Accepted
- 7
- Uploaded By