# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75034 | 2018-09-08T05:11:40 Z | charlies_moo | Savrsen (COCI17_savrsen) | C++14 | 3000 ms | 3224 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 | 376 KB | Output isn't correct |
2 | Incorrect | 5 ms | 512 KB | Output isn't correct |
3 | Incorrect | 468 ms | 1080 KB | Output isn't correct |
4 | Incorrect | 45 ms | 1080 KB | Output isn't correct |
5 | Execution timed out | 3021 ms | 1840 KB | Time limit exceeded |
6 | Execution timed out | 3033 ms | 2988 KB | Time limit exceeded |
7 | Execution timed out | 3040 ms | 2988 KB | Time limit exceeded |
8 | Execution timed out | 3025 ms | 3224 KB | Time limit exceeded |