| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 146083 | youssan_william | Preokret (COCI18_preokret) | C++14 | 4 ms | 508 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
int main()
{
    ll a , b;
    cin >> a;
    ll arr[a];
    ll mid=1440;
    map<ll,char>mp;
    vector<ll>goals;
    for(int i = 0 ; i < a ;i++)
    {
        cin >> arr[i];
        goals.push_back(arr[i]);
        mp[arr[i]]='a';
    }
    cin >> b;
    ll arr2[b];
    for(int i = 0 ; i < b ;i++)
    {
        cin >> arr2[i];
        goals.push_back(arr2[i]);
        mp[arr2[i]]='b';
    }
    sort(goals.begin(),goals.end());
    ll ans=0 , teamA=0 , teamB=0 , turnarounds=0, winA=0,winB=0 , newloser;
    for(int i = 0 ; i < goals.size() ;i++)
    {
        if(teamA>teamB)
        {
            winA=1;
            winB=0;
        }
        if(teamB>teamA)
        {
            winB=1;
            winA=0;
        }
        if(mp[goals[i]]=='a')
        {
            teamA++;
            if(teamA>teamB&&winB==1)
            {
                winA=1;
                winB=0;
                turnarounds++;
            }
        }
        else
        {
            teamB++;
            if(teamB>teamA&&winA==1)
            {
                winA=0;
                winB=1;
                turnarounds++;
            }
        }
        if(goals[i]<=mid)
            ans++;
    }
    //turnarounds=43678568;
    cout << ans << "\n" << turnarounds ;
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
