| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 748260 | Trunkty | Preokret (COCI19_preokret) | C++14 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
int n,a,b,istie=1,turn;
int arr[255];
vector<int> event;
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
int curr=0,pos=1;
for(int i=1;i<=n;i++){
cin >> arr[i];
if(arr[i]==pos){
curr++;
}
else{
event.push_back(curr);
curr = 1;
pos = arr[i];
}
}
event.push_back(curr);
for(int i=0;i<event.size();i++){
if(event[i]==0){
continue;
}
if(i%2){
if(b<a and b+event[i]>a){
turn = max(turn,event[i]);
}
if(b<a and b+event[i]>=a){
istie++;
}
b += event[i];
}
else{
if(a<b and a+event[i]>b){
turn = max(turn,event[i]);
}
if(a<b and a+event[i]>=b){
istie++;
}
a += event[i];
}
}
cout << a << " " << b << "\n";
cout << istie << "\n";
cout << turn << "\n";
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
