Submission #881729

#TimeUsernameProblemLanguageResultExecution timeMemory
881729spdlingA Plus B (IOI23_aplusb)C++17
10 / 100
0 ms756 KiB
#include<vector> using namespace std; vector<int> smallest_sums(int N, vector<int> A, vector<int> B) { vector<int> ans; int ans_n = 0; int i = 0, j = 0, last_i = 0, last_j = 0; for (; ans_n < N;) { ans.push_back(A[i] + B[j]); ans_n++; if (A[i] + B[j+1] < A[i+1] + B[0]) { ++j; i = last_i; } else { ++i; j = 0; } } return ans; }

Compilation message (stderr)

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:8:33: warning: unused variable 'last_j' [-Wunused-variable]
    8 |   int i = 0, j = 0, last_i = 0, last_j = 0;
      |                                 ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...