51162023-04-18 02:06:48tomi7Rendező robot (80 pont)cpp11Wrong answer 2/8070ms5532 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	cout<<max((a[0]-1)*2-1, (n-a[n-1])*2)<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base2/80
1Accepted0/03ms1692 KiB
2Wrong answer0/03ms1852 KiB
3Wrong answer0/23ms2092 KiB
4Wrong answer0/33ms2304 KiB
5Wrong answer0/33ms2516 KiB
6Wrong answer0/23ms2704 KiB
7Wrong answer0/23ms2912 KiB
8Wrong answer0/23ms3160 KiB
9Accepted2/23ms3340 KiB
10Wrong answer0/23ms3420 KiB
11Wrong answer0/23ms3548 KiB
12Wrong answer0/23ms3636 KiB
13Wrong answer0/23ms3760 KiB
14Wrong answer0/23ms3852 KiB
15Wrong answer0/23ms3864 KiB
16Wrong answer0/23ms3860 KiB
17Wrong answer0/23ms4016 KiB
18Wrong answer0/468ms5500 KiB
19Wrong answer0/468ms5356 KiB
20Wrong answer0/468ms5352 KiB
21Wrong answer0/468ms5356 KiB
22Wrong answer0/468ms5352 KiB
23Wrong answer0/470ms5444 KiB
24Wrong answer0/468ms5532 KiB
25Wrong answer0/470ms5356 KiB
26Wrong answer0/468ms5356 KiB
27Wrong answer0/468ms5352 KiB
28Wrong answer0/468ms5356 KiB
29Wrong answer0/468ms5440 KiB