Submission #1074685

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10746852024-08-25 12:36:47khanhtbBridges (APIO19_bridges)C++14
0 / 100
1967 ms524288 KiB
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define vi vector<int>
#define vii vector<vi>
#define pll pair<int, int>
#define vpll vector<pint>
#define all(a) a.begin(), a.end()
#define fi first
#define se second
using namespace std;
const int mod = 1e9+7;
const ll inf = 2e18;
const int B = 320;
const int N = 1e5 + 8;
struct DSU_roll_back{
vector<int> par,sz;
vector<pair<int &,int>> history;
void init(int n){
par = vector<int> (n+5);
sz = vector<int> (n+5,1);
iota(all(par),0);
}
int fs(int v){
return par[v] == v?v:fs(par[v]);
}
void us(int u, int v){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bridges.cpp: In function 'void solve()':
bridges.cpp:80:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   80 |         for(auto [id,t,v,w]:qr[block]){
      |                  ^
bridges.cpp:92:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<query>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   92 |         for(int i = 0; i < qr[block].size(); i++){
      |                        ~~^~~~~~~~~~~~~~~~~~
bridges.cpp:93:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   93 |             auto [id,t,v,w] = qr[block][i];
      |                  ^
bridges.cpp:100:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<query>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |                 for(int j = 0; j < qr[block].size(); j++){
      |                                ~~^~~~~~~~~~~~~~~~~~
bridges.cpp:101:26: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  101 |                     auto [id1,t1,v1,w1] = qr[block][j];
      |                          ^
bridges.cpp:111:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  111 |         for(auto [id,t,v,w]:qr[block]) if(t == 1) ed[v].w = w, mark[v] = 0;
      |                  ^
bridges.cpp: In function 'int main()':
bridges.cpp:122:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  122 |         freopen("test.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bridges.cpp:123:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  123 |         freopen("test.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...