Submission #400903

#TimeUsernameProblemLanguageResultExecution timeMemory
400903DivannyJelly Flavours (IOI20_jelly)C++14
0 / 100
7 ms320 KiB
#include "jelly.h" #include <bits/stdc++.h> using namespace std; int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) { int n = a.size(); int cont = 0; while (x > 0 || y > 0) { int i = min_element(a.begin(), a.end()) - a.begin(); if ((a[i] < b[i] && x - a[i] >= 0) || (y - b[i] < 0 && x - a[i] >= 0)) { x -= a[i]; a[i] = 10,001; b[i] = 10,001; cont++; } else if (y - b[i] >= 0) { y -= b[i]; a[i] = 10,001; b[i] = 10,001; cont++; } else { break; } } return cont; }

Compilation message (stderr)

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:16:17: warning: right operand of comma operator has no effect [-Wunused-value]
   16 |    a[i] = 10,001;
      |                 ^
jelly.cpp:17:17: warning: right operand of comma operator has no effect [-Wunused-value]
   17 |    b[i] = 10,001;
      |                 ^
jelly.cpp:23:17: warning: right operand of comma operator has no effect [-Wunused-value]
   23 |    a[i] = 10,001;
      |                 ^
jelly.cpp:24:17: warning: right operand of comma operator has no effect [-Wunused-value]
   24 |    b[i] = 10,001;
      |                 ^
jelly.cpp:8:6: warning: unused variable 'n' [-Wunused-variable]
    8 |  int n = a.size();
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...