Submission #233655

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2336552020-05-21 09:49:04almogwaldFactories (JOI14_factories)C++14
0 / 100
8048 ms118940 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define forr(i,a,b,c) for(int i=a;i<b;i+=c)
#define fort(i,a,b) forr(i,a,b,1)
#define forn(i,n) fort(i,1,n)
#define fori(i,n) fort(i,0,n)
#define forrb(i,a,b,c) for(int i=b-1;i>=a;i-=c)
#define fortb(i,a,b) forrb(i,a,b,1)
#define fornb(i,n) fortb(i,1,n)
#define forib(i,n) fortb(i,0,n)
using namespace std;
#define into(x) cin >> x;
typedef vector<int> veci;
typedef long long lol;
typedef pair<lol,lol> point;
#define def(x) lol x; into(x)
vector<veci> f;
#define MAX_N 500000
#define logn 19
vector<vector<point>> cons;
lol depth[MAX_N];
int dep[MAX_N];
void Init(int N, int A[], int B[], int D[]) {
cons.resize(N);
f.resize(N);
fori(i, N - 1) {
cons[A[i]].push_back({ B[i] , D[i]});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:6:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define forr(i,a,b,c) for(int i=a;i<b;i+=c)
                                    ^
factories.cpp:7:21: note: in expansion of macro 'forr'
 #define fort(i,a,b) forr(i,a,b,1)
                     ^~~~
factories.cpp:9:19: note: in expansion of macro 'fort'
 #define fori(i,n) fort(i,0,n)
                   ^~~~
factories.cpp:47:3: note: in expansion of macro 'fori'
   fori(i, cons[cur].size()) {
   ^~~~
factories.cpp: In function 'long long int Query(int, int*, int, int*)':
factories.cpp:6:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define forr(i,a,b,c) for(int i=a;i<b;i+=c)
                                    ^
factories.cpp:7:21: note: in expansion of macro 'forr'
 #define fort(i,a,b) forr(i,a,b,1)
                     ^~~~
factories.cpp:9:19: note: in expansion of macro 'fort'
 #define fori(i,n) fort(i,0,n)
                   ^~~~
factories.cpp:112:4: note: in expansion of macro 'fori'
    fori(i, cons[cur].size()) {
    ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...