結果
| 問題 |
No.1190 Points
|
| コンテスト | |
| ユーザー |
uzzy
|
| 提出日時 | 2020-08-22 16:41:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 2,038 bytes |
| コンパイル時間 | 2,303 ms |
| コンパイル使用メモリ | 183,512 KB |
| 最終ジャッジ日時 | 2025-02-26 09:39:06 |
| 合計ジャッジ時間 | 4,369 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
In file included from /usr/include/c++/13/string:43,
from /usr/include/c++/13/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
from main.cpp:3:
/usr/include/c++/13/bits/allocator.h: In destructor ‘std::_Vector_base<std::pair<long long int, int>, std::allocator<std::pair<long long int, int> > >::_Vector_impl::~_Vector_impl()’:
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::pair<long long int, int>]’: target specific option mismatch
184 | ~allocator() _GLIBCXX_NOTHROW { }
| ^
In file included from /usr/include/c++/13/vector:66,
from /usr/include/c++/13/queue:63,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
133 | struct _Vector_impl
| ^~~~~~~~~~~~
ソースコード
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M, P;
cin >> N >> M >> P;
int S, G;
cin >> S >> G;
#define PT pair<ll, int>
vector<PT> E[200001];
rep(i, M) {
int u, v;
cin >> u >> v;
E[u * 2].pb({ 1, v * 2 + 1 });
E[u * 2 + 1].pb({ 1, v * 2 });
E[v * 2].pb({ 1, u * 2 + 1 });
E[v * 2 + 1].pb({ 1, u * 2 });
}
ll DS[200001], DG[200001];
rep1(i, N * 2) DS[i + 1] = 1e18;
rep1(i, N * 2) DG[i + 1] = 1e18;
priority_queue<PT, vector<PT>, greater<PT>> que;
DS[S * 2] = 0;
que.push(mp(0, S * 2));
while (que.size()) {
PT p = que.top();
que.pop();
int i = p.second;
if (DS[i] != p.first) continue;
for (PT p2 : E[i]) {
int j = p2.second;
ll d = DS[i] + p2.first;
if (DS[j] > d) {
DS[j] = d;
que.push(mp(d, j));
}
}
}
DG[G * 2] = 0;
que.push(mp(0, G * 2));
while (que.size()) {
PT p = que.top();
que.pop();
int i = p.second;
if (DG[i] != p.first) continue;
for (PT p2 : E[i]) {
int j = p2.second;
ll d = DG[i] + p2.first;
if (DG[j] > d) {
DG[j] = d;
que.push(mp(d, j));
}
}
}
vector<int> kotae;
rep1(i, N) {
if (P % 2) {
ll tmp = min(DS[i * 2] + DG[i * 2 + 1], DS[i * 2 + 1] + DG[i * 2]);
if (tmp <= P) {
kotae.pb(i);
}
}
else {
ll tmp = min(DS[i * 2] + DG[i * 2], DS[i * 2 + 1] + DG[i * 2 + 1]);
if (tmp <= P) {
kotae.pb(i);
}
}
}
int kazu = kotae.size();
if (kazu == 0) co(-1);
else {
co(kotae.size());
rep(i, kotae.size()) co(kotae[i]);
}
Would you please return 0;
}
uzzy