#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 500009;
vector<pair<ll, pair<ll, ll > > > v[N];
vector<ll> T[N];
ll d1[N],dn[N], f[N], g[N],ea[N],eb[N],ec[N], par[N],path[N],wh[N];
set<ll > S;
/*
00000111111
*/
void ad(ll x){
g[x] = 1;
for(auto E : v[x]){
ll y = E.first, l = E.second.first, u= E.second.second;
auto it= S.find(u);
if(g[y] == 1) S.erase(it);
if(g[y] == 0) S.insert(u);
}
}
ll A = 0;
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
ll n, m;
cin >> n >> m;
for(ll i = 0; i < m; i++){
cin>>ea[i]>>eb[i]>>ec[i];
}
for(ll i = m-1; i >= 0; i--){
ll a = ea[i], b = eb[i], c = ec[i];
v[a].push_back({b, {c,i}});
v[b].push_back({a, {c,i}});
A = max(A, c);
}
for(int i=1;i<= n; i++)
ad(i);
}
Compilation message
Aesthetic.cpp: In function 'void ad(long long int)':
Aesthetic.cpp:16:25: warning: unused variable 'l' [-Wunused-variable]
16 | ll y = E.first, l = E.second.first, u= E.second.second;
| ^
Aesthetic.cpp: At global scope:
Aesthetic.cpp:23:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
23 | main(){
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
23808 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
23808 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
759 ms |
59672 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
729 ms |
60264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
429 ms |
115448 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
429 ms |
115448 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
23808 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |