感受到了div.3的友好度
A题先求出三数最大值,然后判断有多少个数等于,如果个数大于等于,则对于第个数输出为,否则的话最大值输出,其他数输出
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| LL t; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>t; while(t--){ LL a,b,c; cin>>a>>b>>c; LL a1=max(a,b),a2=max(b,c); LL temp=max(a1,a2); LL res=(a==temp)+(b==temp)+(c==temp); if(res>1)res=1; else res=0; if(a==temp) cout<<temp+res-a<<" "; else cout<<temp+1-a<<" "; if(b==temp) cout<<temp+res-b<<" "; else cout<<temp+1-b<<" "; if(c==temp) cout<<temp+res-c<<"\n"; else cout<<temp+1-c<<"\n"; } return 0; }
|
B题