답안 #288381

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
288381 2020-09-01T13:04:14 Z emil_physmath 벽 (IOI14_wall) C++17
8 / 100
171 ms 14020 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 i = 0; i < n; ++i)
        ans[i] = 0;
    if (n <= 10000 && k <= 5000) {
        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[x]);
            }
            else // Remove
            {
                for (int i = left[x]; i <= right[x]; ++i)
                    ans[i] = min(ans[i], height[x]);
            }
        return;
    }
}

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 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 2 ms 416 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 20 ms 640 KB Output is correct
5 Correct 20 ms 640 KB Output is correct
6 Correct 20 ms 572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 166 ms 8184 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 20 ms 640 KB Output is correct
5 Correct 20 ms 640 KB Output is correct
6 Correct 20 ms 568 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Incorrect 171 ms 14020 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 22 ms 640 KB Output is correct
5 Correct 19 ms 632 KB Output is correct
6 Correct 19 ms 640 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Incorrect 165 ms 13948 KB Output isn't correct
9 Halted 0 ms 0 KB -