Submission #985839

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9858392024-05-19 04:45:15duckindogBuilding Skyscrapers (CEOI19_skyscrapers)C++17
8 / 100
55 ms11772 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 150'000 + 10,
dx[8] = {-1, 0, 1, -1, 1, 1, 0, -1},
dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int n, type;
struct Point {
int r, c, idx;
bool operator > (const auto& rhs) {
return make_pair(r, c) > make_pair(rhs.r, rhs.c);
}
friend ostream& operator << (ostream& os, const auto& rhs) {
return os << rhs.r << " " << rhs.c << " " << rhs.idx;
}
} p[N];
unordered_map<int, unordered_map<int, int>> rvs;
bool mk[N];
vector<int> answer;
void dfs(int idx) {
int r = p[idx].r, c = p[idx].c;
answer.push_back(idx);
for (int i = 0; i < 8; ++i) {
int nR = r + dx[i], nC = c + dy[i],
nxt = rvs[nR][nC];
if (!nxt || mk[nxt]) continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscrapers.cpp:12:25: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   12 |  bool operator > (const auto& rhs) {
      |                         ^~~~
skyscrapers.cpp:15:50: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   15 |  friend ostream& operator << (ostream& os, const auto& rhs) {
      |                                                  ^~~~
skyscrapers.cpp: In function 'int32_t main()':
skyscrapers.cpp:51:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   51 |  if (answer.size() != n) { cout << "No\n"; return 0; };
      |      ~~~~~~~~~~~~~~^~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...