Submission #242941

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2429412020-06-30 01:25:47kai824Jakarta Skyscrapers (APIO15_skyscraper)C++17
57 / 100
252 ms262144 KiB
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define mp make_pair
#define pii pair<int,int>
vector<pair<pii,int> > adjl[30000][180];//position, power, weight... if power==179, then it's dummy
bool used[30000][180];
int dist[30000][180],a,b,c;
priority_queue<pair<int,pii>,vector<pair<int,pii> >, greater<pair<int,pii> > > dijk;
//weight, pos, power
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int n,m,s,d,start,end;
cin>>n>>m;//m doges, n buildings
for(int x=0;x<n;x++){
for(int y=0;y<179;y++){
adjl[x][y].emplace_back(mp(x,179),0);
dist[x][y]=LLONG_MAX;
if(y>0){
if(x+y<n)adjl[x][y].emplace_back(mp(x+y,y),1);
if(x-y>=0)adjl[x][y].emplace_back(mp(x-y,y),1);
}
}
dist[x][179]=LLONG_MAX;
}
for(int x=0;x<m;x++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscraper.cpp: In function 'int32_t main()':
skyscraper.cpp:72:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=0;i<adjl[a][b].size();i++){
                   ~^~~~~~~~~~~~~~~~~~
skyscraper.cpp:61:21: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
     dist[start][179]=0;
     ~~~~~~~~~~~~~~~~^~
skyscraper.cpp:79:21: warning: 'end' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(dist[end][179]==LLONG_MAX)cout<<"-1";
        ~~~~~~~~~~~~~^
#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...