Submission #99920

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
999202019-03-08 18:15:03MohamedAhmed0Jakarta Skyscrapers (APIO15_skyscraper)C++14
100 / 100
298 ms67876 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n , m ;
scanf("%d %d" , &n , &m) ;
vector< set<int> >v(n+1) ;
vector< vector< pair<int , int> > >adj(n+1) ;
int s , e ;
for(int i = 0 ; i < m ; ++i)
{
int a , b ;
scanf("%d %d" , &a , &b) ;
if(i == 0)
s = a ;
else if(i == 1)
e = a ;
v[a].insert(b) ;
}
for(int i = 0 ; i < n ; ++i)
{
for(auto &power : v[i])
{
for(int j = 1 ; ; ++j)
{
int here = i+power*j ;
if(here >= n)
break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscraper.cpp: In function 'int main()':
skyscraper.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d" , &n , &m) ;
     ~~~~~^~~~~~~~~~~~~~~~~~~
skyscraper.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d" , &a , &b) ;
         ~~~~~^~~~~~~~~~~~~~~~~~~
skyscraper.cpp:51:13: warning: 's' may be used uninitialized in this function [-Wmaybe-uninitialized]
     dist[s] = 0 ;
     ~~~~~~~~^~~
skyscraper.cpp:57:9: warning: 'e' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if(now == e)
         ^~
#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...