194482025-12-09 15:04:17algoproLapozgatáscpp17Wrong answer 0/10089ms1288 KiB
// UUID: fbc141a6-7940-4593-b38d-5b57dc729a6f
#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];
		if(celok[i]<max && celok[i]>min){
			szamlalo+=0;
		}else {
			szamlalo+=abs(celok[i]-akt_hely);
			akt_hely=celok[i];
			lapozas_szama++;
		}
	}
	cout<<lapozas_szama-1<<' '<<szamlalo;	
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Wrong answer1ms316 KiB
subtask20/12
3Wrong answer1ms316 KiB
4Wrong answer1ms508 KiB
5Wrong answer1ms316 KiB
subtask30/24
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
8Wrong answer1ms508 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
subtask40/28
12Wrong answer89ms1076 KiB
13Wrong answer89ms1076 KiB
14Wrong answer89ms1196 KiB
15Wrong answer89ms1192 KiB
16Wrong answer89ms968 KiB
17Wrong answer89ms1076 KiB
18Wrong answer89ms1284 KiB
subtask50/36
19Wrong answer89ms1288 KiB
20Wrong answer89ms1076 KiB
21Wrong answer89ms1076 KiB
22Wrong answer89ms1076 KiB
23Wrong answer89ms1076 KiB
24Wrong answer89ms1076 KiB
25Wrong answer89ms1092 KiB
26Wrong answer89ms1116 KiB
27Wrong answer89ms1076 KiB