# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75035 | 2018-09-08T05:12:13 Z | charlies_moo | Savrsen (COCI17_savrsen) | C++ | 3000 ms | 3304 KB |
#include <cstdio> #include <cmath> #include <iostream> using namespace std; long long is_perfect(long long n) { long long sum=0; for(long long i=1;i<=sqrt(n);i++) { if(n%i==0) { sum+=i; sum+=n/i; if(i==1) sum-=(n/i); if(i<n) sum-=i; } } sum-=n; long long sqn=sqrt(n); if(sqn*sqn==n) sum-=sqn;cout<<abs(sum)<<endl; return abs(sum); } int main() { long long a,b,ans; cin>>a>>b; for(long long i=a;i<=b;i++) ans+=is_perfect(i); cout<<ans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Incorrect | 4 ms | 372 KB | Output isn't correct |
3 | Incorrect | 488 ms | 1092 KB | Output isn't correct |
4 | Incorrect | 45 ms | 1092 KB | Output isn't correct |
5 | Execution timed out | 3005 ms | 2184 KB | Time limit exceeded |
6 | Execution timed out | 3035 ms | 3304 KB | Time limit exceeded |
7 | Execution timed out | 3056 ms | 3304 KB | Time limit exceeded |
8 | Execution timed out | 3050 ms | 3304 KB | Time limit exceeded |