Submission #731807

# Submission time Handle Problem Language Result Execution time Memory
731807 2023-04-28T03:03:25 Z beaboss Circus (Balkan15_CIRCUS) C++14
0 / 100
23 ms 2124 KB
#include "bits/stdc++.h"

using namespace std;

#define s second
#define f first
#define pb push_back

typedef long long ll;

typedef vector<int> vi;
typedef pair<int, int> pii;

// const int N = 100001;


deque<pii> vals;

void init(int n, int m, int x[]){

	vals.pb({m - 0, m});

	for (int i = n - 1; i>= 0; i--) {
		auto it = lower_bound(vals.begin(), vals.end(), make_pair(x[i], -1)) - vals.begin();
		// cout << x[i] << vals[it].s << (vals[it].s - x[i]) << endl;
		vals.push_front({x[i] - (vals[it].s - x[i]), x[i]});
	}


}
int minLength(int d) {
	auto it = lower_bound(vals.begin(), vals.end(), make_pair(d, -1)) - vals.begin();
	return vals[it].s - d;
}

Compilation message

grader.cpp: In function 'int main()':
grader.cpp:14:12: warning: unused variable 'max_code' [-Wunused-variable]
   14 |  long long max_code;
      |            ^~~~~~~~
grader.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf("%d%d", &N, &M);
      |  ~~~~~^~~~~~~~~~~~~~~~
grader.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf("%d", &P[i]);
      |   ~~~~~^~~~~~~~~~~~~
grader.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |  scanf("%d", &Q);
      |  ~~~~~^~~~~~~~~~
grader.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |   scanf("%d", &d);
      |   ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 2124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 2124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 2124 KB Output isn't correct
2 Halted 0 ms 0 KB -