Wrong Answer
Code
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
int s[t];
int i;
for(i=0;i<t;i++){
int a,b,c,op=0,d;
cin>>a>>b>>c;
if(a==b && a==c && b==c){s[i]=op;continue;}
else if(a==b && a!=c){
if(a>c){d=a-c;c+=d;op++;}
else{
d=c-a;c-=d;op++;
}
}
else if(b==c && b!=a){
if(b>a){d=b-a;a+=d;op++;}
else{
d=a-b;a-=d;op++;
}
}
else if(a==c && a!=b){
if(a>b){d=a-b;b+=d;op++;}
else{
d=b-a;b-=d;op++;
}
}
else if(a!=b && a!=c && b!=c){
op+=2;
}
s[i]=op;
}
for(i=0;i<t;i++)cout<<s[i]<<endl;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1061 Bring equality
- Contest
- Brain Booster #4
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-07-14 16:35:43
- Judged At
- 2024-11-11 03:23:56
- Judged By
- Score
- 10
- Total Time
- 29ms
- Peak Memory
- 588.0 KiB