113192024-08-08 13:59:30bzyÁruszállítás (75 pont)cpp17Wrong answer 0/75200ms10724 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int A[n+1] = {0};
	for(int i = 0; i<m;i++){
		int start; int end;
		cin >> start >> end;
		A[start] ++;
		A[end] --; 
	}
	int c = 0;
	int ans = 0;
	int B[n+1] = {0};
	for(int i = 1;i<n;i++){
		c += A[i];
		B[i] += c;
		if(B[i] == 0) ans++;
		cout<<B[i]<<" ";
	}
	cout<<endl;
	cout<<ans;
	
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/03ms632 KiB
2Wrong answer0/0200ms10724 KiB
3Wrong answer0/33ms384 KiB
4Wrong answer0/33ms400 KiB
5Wrong answer0/33ms376 KiB
6Wrong answer0/33ms356 KiB
7Wrong answer0/33ms504 KiB
8Wrong answer0/42ms412 KiB
9Wrong answer0/42ms356 KiB
10Wrong answer0/43ms376 KiB
11Wrong answer0/49ms1016 KiB
12Wrong answer0/414ms1140 KiB
13Wrong answer0/417ms1252 KiB
14Wrong answer0/429ms1996 KiB
15Wrong answer0/428ms2076 KiB
16Wrong answer0/446ms4240 KiB
17Wrong answer0/459ms5528 KiB
18Wrong answer0/471ms6664 KiB
19Wrong answer0/454ms4188 KiB
20Wrong answer0/467ms5348 KiB
21Wrong answer0/4187ms10616 KiB
22Wrong answer0/4187ms10724 KiB