Submission #839915

#TimeUsernameProblemLanguageResultExecution timeMemory
839915zeroesandonesA Plus B (IOI23_aplusb)C++17
60 / 100
1122 ms1406372 KiB
#include <algorithm>
#include <iostream>
#include "aplusb.h"

std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) {
    std::vector<int> sum;
    for(int i = 0; i < N; ++i) {
        for(int j = 0; j < N; ++j) {
            sum.push_back(A[i] + B[j]);
        }
    }

    std::sort(sum.begin(), sum.end());
    std::vector<int> res;
    for(int i = 0; i < N; ++i)
        res.push_back(sum[i]);

	return res;
}

Compilation message (stderr)

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:15:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   15 |     for(int i = 0; i < N; ++i)
      |     ^~~
aplusb.cpp:18:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   18 |  return res;
      |  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...