Submission #199114

# Submission time Handle Problem Language Result Execution time Memory
199114 2020-01-29T11:52:08 Z godwind Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 1656 KB
// O O O O O O O O O O O O O O O OO O OO O OO O O O TTCH O TTTCH O TTTCH O O O O
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx")
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <random>
#include <iomanip>
#include <bitset>
#include <cassert>
 
//#include "grader.h"

using namespace std;


#define y1 y11
#define double long double
#define less less228
#define left left228
#define right right228
#define list list228

template<typename T> void uin(T &a, T b) {
    if (b < a) a = b;
}
template<typename T> void uax(T &a, T b) {
    if (b > a) a = b;
}

const int N = 150 * 1000 + 228;

int n, l;
int x[N];


int update(int id, int nv) {
	x[id] = nv;
	vector<int> cc;
	for (int i = 0; i < n; ++i) {
		cc.push_back(x[i]);
	}
	sort(cc.begin(), cc.end());
	int s = cc[0];
	int res = 1;
	for (int i = 0; i < n; ++i) {
		if (cc[i] > s + l) {
			s = cc[i];
			++res;
		}
	}
	return res;
}

void init(int nnnn, int llll, int xs[]) {
	n = nnnn;
	l = llll;
	for (int i = 0; i < n; ++i) {
		x[i] = xs[i];
	}
    return;
}



// signed main() {
// 	cin >> n >> l;
// 	for (int i = 0; i < n; ++i) {
// 		cin >> x[i];
// 	}
// 	init(n, l, x);
// 	while (1) {
// 		int i, j;
// 		cin >> i >> j;
// 		cout << update(i, j) << '\n';
// 	}
// 	return 0;
// }





# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Execution timed out 9077 ms 1656 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Execution timed out 9077 ms 1656 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Execution timed out 9077 ms 1656 KB Time limit exceeded
8 Halted 0 ms 0 KB -