# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157555 | 2019-10-12T11:38:45 Z | Doda | Preokret (COCI18_preokret) | C++14 | 3 ms | 376 KB |
#include <iostream> using namespace std; int arr [3000]; int brr [3000]; int bar [3000]; int d = 0; int g = 0; int pr = 0; int vodi = 0; int u1 = 0; int u2 = 0; int pa = 0; int pc = 0; int pv = 0; int p = 1; int m = -1; int o = 0; int v1 = 0; int v2 = 0; int main () { int a,b,l ; cin >> a; for (int i = 0; i<a; i++) { cin >> arr[i]; if (arr[i]<1440) { pa++; } l = arr[i]; arr[l] = l; arr[i] = 0; } cin >> b ; for (int i = 0; i<b; i++) { cin >> bar[i]; if (bar[i]<1440) { pc++; } l = bar[i]; bar[l] = l; bar[i] = 0; } int c = a+b ; //cout << arr[35]<< "\n"; //cout << arr[3]<< "\n"; int z = 0 ; for (int k=0; k<2881;k++){ if (arr[k]>bar[k]){ v1 ++; v2 --; vodi = p; z=k; break; } if (bar[k]>arr[k]){ v1 --; v2 ++ ; vodi = m; z=k; break; } } int f = z+1 ; for (f; f<3000 ; f++){ if (arr[f] > bar[f]) { if (vodi == o) { if (v2 == o) { pv += p; vodi = p; v1 ++; v2 --; } if (vodi == m){ vodi = 0; v1 ++; v2 --; } if (vodi == p){ v1 ++; v2 --; } } if (bar[f] > arr[f]){ if (vodi == o){ if (v1 == o){ pv += p; vodi = m; v1 --; v2 ++; } } if (vodi == p){ vodi = 0; v1 --; v2 ++; } if (vodi == m){ v1--; v2++; } } } } cout << pa + pc << "\n"; cout << pv; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 2 ms | 252 KB | Output is partially correct |
2 | Partially correct | 2 ms | 376 KB | Output is partially correct |
3 | Partially correct | 2 ms | 376 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 | Incorrect | 3 ms | 376 KB | Output isn't correct |
8 | Incorrect | 3 ms | 376 KB | Output isn't correct |
9 | Incorrect | 3 ms | 376 KB | Output isn't correct |
10 | Correct | 2 ms | 376 KB | Output is correct |