Submission #3221560


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define MAXN 55
int v[MAXN];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int N;
	cin >> N;
	int me = 1e9, ma = -1e9;
	int ime, ima;
	for(int i = 0; i < N; i++){
		cin >> v[i];
		if(me > v[i]) me = v[i], ime = i;
		if(ma < v[i]) ma = v[i], ima = i;
	}
	cout << N+N - 2 << "\n";
	if(abs(me) > abs(ma)){
		for(int i = 0; i < N; i++){
			if(i != ime) {
				cout << ime + 1 << " " << i+1 << "\n";
				v[i] += v[ime];
			}
		}
		for(int i = N-1; i >= 1; i--){
			cout << i+1 << " " << i << "\n";
		}
	}
	else{
		for(int i = 0; i < N; i++){
			if(i != ima) {
				cout << ima + 1 << " " << i+1 << "\n";
				v[i] += v[ima];
			}
		}	
		for(int i = 1; i < N; i++){
			cout << i << " " << i+1 << "\n";
		}
	}
	return 0;
}

Submission Info

Submission Time
Task E - Smuggling Marbles
User misael
Language C++14 (GCC 5.4.1)
Score 0
Code Size 816 Byte
Status RE
Exec Time 101 ms
Memory 256 KB

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 0 / 400 0 / 600
Status
WA × 3
WA × 11
RE × 9
WA × 11
RE × 41
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt, 00_example_03.txt
Subtask1 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s1_07.txt, s1_08.txt, s1_09.txt, s1_10.txt, s1_11.txt, s1_12.txt, s1_13.txt, s1_14.txt, s1_15.txt, s1_16.txt, s1_17.txt
All 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s1_07.txt, s1_08.txt, s1_09.txt, s1_10.txt, s1_11.txt, s1_12.txt, s1_13.txt, s1_14.txt, s1_15.txt, s1_16.txt, s1_17.txt, s2_01.txt, s2_02.txt, s2_03.txt, s2_04.txt, s2_05.txt, s2_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt, s2_12.txt, s2_13.txt, s2_14.txt, s2_15.txt, s2_16.txt, s2_17.txt, s2_18.txt, s2_19.txt, s2_20.txt, s2_21.txt, s2_22.txt, s2_23.txt, s2_24.txt, s2_25.txt, s2_26.txt, s2_27.txt, s2_28.txt, s2_29.txt, s2_30.txt, s2_31.txt, s2_32.txt
Case Name Status Exec Time Memory
00_example_01.txt WA 1 ms 256 KB
00_example_02.txt WA 1 ms 256 KB
00_example_03.txt WA 1 ms 256 KB
s1_01.txt WA 1 ms 256 KB
s1_02.txt WA 1 ms 256 KB
s1_03.txt RE 99 ms 256 KB
s1_04.txt WA 1 ms 256 KB
s1_05.txt WA 1 ms 256 KB
s1_06.txt RE 98 ms 256 KB
s1_07.txt WA 1 ms 256 KB
s1_08.txt RE 97 ms 256 KB
s1_09.txt WA 1 ms 256 KB
s1_10.txt RE 97 ms 256 KB
s1_11.txt WA 1 ms 256 KB
s1_12.txt RE 97 ms 256 KB
s1_13.txt WA 1 ms 256 KB
s1_14.txt RE 97 ms 256 KB
s1_15.txt RE 96 ms 256 KB
s1_16.txt RE 97 ms 256 KB
s1_17.txt RE 97 ms 256 KB
s2_01.txt RE 96 ms 256 KB
s2_02.txt RE 97 ms 256 KB
s2_03.txt RE 96 ms 256 KB
s2_04.txt RE 96 ms 256 KB
s2_05.txt RE 97 ms 256 KB
s2_06.txt RE 96 ms 256 KB
s2_07.txt RE 96 ms 256 KB
s2_08.txt RE 96 ms 256 KB
s2_09.txt RE 97 ms 256 KB
s2_10.txt RE 97 ms 256 KB
s2_11.txt RE 97 ms 256 KB
s2_12.txt RE 97 ms 256 KB
s2_13.txt RE 96 ms 256 KB
s2_14.txt RE 97 ms 256 KB
s2_15.txt RE 96 ms 256 KB
s2_16.txt RE 96 ms 256 KB
s2_17.txt RE 97 ms 256 KB
s2_18.txt RE 97 ms 256 KB
s2_19.txt RE 97 ms 256 KB
s2_20.txt RE 97 ms 256 KB
s2_21.txt RE 97 ms 256 KB
s2_22.txt RE 97 ms 256 KB
s2_23.txt RE 97 ms 256 KB
s2_24.txt RE 97 ms 256 KB
s2_25.txt RE 97 ms 256 KB
s2_26.txt RE 97 ms 256 KB
s2_27.txt RE 97 ms 256 KB
s2_28.txt RE 96 ms 256 KB
s2_29.txt RE 97 ms 256 KB
s2_30.txt RE 99 ms 256 KB
s2_31.txt RE 97 ms 256 KB
s2_32.txt RE 101 ms 256 KB