Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
3713082 Practice:
jremloz4
304A - 13 GNU C++ Time limit exceeded on test 31 3000 ms 4 KB 2013-05-12 20:11:43 2013-05-12 20:11:43
→ Source
# include <iostream>
# include <cmath>

using namespace std;

int main(int argc, char* argv[]) {

    int n;
    cin >> n;

    int n2 = n*n;

    int res = 0;
    for (int a = 1; a <= n; a++) {
        for (int b = a; b <= n; b++) {
            int c = a*a + b*b;
            if (c > n2) break;
            double sqrc = sqrt(c);
            if (floor(sqrc) == sqrc) {
                res++;
            }
        }
    }
    cout << res << endl;

    return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details