Submission #14735

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
147352015-06-15 11:56:28gs13068Jakarta Skyscrapers (APIO15_skyscraper)C++98
100 / 100
93 ms49496 KiB
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
int p[33333];
int q[33333];
std::vector<int> a[33333];
std::priority_queue<std::pair<int,int> > pq;
int t[33333][333];
int d[33333];
int v[33333];
int main()
{
std::pair<int,int> tt;
int i,j,k,l,n,m;
scanf("%d%d",&n,&m);
for(i=0;i<m;i++)
{
scanf("%d%d",&p[i],&q[i]);
if(q[i]>=300||!t[p[i]][q[i]])a[p[i]].push_back(q[i]);
if(q[i]<300)t[p[i]][q[i]]=1;
}
for(i=0;i<n;i++)d[i]=1e9;
pq.push(std::make_pair(0,p[0]));
while(!pq.empty()&&!v[p[1]])
{
tt=pq.top();
pq.pop();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...