Submission #52849

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
528492018-06-27 05:11:32zetapiHoliday (IOI14_holiday)C++14
Compilation error
0 ms0 KiB
//#include <holiday.h>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
typedef pair<ll,ll> pii;
const int MAX=3e5;
struct data
{
ll ind;
ll sum;
} seg[MAX];
vector<pii> sorted;
ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
void build(int low,int high,int node)
{
if(low==high)
{
R[low]=delta;
if(low<=sorted.size())
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

holiday.cpp: In function 'void build(int, int, int)':
holiday.cpp:28:10: error: 'delta' was not declared in this scope
   R[low]=delta;
          ^~~~~
holiday.cpp:28:10: note: suggested alternative: 'data'
   R[low]=delta;
          ^~~~~
          data
holiday.cpp:29:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(low<=sorted.size())
      ~~~^~~~~~~~~~~~~~~
holiday.cpp: In function 'void update(int, int, int, int, int)':
holiday.cpp:51:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(idx>sorted.size() or idx<1)
     ~~~^~~~~~~~~~~~~~
holiday.cpp:55:5: error: 'row' was not declared in this scope
   R[row]=delta;
     ^~~
holiday.cpp:55:5: note: suggested alternative: 'low'
   R[row]=delta;
     ^~~
     low
holiday.cpp: At global scope:
holiday.cpp:148:11: error: redefinition of 'const int MAX'
 const int MAX=3e5;
           ^~~
holiday.cpp:12:11: note: 'const int MAX' previously defined here
 const int MAX=3e5;
           ^~~
holiday.cpp:150:8: error: redefinition of 'struct data'
 struct data
        ^~~~
holiday.cpp:14:8: note: previous definition of 'struct data'
 struct data
        ^~~~
holiday.cpp:154:10: error: conflicting declaration 'int seg [300000]'
 } seg[MAX];
          ^
holiday.cpp:18:3: note: previous declaration as 'data seg [300000]'
 } seg[MAX];
   ^~~
holiday.cpp:156:13: error: redefinition of 'std::vector<std::pair<long long int, long long int> > sorted'
 vector<pii> sorted;
             ^~~~~~
holiday.cpp:20:13: note: 'std::vector<std::pair<long long int, long long int> > sorted' previously declared here
 vector<pii> sorted;
             ^~~~~~
holiday.cpp:158:4: error: redefinition of 'long long int N'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
    ^
holiday.cpp:22:4: note: 'long long int N' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
    ^
holiday.cpp:158:6: error: redefinition of 'long long int D'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
      ^
holiday.cpp:22:6: note: 'long long int D' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
      ^
holiday.cpp:158:8: error: redefinition of 'long long int Start'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
        ^~~~~
holiday.cpp:22:8: note: 'long long int Start' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
        ^~~~~
holiday.cpp:158:21: error: redefinition of 'long long int pos [300000]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                     ^
holiday.cpp:22:14: note: 'long long int pos [300000]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
              ^~~
holiday.cpp:158:28: error: redefinition of 'long long int R [300000]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                            ^
holiday.cpp:22:23: note: 'long long int R [300000]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                       ^
holiday.cpp:158:38: error: redefinition of 'long long int f [300000][2]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                      ^
holiday.cpp:22:30: note: 'long long int f [300000][2]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                              ^
holiday.cpp:158:48: error: redefinition of 'long long int g [300000][2]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                                ^
holiday.cpp:22:40: note: 'long long int g [300000][2]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                        ^
holiday.cpp:158:61: error: redefinition of 'long long int fans [300000][2]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                                             ^
holiday.cpp:22:50: note: 'long long int fans [300000][2]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                                  ^~~~
holiday.cpp:158:74: error: redefinition of 'long long int gans [300000][2]'
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                                                          ^
holiday.cpp:22:63: note: 'long long int gans [300000][2]' previously declared here
 ll N,D,Start,pos[MAX],R[MAX],f[MAX][2],g[MAX][2],fans[MAX][2],gans[MAX][2];
                                                               ^~~~
holiday.cpp: In function 'void build(int, int, int)':
holiday.cpp:160:6: error: redefinition of 'void build(int, int, int)'
 void build(int low,int high,int node)
      ^~~~~
holiday.cpp:24:6: note: 'void build(int, int, int)' previously defined here
 void build(int low,int high,int node)
      ^~~~~
holiday.cpp:164:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(low<=sorted.size())
      ~~~^~~~~~~~~~~~~~~
holiday.cpp: In function 'void update(int, int, int, int, int)':
holiday.cpp:184:6: error: redefinition of 'void update(int, int, int, int, int)'
 void update(int low,int high,int node,int idx,int delta)
      ^~~~~~
holiday.cpp:49:6: note: 'void update(int, int, int, int, int)' previously defined here
 void update(int low,int high,int node,int idx,int delta)
      ^~~~~~
holiday.cpp:186:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(idx>sorted.size() or idx<1)
     ~~~^~~~~~~~~~~~~~
holiday.cpp: In function 'long long int query(int, int, int, int)':
holiday.cpp:208:4: error: redefinition of 'long long int query(int, int, int, int)'
 ll query(int low,int high,int node,int K)
    ^~~~~
holiday.cpp:73:4: note: 'long long int query(int, int, int, int)' previously defined here
 ll query(int low,int high,int node,int K)
    ^~~~~
holiday.cpp: In function 'long long int cal(int, int, int, int)':
holiday.cpp:218:4: error: redefinition of 'long long int cal(int, int, int, int)'
 ll cal(int idx,int qlow,int qhigh,int type)
    ^~~
holiday.cpp:83:4: note: 'long long int cal(int, int, int, int)' previously defined here
 ll cal(int idx,int qlow,int qhigh,int type)
    ^~~
holiday.cpp: In function 'long long int cal2(int, int, int, int)':
holiday.cpp:237:4: error: redefinition of 'long long int cal2(int, int, int, int)'
 ll cal2(int idx,int qlow,int qhigh,int type)
    ^~~~
holiday.cpp:102:4: note: 'long long int cal2(int, int, int, int)' previously defined here
 ll cal2(int idx,int qlow,int qhigh,int type)
    ^~~~
holiday.cpp: In function 'void cal(int, int, int, int, int)':
holiday.cpp:256:6: error: redefinition of 'void cal(int, int, int, int, int)'
 void cal(int low,int high,int qlow,int qhigh,int type)
      ^~~
holiday.cpp:121:6: note: 'void cal(int, int, int, int, int)' previously defined here
 void cal(int low,int high,int qlow,int qhigh,int type)
      ^~~
holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:315:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int A=0;A<sorted.size();A++)
              ~^~~~~~~~~~~~~~
holiday.cpp:326:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int A=0;A<sorted.size();A++)
              ~^~~~~~~~~~~~~~
holiday.cpp:309:5: warning: unused variable 'cur' [-Wunused-variable]
  ll cur,res=0,tem=attraction[start];
     ^~~
holiday.cpp: At global scope:
holiday.cpp:353:3: error: 'res' does not name a type
   res=max(res,fans[A][1]+gans[D-A][0]);
   ^~~
holiday.cpp:354:3: error: 'res' does not name a type
   res=max(res,gans[A][1]+fans[D-A][0]);
   ^~~
holiday.cpp:355:2: error: expected declaration before '}' token
  }
  ^
grader.cpp: In function 'int main()':
grader.cpp:7:12: warning: variable 'n_s' set but not used [-Wunused-but-set-variable]
     int i, n_s;
            ^~~