# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1269307 | sula2 | 축제 (IOI25_festival) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
int N = P.size();
vector<int> ind(N);
iota(all(ind), 0);
sort(all(ind), [&](int i, int j) {
long long x = 1LL*-P[i]*T[i]*T[j] - 1LL*P[j]*T[j];
long long y = 1LL*-P[j]*T[j]*T[i] - 1LL*P[i]*T[i];
return x > y;
});
return ind;
}
컴파일 시 표준 에러 (stderr) 메시지
festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)': festival.cpp:5:5: error: 'vector' was not declared in this scope 5 | vector<int> ind(N); | ^~~~~~ festival.cpp:5:5: note: suggested alternatives: In file included from /usr/include/c++/13/vector:66, from /usr/include/c++/13/functional:64, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53, from festival.cpp:1: /usr/include/c++/13/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/13/vector:86:13: note: 'std::pmr::vector' 86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ festival.cpp:5:12: error: expected primary-expression before 'int' 5 | vector<int> ind(N); | ^~~ festival.cpp:6:14: error: 'ind' was not declared in this scope; did you mean 'int'? 6 | iota(all(ind), 0); | ^~~ | int festival.cpp:6:10: error: 'all' was not declared in this scope 6 | iota(all(ind), 0); | ^~~ festival.cpp:6:10: note: suggested alternatives: In file included from /usr/include/c++/13/filesystem:48, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:200: /usr/include/c++/13/bits/fs_fwd.h:154:7: note: 'std::filesystem::perms::all' 154 | all = 0777, | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:89: /usr/include/c++/13/ranges:1308:27: note: 'std::ranges::views::all' 1308 | inline constexpr _All all; | ^~~ festival.cpp:6:5: error: 'iota' was not declared in this scope 6 | iota(all(ind), 0); | ^~~~ festival.cpp:6:5: note: suggested alternatives: In file included from /usr/include/c++/13/numeric:62, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:58: /usr/include/c++/13/bits/stl_numeric.h:88:5: note: 'std::iota' 88 | iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) | ^~~~ /usr/include/c++/13/ranges:716:26: note: 'std::ranges::views::iota' 716 | inline constexpr _Iota iota{}; | ^~~~ festival.cpp:7:5: error: 'sort' was not declared in this scope 7 | sort(all(ind), [&](int i, int j) { | ^~~~ festival.cpp:7:5: note: suggested alternatives: In file included from /usr/include/c++/13/algorithm:73, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51: /usr/include/c++/13/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ In file included from /usr/include/c++/13/algorithm:63: /usr/include/c++/13/bits/ranges_algo.h:1801:30: note: 'std::ranges::sort' 1801 | inline constexpr __sort_fn sort{}; | ^~~~