Submission #147348

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1473482019-08-29 06:33:02georgerapeanuValley (BOI19_valley)C++11
100 / 100
271 ms37776 KiB
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
FILE *f = stdin;
FILE *g = stdout;
const int NMAX = 1e5;
const int QMAX = 1e5;
const int LGMAX = 16;
const long long inf = (1LL << 60);
int n,s,q,e;
long long dp[LGMAX + 1][NMAX + 5];
int father[LGMAX + 1][NMAX + 5];
vector<pair<int,int> > graph[NMAX + 5];
pair<int,int> edge[NMAX + 5];
int lin[NMAX + 5],sz;
int st[NMAX + 5];
int dr[NMAX + 5];
long long lvl[NMAX + 5];
void dfs(int nod,int tata){
father[0][nod] = tata;
lin[++sz] = nod;
st[nod] = sz;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

valley.cpp: In function 'int main()':
valley.cpp:45:11: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     fscanf(f,"%d %d %d %d",&n,&s,&q,&e);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
valley.cpp:49:15: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         fscanf(f,"%d %d %d",&a,&b,&w);
         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
valley.cpp:61:15: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         fscanf(f,"%d",&x);
         ~~~~~~^~~~~~~~~~~
valley.cpp:82:15: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         fscanf(f,"%d %d",&e,&u);
         ~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...