/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 320.0 KiB
#2 Wrong Answer 9ms 424.0 KiB
#3 Wrong Answer 9ms 424.0 KiB

Code

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int b;
        scanf("%d", &b);
        int perimeter = 0;
        for (int h = 1; h < 1000; ++h) {
            for (int hy = 0; hy < 1000; ++hy) {
                if (b*b + h*h == hy*hy)
                {
                    perimeter = b+h+hy;
                }
                else{
                    continue;
                }
            }
        }
        if(perimeter <= 0)
        {
            printf("-1\n");
        }
        else{
            printf("%d\n", perimeter);
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1027 Right triangle
Contest
Brain booster #2
Language
C99 (GCC 13.2.0)
Submit At
2024-03-06 15:04:15
Judged At
2024-11-11 03:41:43
Judged By
Score
5
Total Time
9ms
Peak Memory
424.0 KiB