194492025-12-09 15:17:21algoproLapozgatáscpp17Wrong answer 12/10096ms1384 KiB
// UUID: a61b6d6f-4e69-4ee2-9cf1-d7251488e6b7
#include <bits/stdc++.h>
#include <vector>
using namespace std;

int main() {
	int konyv_hossz,akt_hely,n;
	cin>>konyv_hossz>>akt_hely>>n;
	vector<int>celok(n);
	int min=akt_hely,max=akt_hely,szamlalo=0,lapozas_szama=0;
	for (int i=0;i<n;i++){
		cin>>celok[i];
		//cout << celok[i] << ' ' << min << ' ' << max << '\n';
		if(celok[i]<=max && celok[i]>=min){
			szamlalo+=0;
		}else {
			szamlalo+=abs(celok[i]-akt_hely);
			akt_hely=celok[i];
			lapozas_szama++;
			if(celok[i]-akt_hely>0){
				max=celok[i];
			}else{
				min=celok[i];
			}

			//cout<<szamlalo<<' '<<akt_hely<<"\n";
		}
	}
	cout<<lapozas_szama<<' '<<szamlalo;	
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Wrong answer1ms512 KiB
subtask212/12
3Accepted1ms316 KiB
4Accepted1ms316 KiB
5Accepted1ms316 KiB
subtask30/24
6Accepted1ms316 KiB
7Wrong answer1ms316 KiB
8Accepted1ms316 KiB
9Wrong answer1ms316 KiB
10Wrong answer2ms316 KiB
11Wrong answer2ms508 KiB
subtask40/28
12Accepted93ms1076 KiB
13Wrong answer93ms1200 KiB
14Wrong answer93ms1076 KiB
15Wrong answer93ms1192 KiB
16Wrong answer94ms1124 KiB
17Wrong answer93ms1076 KiB
18Wrong answer94ms1076 KiB
subtask50/36
19Partially correct93ms1200 KiB
20Wrong answer94ms1272 KiB
21Wrong answer96ms1076 KiB
22Wrong answer94ms1080 KiB
23Wrong answer96ms1076 KiB
24Wrong answer96ms1076 KiB
25Wrong answer94ms1328 KiB
26Wrong answer96ms1384 KiB
27Wrong answer96ms1260 KiB