Submission #522350

# Submission time Handle Problem Language Result Execution time Memory
522350 2022-02-04T16:16:58 Z maks007 Simple game (IZhO17_game) C++14
0 / 100
2 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

int main(void) {
	int n, m;
	cin >> n >> m;
	vector <int> a(n);
	for(int i = 0; i < n; i ++) cin >> a[i];
	sort(a.begin(), a.end());
	while(m --) {
		int type;
		cin >> type;
		if(type == 1) {
			int idx, val;
			cin >> idx >> val;
			idx --;
			a[idx] = val;
		}else {
			int x;
			cin >> x;
			int cnt = 0;
			for(auto i : a) if(i <= x) cnt ++;
				cout << cnt << "\n";
		}
	}
	return false;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 2 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 2 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 2 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -