Submission #31825

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
318252017-09-10 15:36:32minchurlJakarta Skyscrapers (APIO15_skyscraper)C++11
100 / 100
853 ms4880 KiB
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#define MAX_N 30005
#define inf 0x3fffffff
using namespace std;
struct emp{
int b,p,i;
vector<int> list;
int next,prev;
bool operator < (emp d) const{
if(b==d.b) return p<d.p;
return b<d.b;
}
} arr[MAX_N];
int N,M,S,E;
int hn,heap[MAX_N],hloc[MAX_N],dst[MAX_N],chk[MAX_N],num[MAX_N];
bool hchk[MAX_N];
void upheap(int x){
int y;
while(x>1){
y=x/2;
if(dst[heap[x]]>=dst[heap[y]]) return;
swap(heap[x],heap[y]);
hloc[heap[x]]=x;
hloc[heap[y]]=y;
x=y;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscraper.cpp: In function 'int dijkstra()':
skyscraper.cpp:56:16: warning: unused variable 'maxx' [-Wunused-variable]
  int i,j,x,y,z,maxx=0,sz;
                ^
skyscraper.cpp: In function 'int main()':
skyscraper.cpp:104:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&M,&N);
                      ^
skyscraper.cpp:106:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&arr[i].b,&arr[i].p);
                                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...