| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 88129 | BabinSinko | Preokret (COCI18_preokret) | C++14 | 3 ms | 812 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
using namespace std;
int na, a[2883], nb, b[2883], sol1, sol2, ba, bb, sl[2883], j;
int main(){
cin >> na;
for(int i = 0; i < na; i++){
	cin >> a[i];
	if (a[i] <= 1440)
		sol1 = sol1 + 1;
}
cin >> nb;
for(int i = 0; i < nb; i++){
	cin >> b[i];
	if (b[i] <= 1440)
		sol1 = sol1 + 1;
}
for(int i = 1; i <= 2883; i++){
	if (a[ba] == i){
		sl[j] = 1;
		j = j + 1;
		ba = ba + 1; 
	}
	if (b[bb] == i){
		sl[j] = 2;
		j = j + 1;
		bb = bb + 1;
	}
}
ba = 0;
bb = 0;
for (int i = 0; i < (na + nb); i++){
	if(sl[i] == 1){
		ba = ba + 1;
	}
	if(sl[i] == 2){
		bb = bb + 1;
	}
	if(ba == (bb - 1) and sl[i + 1] == 1 and sl[i + 2] == 1)
		sol2 = sol2 + 1;
	if(bb == (ba - 1) and sl[i + 1] == 2 and sl[i + 2] == 2)
		sol2 = sol2 + 1;
}
cout << sol1 << endl << sol2;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
