# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1139858 | tmm | Monthly railway pass (LMIO18_menesinis_bilietas) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
struct drum{
int x;
int y;
bool t;
};
const string file = "b";
const int N_max = 500005;
ifstream fin(file + ".in");
ofstream fout(file + ".out");
int n, m;
drum muc[N_max];
int father[N_max];
int nodes[N_max];
int fr[N_max];
map<pair<int, int>, int> already_added;
void reading(){
cin >> n >> m;
for(int i = 1; i <= n; i++) {
father[i] = i;