답안 #156686

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
156686 2019-10-06T20:55:09 Z dcj Preokret (COCI18_preokret) C++14
2 / 50
3 ms 380 KB
#include <iostream>

using namespace std;


int main()
{
	int Ap[2880] , Bp[2880];
    int	A, B, s, pv=0, P=0, x=0;
    cin >> A;
    for (int i=1;i<=A;i++) {
    	cin >> s;
    	if (s<=1440)
    		pv++;
    	Ap[s-1]=1;
	}
	cin >> B;
	for (int i=1;i<=B;i++) {
		cin >> s;
    	if (s<=1440)
    		pv++;
    	Bp[s-1]=1;
	}
	cout << pv << "\n";
	for (int i=0;i<=2879;i++) {
		if (Ap[i]==1)
			A--;
		if (Bp[i] ==1)
			B--;
		if (A<B and x==2)
			P++;
			x=1;
		if (B<A and x==1)
			P++;
			x=2;
	}
	cout << P;
		

	return 0;
}

Compilation message

preokret.cpp: In function 'int main()':
preokret.cpp:30:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if (A<B and x==2)
   ^~
preokret.cpp:32:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    x=1;
    ^
preokret.cpp:33:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if (B<A and x==1)
   ^~
preokret.cpp:35:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    x=2;
    ^
# 결과 실행 시간 메모리 Grader output
1 Partially correct 2 ms 376 KB Output is partially correct
2 Partially correct 2 ms 376 KB Output is partially correct
3 Partially correct 2 ms 248 KB Output is partially correct
4 Partially correct 2 ms 376 KB Output is partially correct
5 Partially correct 2 ms 376 KB Output is partially correct
6 Partially correct 2 ms 376 KB Output is partially correct
7 Partially correct 3 ms 376 KB Output is partially correct
8 Partially correct 3 ms 376 KB Output is partially correct
9 Partially correct 3 ms 380 KB Output is partially correct
10 Partially correct 2 ms 376 KB Output is partially correct