Submission #76084590


Source Code Expand

#include <iostream>
#include <math.h>
#include <vector>
using namespace std;


int main(){
/*
	int N;

cin >> N;

string n = "HelloWorld";
vector<char> h = {};

for (int i = 0; i < n.size(); i++) {
	if (i != N - 1) {
		h.push_back(n.at(i));
	}
	
}

string H;
for (int i = 0; i < 9; i++) {
	cout << h.at(i);
}
*/
/*
	int N;
	cin >> N;
	vector<string> S(N);
	vector<char> C(N);

	for (int i = 0; i < N; i++) {
		cin >> S.at(i);
		C.at(i) = S.at(i).at(0);
	}
	for (int i = 0; i < N; i++) {
		if (C.at(i) == 'a' || C.at(i) == 'b' || C.at(i) == 'c') {
			cout << 2;
		}
		else if (C.at(i) == 'd' || C.at(i) == 'e' || C.at(i) == 'f') {
			cout << 3;
		}
		else if (C.at(i) == 'g' || C.at(i) == 'h' || C.at(i) == 'i') {
			cout << 4;
		}
		else if (C.at(i) == 'j' || C.at(i) == 'k' || C.at(i) == 'l') {
			cout << 5;
		}
		else if (C.at(i) == 'm' || C.at(i) == 'n' || C.at(i) == 'o') {
			cout << 6;
		}
		else if (C.at(i) == 'p' || C.at(i) == 'q' || C.at(i) == 'r' || C.at(i) == 's') {
			cout << 7;
		}
		else if (C.at(i) == 't' || C.at(i) == 'u' || C.at(i) == 'v') {
			cout << 8;
		}
		else if (C.at(i) == 'w' || C.at(i) == 'x' || C.at(i) == 'y' || C.at(i) == 'z') {
			cout << 9;
		}
	}*/



	int N, Q;
	cin >> N >> Q;
	vector<int> mas(N);
	int q1, q2;
	vector<int> out(0);
	for (int i = 0; i < Q; i++) {
		cin >> q1 >> q2;
		if (q1 == 1) {
			mas.at(q2 - 1)++;
		}


		if (q1 == 2) {
			int tmp = 0;
			for (int j = 0; j < N; j++) {
				if (j == 0) {
					tmp = mas.at(0);
				}
				if (mas.at(j) < tmp) {
					tmp = mas.at(j);
				}
			}

			int count = 0;
			for (int k = 0; k < N; k++) {
				if ((mas.at(k) - tmp) >= q2) {
					count++;
				}
			}
			out.push_back(count);
		}
	}

	for (int i = 0;i < out.size();i++) {
		cout << out.at(i) << endl;
	}
}

Submission Info

Submission Time
Task C - Drop Blocks
User YH_Ti_Super
Language C++23 (GCC 15.2.0)
Score 0
Code Size 1856 Byte
Status TLE
Exec Time > 2000 ms
Memory 5456 KiB

Compile Error

./Main.cpp: In function 'int main()':
./Main.cpp:100:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |         for (int i = 0;i < out.size();i++) {
      |                        ~~^~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
AC × 35
TLE × 15
Set Name Test Cases
Sample example_00.txt
All example_00.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, hand_23.txt, hand_24.txt, hand_25.txt, hand_26.txt, hand_27.txt, hand_28.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3488 KiB
hand_00.txt AC 72 ms 4528 KiB
hand_01.txt AC 72 ms 4476 KiB
hand_02.txt TLE > 2000 ms 4556 KiB
hand_03.txt TLE > 2000 ms 4420 KiB
hand_04.txt TLE > 2000 ms 3952 KiB
hand_05.txt AC 1714 ms 4376 KiB
hand_06.txt AC 1745 ms 4480 KiB
hand_07.txt AC 46 ms 3588 KiB
hand_08.txt AC 146 ms 5456 KiB
hand_09.txt AC 98 ms 4420 KiB
hand_10.txt AC 98 ms 4432 KiB
hand_11.txt AC 62 ms 3720 KiB
hand_12.txt AC 62 ms 3608 KiB
hand_13.txt TLE > 2000 ms 4464 KiB
hand_14.txt AC 1721 ms 4604 KiB
hand_15.txt AC 1717 ms 4544 KiB
hand_16.txt AC 1 ms 3500 KiB
hand_17.txt TLE > 2000 ms 4472 KiB
hand_18.txt AC 46 ms 3528 KiB
hand_19.txt AC 47 ms 3544 KiB
hand_20.txt AC 46 ms 3544 KiB
hand_21.txt TLE > 2000 ms 4604 KiB
hand_22.txt AC 75 ms 4324 KiB
hand_23.txt TLE > 2000 ms 4540 KiB
hand_24.txt TLE > 2000 ms 4540 KiB
hand_25.txt AC 2 ms 4348 KiB
hand_26.txt AC 2 ms 4328 KiB
hand_27.txt TLE > 2000 ms 4444 KiB
hand_28.txt AC 90 ms 3832 KiB
random_00.txt AC 100 ms 4508 KiB
random_01.txt AC 127 ms 4628 KiB
random_02.txt AC 182 ms 4628 KiB
random_03.txt TLE > 2000 ms 4092 KiB
random_04.txt TLE > 2000 ms 4552 KiB
random_05.txt AC 116 ms 4432 KiB
random_06.txt AC 81 ms 3892 KiB
random_07.txt AC 298 ms 4488 KiB
random_08.txt AC 1311 ms 4020 KiB
random_09.txt TLE > 2000 ms 4028 KiB
random_10.txt AC 123 ms 4556 KiB
random_11.txt AC 83 ms 3920 KiB
random_12.txt AC 364 ms 4496 KiB
random_13.txt AC 1161 ms 4644 KiB
random_14.txt TLE > 2000 ms 4028 KiB
random_15.txt AC 70 ms 3836 KiB
random_16.txt AC 156 ms 4404 KiB
random_17.txt AC 128 ms 3900 KiB
random_18.txt TLE > 2000 ms 3940 KiB
random_19.txt TLE > 2000 ms 4092 KiB