Submission #624216

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6242162022-08-07 13:27:08MatesV13Jelly Flavours (IOI20_jelly)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
int find_maximum_unique(int x, int y, int[] a, int[] b){
int maks = 0; int n = sizeof(a)/sizeof(a[0]);
for (int i=0; i<pow(3, n); i++){
int tempi = i;
int tempx = x;
int tempy = y;
int br=0;
for (int j=0; j<n; j++){
if (tempi%3){
if (tempi%3==1) tempx -= a[j];
else tempy -= b[j];
br++;
} tempi /= 3;
}
if (tempx >= 0 and tempy >= 0)
maks = max(maks, br);
}
return maks;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jelly.cpp:4:45: error: expected ',' or '...' before 'a'
    4 | int find_maximum_unique(int x, int y, int[] a, int[] b){
      |                                             ^
jelly.cpp: In function 'int find_maximum_unique(int, int, int*)':
jelly.cpp:6:31: error: 'a' was not declared in this scope
    6 |  int maks = 0; int n = sizeof(a)/sizeof(a[0]);
      |                               ^
jelly.cpp:16:19: error: 'b' was not declared in this scope
   16 |     else tempy -= b[j];
      |                   ^