Submission #48488

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
484882018-05-14 13:17:40KmcodeJakarta Skyscrapers (APIO15_skyscraper)C++14
100 / 100
834 ms176180 KiB
#include "bits/stdc++.h"
using namespace std;
int n;
int m;
map<pair<int, int>, vector<int> > mp;
vector<pair<int, int> > bs;
vector<int> con;
vector<int> dist;
vector<int> g[300002];
deque<int> q;
int main() {
cin >> n >> m;
for (int i = 0; i < n; i++)bs.push_back(make_pair(-1, -1));
for (int i = 0; i < n; i++)con.push_back(-1);
for (int i = 0; i < n; i++)dist.push_back(-1);
int idx = n;
int star = -1;
int en = -1;
for (int i = 0; i < m; i++) {
int b, p;
scanf("%d%d", &b, &p);
if (i == 0)star = b;
if (i == 1)en = b;
pair<int, int> base = make_pair(b%p, p);
if (!mp.count(base)) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscraper.cpp: In function 'int main()':
skyscraper.cpp:69:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (b + 1 < bs.size() && bs[b] == bs[b + 1] && dist[b + 1] == -1) {
         ~~~~~~^~~~~~~~~~~
skyscraper.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &b, &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...