Submission #284990

# Submission time Handle Problem Language Result Execution time Memory
284990 2020-08-28T08:45:01 Z 3zp Aesthetic (NOI20_aesthetic) C++14
0 / 100
406 ms 183416 KB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 3000009;
vector<ll> v[N];
ll ea[N],eb[N],ec[N],g[N],f[N];
/*
00000111111

*/
void ad(ll x){
    g[x] = 1;
    for(ll y : v[x]){
        if(g[y] == 1 && !f[y]) cout<<1/0;
        else if(g[y] == 1) f[y] = 0;
        if(g[y] == 0) f[y] = 1;
    }
}
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(i);
        v[b].push_back(i);
    }
    for(ll i=1;i<= n; i++)
    ad(i);
}

Compilation message

Aesthetic.cpp: In function 'void ad(long long int)':
Aesthetic.cpp:14:39: warning: division by zero [-Wdiv-by-zero]
   14 |         if(g[y] == 1 && !f[y]) cout<<1/0;
      |                                      ~^~
Aesthetic.cpp: At global scope:
Aesthetic.cpp:20:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main(){
      |      ^
Aesthetic.cpp: In function 'int main()':
Aesthetic.cpp:29:34: warning: unused variable 'c' [-Wunused-variable]
   29 |         ll a = ea[i], b = eb[i], c = ec[i];
      |                                  ^
# Verdict Execution time Memory Grader output
1 Runtime error 139 ms 143228 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 139 ms 143228 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 406 ms 182872 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 371 ms 183416 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 363 ms 180344 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 363 ms 180344 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 139 ms 143228 KB Execution killed with signal 4
2 Halted 0 ms 0 KB -