Submission #5691

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
56912014-05-13 07:11:08cki86201UFO (IZhO14_ufo)C++98
100 / 100
1719 ms76260 KiB
#include<stdio.h>
#include<vector>
using namespace std;
vector<vector <int> > inp;
int N, M, R, K, P;
struct node{
node(){v=x=0,link[0]=link[1]=0;}
int v, x;
node *link[2];
inline void pushup(){
x = max(v, max(link[0] ? link[0]->x : 0, link[1] ? link[1]->x : 0));
}
void build(int xy,int cl,int s,int d){
int m = (s+d) >> 1;
v = (xy ? inp[m][cl] : inp[cl][m]);
if(s<m){
link[0] = new node();
link[0]->build(xy, cl, s, m-1);
}
if(m<d){
link[1] = new node();
link[1]->build(xy, cl, m+1, d);
}
pushup();
}
void update(int w,int s,int d){
int m = (s+d)>>1;
if(w == m)--v;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

ufo.cpp: In function 'int main()':
ufo.cpp:76:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d%d%d",&N,&M,&R,&K,&P);
                                    ^
ufo.cpp:81:41: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for(j=0;j<M;j++)scanf("%d",&inp[i][j]);
                                         ^
ufo.cpp:89:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s%d%d",c,&w,&h);
                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...