제출 #421154

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4211542021-06-08 19:21:58rama_pangIzvanzemaljci (COI21_izvanzemaljci)C++17
68 / 100
1565 ms20736 KiB
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int N, K;
cin >> N >> K;
vector<lint> X(N), Y(N);
for (int i = 0; i < N; i++) {
cin >> X[i] >> Y[i];
}
long long answerScore = 1e18;
vector<array<lint, 4>> answer;
for (int rot = 0; rot < 4; rot++) {
vector<int> sortByX(N);
vector<int> sortByY(N);
iota(begin(sortByX), end(sortByX), 0);
iota(begin(sortByY), end(sortByY), 0);
sort(begin(sortByX), end(sortByX), [&](int i, int j) {
return pair(X[i], Y[i]) < pair(X[j], Y[j]);
});
sort(begin(sortByY), end(sortByY), [&](int i, int j) {
return pair(Y[i], X[i]) < pair(Y[j], X[j]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:145:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  145 |         if (i < 0 || i >= alive.size()) return 0;
      |                      ~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:150:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  150 |         if (i < 0 || i >= alive.size()) return 0;
      |                      ~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:156:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  156 |           if (!(i + 1 == alive.size() || Y[alive[i + 1]] != Y[alive[i]])) {
      |                 ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:172:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  172 |           if (!(i + 1 == alive.size() || Y[alive[i + 1]] != Y[alive[i]])) {
      |                 ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:183:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  183 |           if (!(i + 1 == alive.size() || X[alive[i + 1]] != X[alive[i]])) {
      |                 ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:187:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  187 |           lint upTo = (i + 1 == alive.size()) ? 1e18 : (X[alive[i + 1]] - 1);
      |                        ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:202:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  202 |           if (!(i + 1 == alive.size() || X[alive[i + 1]] != X[alive[i]])) {
      |                 ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:206:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  206 |           lint upTo = (i + 1 == alive.size()) ? 1e18 : (X[alive[i + 1]] - 1);
      |                        ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:261:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  261 |         if (i < 0 || i >= alive.size()) return 0;
      |                      ~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:266:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  266 |         if (i < 0 || i >= alive.size()) return 0;
      |                      ~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:299:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  299 |         if (!(i + 1 == alive.size() || X[alive[i + 1]] != X[alive[i]])) {
      |               ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:317:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  317 |         if (!(i + 1 == alive.size() || X[alive[i + 1]] != X[alive[i]])) {
      |               ~~~~~~^~~~~~~~~~~~~~~
izvanzemaljci.cpp:265:18: warning: variable 'CalcSuff' set but not used [-Wunused-but-set-variable]
  265 |       const auto CalcSuff = [&](int i) -> lint {
      |                  ^~~~~~~~
izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:397:21: warning: comparison of integer expressions of different signedness: 'std::vector<std::array<long long int, 3> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  397 |   while (ans.size() < K) {
      |          ~~~~~~~~~~~^~~
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from izvanzemaljci.cpp:1:
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:403:22: warning: comparison of integer expressions of different signedness: 'std::vector<std::array<long long int, 3> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  403 |     assert(sq.size() <= K);
      |            ~~~~~~~~~~^~~~
izvanzemaljci.cpp: In lambda function:
izvanzemaljci.cpp:368:5: warning: control reaches end of non-void function [-Wreturn-type]
  368 |     };
      |     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...