Submission #288374

# Submission time Handle Problem Language Result Execution time Memory
288374 2020-09-01T13:00:18 Z emil_physmath Wall (IOI14_wall) C++17
0 / 100
178 ms 14072 KB
#include "wall.h"
#include <iostream>
#include <random>
#include <chrono>
using namespace std;
using llong = long long;
#define BUGO(x) cerr << #x << " = " << (x) << '\n';
#define BUGOARR(a) {cerr << #a << ": "; for (auto i: a) cerr << i << ' '; cerr << '\n';}
#ifndef MANSON
#define BUGO(x)
#define BUGOARR(x)
#endif
ostream& operator<<(ostream& out, const pair<auto, auto>& p) {
	out << "{" << p.first << ", " << p.second << "}";
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int ans[])
{
    for (int x = 0; x < k; ++x)
        if (op[x] == 1) // Add
        {
            for (int i = left[x]; i <= right[x]; ++i)
                ans[i] = max(ans[i], height[i]);
        }
        else // Remove
        {
            for (int i = left[x]; i <= right[x]; ++i)
                ans[i] = min(ans[i], height[i]);
        }
}

Compilation message

wall.cpp:10: warning: "BUGO" redefined
   10 | #define BUGO(x)
      | 
wall.cpp:7: note: this is the location of the previous definition
    7 | #define BUGO(x) cerr << #x << " = " << (x) << '\n';
      | 
wall.cpp:11: warning: "BUGOARR" redefined
   11 | #define BUGOARR(x)
      | 
wall.cpp:8: note: this is the location of the previous definition
    8 | #define BUGOARR(a) {cerr << #a << ": "; for (auto i: a) cerr << i << ' '; cerr << '\n';}
      | 
wall.cpp:13:46: warning: use of 'auto' in parameter declaration only available with '-fconcepts'
   13 | ostream& operator<<(ostream& out, const pair<auto, auto>& p) {
      |                                              ^~~~
wall.cpp:13:52: warning: use of 'auto' in parameter declaration only available with '-fconcepts'
   13 | ostream& operator<<(ostream& out, const pair<auto, auto>& p) {
      |                                                    ^~~~
wall.cpp: In function 'std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)':
wall.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 178 ms 14072 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -