제출 #1085378

#제출 시각아이디문제언어결과실행 시간메모리
1085378TimoshA Plus B (IOI23_aplusb)C++17
60 / 100
1060 ms1884 KiB
#include <bits/stdc++.h>
#include "aplusb.h"
using namespace std;

std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B)
{
	multiset<int> st;
	for (int i = 0; i < N; i++)
		for (int j = 0; j < N; j++)
		{
			st.insert(A[i] + B[j]);
			if (st.size() > N)
				st.erase(prev(st.end()));
		}
	vector<int> ans;
	for (auto &i : st)
	{
		ans.push_back(i);
	}
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:12:18: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |    if (st.size() > N)
      |        ~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...