Contest Duration: ~ (local time) (110 minutes) Back to Home

Submission #825630

Source Code Expand

Copy
```#include<bits/stdc++.h>

using namespace std;

int main()
{
int N, L, A[100000];

cin >> N >> L;
for(int i = 0; i < N; i++) {
cin >> A[i];
}

int head = 0, tail = N - 1;
long long all = accumulate(A, A + N, 0LL);

vector< int > step;
while(head != tail && all >= L) {
} else {
all -= A[tail];
tail--;
step.push_back(tail);
}
}
step.clear();
all = accumulate(A, A + N, 0LL);
head = 0, tail = N - 1;
while(head != tail && all >= L) {
} else {
all -= A[tail];
tail--;
step.push_back(tail);
}
}
}

cout << "Possible" << endl;
for(int k : step) {
cout << k + 1 << endl;
}
} else {
cout << "Impossible" << endl;
}
}```

#### Submission Info

Submission Time 2016-07-31 21:30:40+0900 C - Knot Puzzle ei13333 C++14 (GCC 5.4.1) 0 1029 Byte WA 801 ms 1784 KB

#### Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt
All 0 / 500 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt
Case Name Status Exec Time Memory
0_00.txt 4 ms 256 KB
0_01.txt 4 ms 256 KB
0_02.txt 4 ms 256 KB
1_00.txt 4 ms 256 KB
1_01.txt 4 ms 256 KB
1_02.txt 612 ms 1656 KB
1_03.txt 33 ms 1276 KB
1_04.txt 611 ms 1656 KB
1_05.txt 34 ms 1276 KB
1_06.txt 752 ms 1656 KB
1_07.txt 34 ms 1276 KB
1_08.txt 619 ms 1656 KB
1_09.txt 34 ms 1276 KB
1_10.txt 682 ms 1784 KB
1_11.txt 34 ms 1276 KB
1_12.txt 801 ms 1656 KB
1_13.txt 77 ms 1276 KB
1_14.txt 800 ms 1656 KB
1_15.txt 4 ms 256 KB
1_16.txt 4 ms 256 KB
1_17.txt 75 ms 1276 KB
1_18.txt 74 ms 1276 KB
1_19.txt 77 ms 1276 KB
1_20.txt 70 ms 1276 KB
1_21.txt 75 ms 1276 KB
1_22.txt 73 ms 1276 KB
1_23.txt 72 ms 1276 KB
1_24.txt 69 ms 1276 KB
1_25.txt 74 ms 1276 KB
1_26.txt 71 ms 1276 KB
1_27.txt 634 ms 1656 KB
1_28.txt 658 ms 1656 KB
1_29.txt 689 ms 1656 KB
1_30.txt 765 ms 1656 KB
1_31.txt 606 ms 1656 KB