/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 1ms 540.0 KiB
#3 Wrong Answer 1ms 584.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

#define endl '\n'
#ifdef LOCAL
    #include "debug.h"    
#else
    #define print(...)
    #define printt(...)
#endif

#define int long long

void run(){
    
    int a[4];
    for( int i=0 ; i<4 ; i++ )
        cin >> a[i];

    int ans = 0;

    ans += a[2] / 3;
    a[2] %= 3;

    int x = a[3] / 2 + (a[2] == 2);
    a[3] %= 2;

    if(a[2] == 2)a[2] = 0;
    
    while(x > 1) {
        if(a[1] > 0 and a[0] > 0) {
            ans++;
            a[1]--;
            a[0]--;
            x -= 2;
        }else if(a[0] > 2) {
            a[0] -= 3;
            x -= 2;
        }else
            break;
    }


    int y = (a[2] + a[3]) * 3 + a[1] * 2 + a[0];

    ans += y / 9;

    cout << ans << endl;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t = 1, cs = 1;
    cin >> t;
    
    while( t --> 0 ) {
        cout << "Case " << cs++ << ": ";
        run();
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1014 FIFA World Cup 2022 Again!
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-20 12:51:53
Judged At
2024-12-20 12:51:53
Judged By
Score
1
Total Time
1ms
Peak Memory
584.0 KiB