답안 #1016612

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1016612 2024-07-08T09:11:34 Z Ariadna A Plus B (IOI23_aplusb) C++17
10 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#define pb push_back

using namespace std;

vector<int> smallest_sums(int N, vector<int> A, vector<int> B) {
    vector<int> sums;
    int cnt = 0;
    for (int i = 0; i < min((int)(sqrt(2*N)+1), N); ++i) {
        for (int j = 0; j < min((int)(sqrt(2*N)+1), N); ++j) {
            sums.pb(A[i]+B[j]);
        }
    }
    sort(sums.begin(), sums.end());
    vector<int> ans(N);
    for (int i = 0; i < N; ++i) ans[i] = sums[i];

    return ans;
}

Compilation message

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:8:9: warning: unused variable 'cnt' [-Wunused-variable]
    8 |     int cnt = 0;
      |         ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 348 KB 1st lines differ - on the 14th token, expected: '70', found: '90'
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 348 KB 1st lines differ - on the 14th token, expected: '70', found: '90'
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 348 KB 1st lines differ - on the 14th token, expected: '70', found: '90'
8 Halted 0 ms 0 KB -