Submission #76689880


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#include "atcoder/all"
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//using mint=modint998244353;
void solve(){
    int a,b,c,ans=0;
    cin>>a>>b>>c;
    if(a>=b and b>=c){
        ans=max(b-1,0);
        ans+=(min(a-b,c));
    }
    else if(b>= c and c>=a){
        ans=max(c-1,0);
        ans+=min(b-c,a);
    }
    else if(c>=a and a>=b){
        ans=max(a-1,0);
        ans+=min(c-a,b);
    }
    else if(b>= a and a>=c){
        ans=a;
        ans+=max(min(b-a-1,c-1),0);
    }
    else if(a>= c and c>=b){
        ans=c;
        ans+=max(min(a-c-1,b-1),0);
    }
    else{
        ans=b;
        ans+=max(min(c-b-1,a-1),0);
    }
    cout<<ans<<endl;
}
int main(){
    ios::sync_with_stdio(false);
	cin.tie(nullptr);
    int t=1;
    cin>>t;
    while(t--)solve();
}

Submission Info

Submission Time
Task B - Circular RPS
User itoito1234
Language C++23 (GCC 15.2.0)
Score 0
Code Size 888 Byte
Status WA
Exec Time 296 ms
Memory 4780 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 1
AC × 1
WA × 18
Set Name Test Cases
Sample 01_sample_01.txt
All 01_sample_01.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 02_small_06.txt, 02_small_07.txt, 02_small_08.txt, 03_rand_1_01.txt, 03_rand_1_02.txt, 03_rand_1_03.txt, 03_rand_1_04.txt, 03_rand_1_05.txt, 04_rand_2_01.txt, 04_rand_2_02.txt, 04_rand_2_03.txt, 04_rand_2_04.txt, 04_rand_2_05.txt
Case Name Status Exec Time Memory
01_sample_01.txt AC 1 ms 3544 KiB
02_small_01.txt WA 249 ms 3520 KiB
02_small_02.txt WA 249 ms 3544 KiB
02_small_03.txt WA 249 ms 3476 KiB
02_small_04.txt WA 249 ms 3412 KiB
02_small_05.txt WA 248 ms 3560 KiB
02_small_06.txt WA 248 ms 3560 KiB
02_small_07.txt WA 248 ms 3420 KiB
02_small_08.txt WA 249 ms 3420 KiB
03_rand_1_01.txt WA 271 ms 4772 KiB
03_rand_1_02.txt WA 272 ms 4772 KiB
03_rand_1_03.txt WA 271 ms 4772 KiB
03_rand_1_04.txt WA 271 ms 4780 KiB
03_rand_1_05.txt WA 273 ms 4780 KiB
04_rand_2_01.txt WA 268 ms 3756 KiB
04_rand_2_02.txt WA 268 ms 3752 KiB
04_rand_2_03.txt WA 268 ms 3748 KiB
04_rand_2_04.txt WA 296 ms 3756 KiB
04_rand_2_05.txt WA 269 ms 3756 KiB