답안 #1028679

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1028679 2024-07-20T06:58:08 Z BehruzbekX A Plus B (IOI23_aplusb) C++17
10 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#include "aplusb.h"
using namespace std;
#define FOR(i,n,k) for(auto nx = (i);nx < (n);nx += (k))
#define FOR2(i,n,k) for(auto nxx = (i);nxx < (n);nxx += (k))
vector<int> smallest_sums(int n, vector<int> a, vector<int> b) {
    priority_queue<int,vector<int>,greater<int>> ans;
    FOR(0,a.size(),1){
        ans.push(a[nx] + b[nx]);
    }
    while(ans.size() > n){
        ans.pop();
    }
   vector<int> final;
    while(!ans.empty()){
        final.emplace_back(ans.top());
        ans.pop();
    }
    return final;
}


/*
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⢆⠀⠀⠀⠀⠀⢸⡀⠸⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡈⠓⢤⣀⠀⠀⠸⣧⠀⢻⡄⠀⠀⠀⢀⣀⣠⡴⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⣄⠀⠀⠉⠉⠛⠛⠀⠀⠻⠒⠂⠉⢁⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣀⠀⠀⠀⢀⡠⠔⠚⢉⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠒⠤⣀⠁⠒⠦⠤⠤⢤⣤⠄⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠈⠙⢍⡁⠀⠀⠀⡔⢁⡄⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⣀⠀⠀⠭⠤⢠⡤⠔⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢨⡿⠀⣼⢜⠏⡄⠀⡀⠀⡠⠀⡖⠀⢠⠀⠀⢄⠉⢀⠀⠀⠀⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⣿⡵⡼⠏⡜⢸⠁⣤⠇⢀⠇⢠⡇⢰⢸⣾⠀⢸⡄⠀⣧⠀⣆⠀⠨⠒⢤⣄⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⠏⣻⠃⠀⣼⠇⡆⣰⢹⠀⣾⠀⣸⠇⢸⣾⣿⣇⠈⣿⣆⢹⡇⢹⣦⡈⢗⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⣴⡿⠊⡽⢀⠎⣿⠀⣠⡗⢚⣾⣿⣴⠳⣧⡞⡄⢿⠟⠉⠉⢙⣦⢳⠘⣿⣿⣆⣿⡦⠄⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠈⠁⠀⢀⣇⡎⢠⢿⢠⣿⣤⠊⢀⣠⣴⣿⣿⠴⢷⣿⣤⣶⣾⣿⣿⡿⣷⢿⣿⣦⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡼⢻⣥⣿⢸⣸⣿⢿⣾⣿⣿⣿⣿⠟⠀⠀⠘⢿⣿⣿⣿⠟⠀⢹⣾⣾⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠁⡿⢻⢟⣿⣿⣷⡄⠙⠿⠿⠿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢋⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠁⢸⠟⡿⣿⣿⡇⠀⠀⠀⠀⢀⣠⠤⠐⠒⠒⠒⠢⡄⠀⢀⣯⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠁⠈⢦⣽⡀⠀⠀⣴⢋⣤⣴⣶⣿⣿⡿⣿⡇⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢳⣄⠀⠸⣿⢟⡏⠝⠒⢓⣣⠟⢁⣴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⡷⣄⡈⠙⠛⠋⠉⠁⣀⡴⣻⣿⣶⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣶⣶⣤⣼⡧⠿⣙⣶⣶⣶⣶⣾⣿⣧⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣤⣀⣠⣿⠿⣿⣿⣿⣷⠀⠈⠳⢿⣋⣿⣿⡿⠛⠁⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣧⣝⢿⣿⣿⠀⠠⣀⠀⠈⠉⠉⢰⡆⠀⢋⣿⣴⣿⣿⣿⣾⣿⣿⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠹⡆⠀⠀⠀⣾⠀⠀⣸⣿⣿⣿⣿⡿⠋⢸⣿⣇⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢐⣿⣿⣿⣦⣝⣿⣿⣿⣿⣿⣿⣿⣿⣄⠑⠀⠀⠀⠘⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠶⣤⣄⠀⠀
⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⢀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⣿⣌⣇⠀
⠀⠀⠀⣠⠏⢉⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡗⠄⠠⠋⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣿⣿⣿⡆
⢀⣠⠞⣱⣾⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
 */

Compilation message

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:4:41: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    4 | #define FOR(i,n,k) for(auto nx = (i);nx < (n);nx += (k))
      |                                      ~~~^~~~~
aplusb.cpp:8:5: note: in expansion of macro 'FOR'
    8 |     FOR(0,a.size(),1){
      |     ^~~
aplusb.cpp:11:22: warning: comparison of integer expressions of different signedness: 'std::priority_queue<int, std::vector<int>, std::greater<int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |     while(ans.size() > n){
      |           ~~~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '6'
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '6'
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '6'
6 Halted 0 ms 0 KB -