/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Accepted 18ms 592.0 KiB
#3 Accepted 24ms 572.0 KiB
#4 Accepted 17ms 772.0 KiB
#5 Accepted 16ms 820.0 KiB
#6 Accepted 22ms 552.0 KiB
#7 Accepted 19ms 540.0 KiB
#8 Accepted 17ms 816.0 KiB
#9 Accepted 18ms 604.0 KiB
#10 Accepted 18ms 564.0 KiB

Code

/*
 *   Copyright (c) 2024 Emon Thakur
 *   All rights reserved.
 */
#include<bits/stdc++.h>
using namespace std;
//ofstream file("output9.txt");
void solve()
{
    int A,B,C; cin>>A>>B>>C;
    int a,b,c,sum=A+B+C;
    a = min({A,B,C});
    c = max({A,B,C});
    b = sum-a-c;

    int k = __gcd(b-a,c-b);
    //cout<<(c-a)/k<<endl;
    if(k==0) cout<<0<<endl;
    else cout<<(c-a)/k<<endl;
}

int main()
{
    //freopen("input9.txt","r",stdin);
    int t; cin>>t; while(t--) solve();
}

Information

Submit By
Type
Submission
Problem
P1061 Bring equality
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-22 09:51:36
Judged At
2024-05-22 09:51:36
Judged By
Score
90
Total Time
24ms
Peak Memory
820.0 KiB