/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 356.0 KiB
#2 Wrong Answer 1ms 320.0 KiB
#3 Wrong Answer 1ms 444.0 KiB

Code

/**
*	author: shafi
*	created: 06.03.2024 17.53.35
**/
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define ull unsigned long long int

int main(){
    ios :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    

    int tc = 1;
    cin>>tc;
    while(tc--){
        int n;
        cin>>n;
        int a = n+1;
        int c = n+2;
        int ans = c*c;
        int ans2= a*a + n*n;
        if(ans == ans2){
            cout<<n+a+c<<endl;
        }
        else{
            cout<<"-1\n";
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1027 Right triangle
Contest
Brain booster #2
Language
C++11 (G++ 13.2.0)
Submit At
2024-03-06 16:55:47
Judged At
2024-11-11 03:41:09
Judged By
Score
5
Total Time
1ms
Peak Memory
444.0 KiB