| Task: | Piva and Glasses |
| Sender: | aalto26hm_029 |
| Submission time: | 2026-10-26 16:57:53 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.00 s | details |
| #2 | RUNTIME ERROR | 0.00 s | details |
| #3 | RUNTIME ERROR | 0.00 s | details |
| #4 | RUNTIME ERROR | 0.00 s | details |
| #5 | RUNTIME ERROR | 0.00 s | details |
| #6 | RUNTIME ERROR | 0.00 s | details |
| #7 | RUNTIME ERROR | 0.00 s | details |
| #8 | RUNTIME ERROR | 0.00 s | details |
| #9 | RUNTIME ERROR | 0.00 s | details |
| #10 | RUNTIME ERROR | 0.00 s | details |
| #11 | RUNTIME ERROR | 0.00 s | details |
| #12 | RUNTIME ERROR | 0.00 s | details |
| #13 | RUNTIME ERROR | 0.00 s | details |
| #14 | RUNTIME ERROR | 0.00 s | details |
| #15 | RUNTIME ERROR | 0.00 s | details |
| #16 | RUNTIME ERROR | 0.00 s | details |
| #17 | RUNTIME ERROR | 0.00 s | details |
| #18 | RUNTIME ERROR | 0.00 s | details |
| #19 | RUNTIME ERROR | 0.00 s | details |
| #20 | RUNTIME ERROR | 0.00 s | details |
| #21 | RUNTIME ERROR | 0.00 s | details |
| #22 | RUNTIME ERROR | 0.00 s | details |
| #23 | RUNTIME ERROR | 0.00 s | details |
| #24 | RUNTIME ERROR | 0.00 s | details |
| #25 | RUNTIME ERROR | 0.00 s | details |
| #26 | RUNTIME ERROR | 0.00 s | details |
| #27 | RUNTIME ERROR | 0.00 s | details |
| #28 | RUNTIME ERROR | 0.00 s | details |
| #29 | RUNTIME ERROR | 0.00 s | details |
| #30 | RUNTIME ERROR | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:53:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
53 | for (int i = 0; i < path.size(); i++) {
| ~~^~~~~~~~~~~~~
input/code.cpp:54:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
54 | for (int j = 0; j < adj[path[i]].size(); j++) {
| ~~^~~~~~~~~~~~~~~~~~~~~
input/code.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
55 | if (i < path.size()-1 && adj[path[i]][j] == path[i+1]) {
| ~~^~~~~~~~~~~~~~~
input/code.cpp:67:27: warning: comparison of integer expressions of different si...Code
#include <bits/stdc++.h>
using namespace std;
vector<int> bfs(vector<vector<int>> adj, int n) {
vector<int> visited(n+1, -1);
queue<int> q;
visited[1] = true;
q.push(1);
bool found = false;
while(!q.empty()) {
int currNode = q.front();
q.pop();
if (currNode == n) {
found = true;
break;
}
for (auto nextNode : adj[currNode]) {
if (visited[nextNode] == -1) {
visited[nextNode] = currNode;
q.push(nextNode);
}
}
}
if (!found) return {};
vector<int> path;
int curr = n;
while (curr != 1) {
path.push_back(curr);
curr = visited[curr];
}
path.push_back(1);
reverse(path.begin(), path.end());
return path;
}
int main() {
std::ios_base::sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<vector<int>> adj(n+1);
for (int i = 0; i < m; i++) {
int t1, t2;
cin >> t1 >> t2;
adj[t1+1].push_back(t2+1);
adj[t2+1].push_back(t1+1);
}
int day = 0;
vector<vector<int>> ans;
while (true) {
vector<int> path = bfs(adj, n);
if (path.empty()) break;
ans[day++] = path;
for (int i = 0; i < path.size(); i++) {
for (int j = 0; j < adj[path[i]].size(); j++) {
if (i < path.size()-1 && adj[path[i]][j] == path[i+1]) {
adj[path[i]].erase(adj[path[i]].begin() + j);
}
if (i > 0 && adj[path[i]][j] == path[i-1]) {
adj[path[i]].erase(adj[path[i]].begin() + j);
}
}
}
}
cout << day;
for (int i = 0; i < day; i++) {
cout << ans[i].size() << '\n';
for (int j = 0; j < ans[i].size(); j++) {
cout << ans[i][j] << ' ';
}
cout << '\n';
}
}Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| mynbiqpmzjplsgqejeydtzirwztejd... |
| correct output |
|---|
| 253955382019371746305129921157... |
| user output |
|---|
| (empty) |
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| szycidpyopumzgdpamntyyawoixzhs... |
| correct output |
|---|
| 551108061158008078173415475169... |
| user output |
|---|
| (empty) |
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| bcclfxzvjitgtbsvfnumzxqlroqiba... |
| correct output |
|---|
| 305421613370742845795015587427... |
| user output |
|---|
| (empty) |
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| sreltpusctapirhgwprrpmuehueqmx... |
| correct output |
|---|
| 140037512077395979638061040922... |
| user output |
|---|
| (empty) |
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| jdxmpeccamrjzybhqrliyfdigauziz... |
| correct output |
|---|
| 348940989405062643281218932084... |
| user output |
|---|
| (empty) |
Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| ixlzwxuqaoyhubfdlphmrdshaxgnif... |
| correct output |
|---|
| 523444502687933447128799316928... |
| user output |
|---|
| (empty) |
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| scpyibaevspyxlkyaipzgxnrrvdgsr... |
| correct output |
|---|
| 804291277421765770488004812470... |
| user output |
|---|
| (empty) |
Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| emubcrdlsbqgbcnnchcrnbsdhuusbs... |
| correct output |
|---|
| 539368193886087805857792545271... |
| user output |
|---|
| (empty) |
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| lmegwbcehzqgmuaopompsgmcphyawi... |
| correct output |
|---|
| 665407925762077489110285862326... |
| user output |
|---|
| (empty) |
Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| tliefvakqotckrtwbxmfwoxnffhbde... |
| correct output |
|---|
| 129648761524634643411433104526... |
| user output |
|---|
| (empty) |
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| bnpsagopiuzfbqpkchxlbnetlmnjvi... |
| correct output |
|---|
| 254352633815523810681607015996... |
| user output |
|---|
| (empty) |
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| ryooqsgfzqputzfdojecrzwubtmoux... |
| correct output |
|---|
| 212452622895141284453529611450... |
| user output |
|---|
| (empty) |
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| ivqvlemalpiuzowthravteolfkgbsg... |
| correct output |
|---|
| 732490220763260338635928880269... |
| user output |
|---|
| (empty) |
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| jvvzfuhvehuxfecrgxjanevtaieczz... |
| correct output |
|---|
| 518420681110543932377602451247... |
| user output |
|---|
| (empty) |
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| twyuqhixijxcvojovmmydihklzilzu... |
| correct output |
|---|
| 364802587715444496585869643172... |
| user output |
|---|
| (empty) |
Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| gaqxbfhabzvewlhdkowlimilhglzkh... |
| correct output |
|---|
| 476873862461844332247115208362... |
| user output |
|---|
| (empty) |
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| ppjnhoanvwihuhajjkvextjazhtiae... |
| correct output |
|---|
| 767343312313426142222306561536... |
| user output |
|---|
| (empty) |
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| nzjljfywwrvidahmxniqzkuvxmerbe... |
| correct output |
|---|
| 910297874112935296564114827261... |
| user output |
|---|
| (empty) |
Test 19
Verdict: RUNTIME ERROR
| input |
|---|
| dvokhgpupfpjoigiwdkqvyzfzhfhgx... |
| correct output |
|---|
| 188739064612275094017617681593... |
| user output |
|---|
| (empty) |
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| bzqdqgmlqjsetidinkidykjastgcgd... |
| correct output |
|---|
| 232461691179008854504057599827... |
| user output |
|---|
| (empty) |
Test 21
Verdict: RUNTIME ERROR
| input |
|---|
| xvzyeivudksfanncdekpsonggkuvkk... |
| correct output |
|---|
| 285713951274252866113989732127... |
| user output |
|---|
| (empty) |
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| nwnujpgzpzqfqqhzaalsncezyhhwbn... |
| correct output |
|---|
| 731682739693843565903082665678... |
| user output |
|---|
| (empty) |
Test 23
Verdict: RUNTIME ERROR
| input |
|---|
| ehatofwdxulzchibktfrvxnwbsasij... |
| correct output |
|---|
| 450074573205377125973875496260... |
| user output |
|---|
| (empty) |
Test 24
Verdict: RUNTIME ERROR
| input |
|---|
| yjcasjnmqlexgioahtoadcwpnaquxn... |
| correct output |
|---|
| 596345160784615487534168536470... |
| user output |
|---|
| (empty) |
Test 25
Verdict: RUNTIME ERROR
| input |
|---|
| msfgfgfvvcwyezwjxyaooxudaqfpxo... |
| correct output |
|---|
| 717476109909956801533326919144... |
| user output |
|---|
| (empty) |
Test 26
Verdict: RUNTIME ERROR
| input |
|---|
| yagjupbyibjsndsdsvxgqztkfrlqpq... |
| correct output |
|---|
| 235583496947932628535470171742... |
| user output |
|---|
| (empty) |
Test 27
Verdict: RUNTIME ERROR
| input |
|---|
| gvgntrbeyypbxvtqfunhxnwgzwavhe... |
| correct output |
|---|
| 111088422779874450993038450753... |
| user output |
|---|
| (empty) |
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| pwijgccirkilmfhhpcxusuctnynxbv... |
| correct output |
|---|
| 446346258489784916012992902633... |
| user output |
|---|
| (empty) |
Test 29
Verdict: RUNTIME ERROR
| input |
|---|
| xertwfheuoynggemfetgganhcdnkwe... |
| correct output |
|---|
| 283497304854230709850344401214... |
| user output |
|---|
| (empty) |
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| clttjcqlmnabdouhzlcpktrnxgofhn... |
| correct output |
|---|
| 218953374961690394340463245163... |
| user output |
|---|
| (empty) |
