Wrong Answer
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