Submission #88751

#TimeUsernameProblemLanguageResultExecution timeMemory
88751David_MHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include "horses.h" #include<bits/stdc++.h> using namespace std; struct ABC{int res, x, y; double X, Y, m;} a[2000010]; int n, u=1000000007; void upd(int l, int r, int i, int k, int x, int y){ if(r<k || k<l) return; if(l==k && l==r){ if(x) a[i].X=log10(x), a[i].x=x, a[i].m=a[i].X+a[i].Y; if(y) a[i].Y=log10(y), a[i].y=y, a[i].m=a[i].X+a[i].Y; a[i].A=a[i].x*a[i].y%u; return; }int L=i*2, R=i*2+1; upd(l, (l+r)/2, L,k,x,y); upd((l+r)/2+1,r,R,k,x,y); a[i].X=a[L].X+a[R].X; a[i].x=a[L].x*a[R].x%u; if(a[L].m<a[R].m+a[L].X) a[i].m=a[R].m+a[L].X, a[i].A=a[R].A*a[L].x%u; else a[i].m=a[L].m, a[i].A=a[L].A; } int init(int N,int X[],int Y[]){n=N; for(I=0;I<n;I++) upd(0,n-1,1,I,X[I],Y[I]); return a[1].A;} int updateX(int pos,int val){upd(0,n-1,1,pos,val,0); return a[1].A;} int updateY(int pos,int val){upd(0,n-1,1,pos,0,val); return a[1].A;}

Compilation message (stderr)

horses.cpp: In function 'void upd(int, int, int, int, int, int)':
horses.cpp:11:11: error: 'struct ABC' has no member named 'A'
      a[i].A=a[i].x*a[i].y%u;
           ^
horses.cpp:22:8: error: 'struct ABC' has no member named 'A'
   a[i].A=a[R].A*a[L].x%u;
        ^
horses.cpp:22:15: error: 'struct ABC' has no member named 'A'
   a[i].A=a[R].A*a[L].x%u;
               ^
horses.cpp:25:8: error: 'struct ABC' has no member named 'A'
   a[i].A=a[L].A;
        ^
horses.cpp:25:15: error: 'struct ABC' has no member named 'A'
   a[i].A=a[L].A;
               ^
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:27:42: error: 'I' was not declared in this scope
 int init(int N,int X[],int Y[]){n=N; for(I=0;I<n;I++) upd(0,n-1,1,I,X[I],Y[I]); return a[1].A;}
                                          ^
horses.cpp:27:93: error: 'struct ABC' has no member named 'A'
 int init(int N,int X[],int Y[]){n=N; for(I=0;I<n;I++) upd(0,n-1,1,I,X[I],Y[I]); return a[1].A;}
                                                                                             ^
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:28:66: error: 'struct ABC' has no member named 'A'
 int updateX(int pos,int val){upd(0,n-1,1,pos,val,0); return a[1].A;} 
                                                                  ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:29:66: error: 'struct ABC' has no member named 'A'
 int updateY(int pos,int val){upd(0,n-1,1,pos,0,val); return a[1].A;}
                                                                  ^