194472025-12-09 15:00:14algoproLapozgatáscpp17Wrong answer 0/10094ms3124 KiB
// UUID: 709a7b93-6112-4969-b541-e6fbd761c6e4
#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;
	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];
		}
	}
	cout<<szamlalo;	
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer1ms316 KiB
subtask20/12
3Wrong answer1ms512 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
subtask30/24
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
8Wrong answer1ms316 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
subtask40/28
12Wrong answer93ms1268 KiB
13Wrong answer94ms2868 KiB
14Wrong answer93ms1076 KiB
15Wrong answer94ms1080 KiB
16Wrong answer94ms1344 KiB
17Wrong answer93ms996 KiB
18Wrong answer93ms1208 KiB
subtask50/36
19Wrong answer94ms2988 KiB
20Wrong answer93ms1152 KiB
21Wrong answer93ms1076 KiB
22Wrong answer94ms2976 KiB
23Wrong answer93ms1076 KiB
24Wrong answer94ms2972 KiB
25Wrong answer93ms1272 KiB
26Wrong answer94ms3124 KiB
27Wrong answer94ms3100 KiB