|
|
Show all threads Hide all threads Show all messages Hide all messages | If you have WA#24 | Dmitrii | 1901. Space Elevators | 25 Jun 2023 22:18 | 1 | Try this test: 9 6 2 3 2 5 3 4 1 6 1 Answer: 8 1 6 1 2 2 5 3 4 3 | linkedlist gives wa21, arraylist takes 0.2s for AC | esbybb | 1901. Space Elevators | 5 Jun 2016 04:55 | 1 | sort, read from head and tail\ if head+tail>maximum -> add head,tail to the answers (in front),\ otherwise, add head to answers (to the back)\ wow! interesting observation though | I've got WA #7. Can someone give me test #7 please??? | esekkelle | 1901. Space Elevators | 22 Mar 2016 22:42 | 3 | Had the same problem at the beginning, but finally solved it. Good test that helped me to find a bug in my algorithm was: 3 6 2 1 5 When the solution is: 2 (not 3) 2 5 1 Edited by author 24.03.2014 16:32 Edited by author 24.03.2014 16:33 Why two? need to output the maximum amount of trips of the elevator. I dont understand it. | WA #8 | Snayde | 1901. Space Elevators | 28 Oct 2014 13:23 | 3 | WA #8 Snayde 7 May 2013 13:56 Try this: 6 15 6 10 6 9 7 1 I think your answer is: 4 6 10 6 9 7 1 But answer like: 5 6 10 7 9 6 1 Re: WA #8 quick(YaroslavlSU) 28 Oct 2014 13:23 5 22 8 15 6 6 14 answer 4 8 15 14 6 6 | Easy ~ | [RISE] Levon Oganesyan [RAU] | 1901. Space Elevators | 10 Jul 2014 03:46 | 1 | Easy ~ [RISE] Levon Oganesyan [RAU] 10 Jul 2014 03:46 The answer of simple test not one, right this answer too: 6 6 1 2 3 3 4 5 5 2 5 3 4 3 1 It's hepled me. Sorry, for bad English. Some tests: 6 6 1 2 3 4 5 6 6 1 6 2 5 3 4 6 3 1 2 3 2 1 1 5 1 3 2 2 1 1 10 10 6 3 4 5 2 10 10 5 4 1 8 1 10 2 10 5 6 5 4 4 3 1 6 6 1 6 2 3 3 3 2 3 3 3 3 2 2 1 2 2 2 1 3 3 2 3 2 3 2 3 2 3 3 2 2 3 3 2 3 2 3 3 1 1 3 3 1 3 1 6 6 5 5 5 1 1 1 4 5 5 5 1 1 1 6 7 6 6 6 2 2 2 6 2 6 2 6 2 6 6 8 6 6 6 2 2 2 4 6 6 6 2 2 2 Edited by author 10.07.2014 03:47 | Give me some tests please | NUUZ_1 | 1901. Space Elevators | 13 Oct 2012 20:54 | 1 | | Wrong Answer :( | Udit Agarwal | 1901. Space Elevators | 13 Oct 2012 20:41 | 1 | Please some body tell me why i am gettig wrong answer in this. My code is: #include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <cstring> #include <string.h> #include <cstdlib> #include <sstream> #include <stack> #include <queue> #include <numeric> #include <utility> #include <cctype> #include <list> #include <climits> #include <signal.h> #include <ctime> #include <map> #include <set> using namespace std; #define ll long long int ll i, j, k, ct=0, m, n, t, x, y, z, tc, a[200000],s; vector<ll> ans; int main(){ cin >> n >> s; for(i = 0; i < n; i++){ cin >> a[i]; } sort(a,a+n); for ( i = n-1; i > 0 ; i-- ) { if ( a[i] + a[i-1] <= s ) { break; } } // cout << x << " " << y << endl; if(s%2==0){ x = i+1; y = i; //z = n-1; while ( x < n && y >= 0 ) { ans.push_back( a[y] ); ans.push_back( a[x] ); x++; y--; } while ( x < n ) { ans.push_back( a[x] ); x++; } while ( y >= 0 ) { ans.push_back( a[y] ); y--; } } else { y = i; while ( i < n && a[i] == a[y]){ ans.push_back( a[i] ); i++; } y--; x = i; while ( x < n && y >= 0 ) { ans.push_back( a[x] ); ans.push_back( a[y] ); x++; y--; } while ( x < n ) { ans.push_back( a[x] ); x++; } while ( y >= 0 ) { ans.push_back( a[y] ); y--; } } ct = 0; for ( i = 0; i < ans.size(); ) { if( i == ans.size() - 1){ ct++; i++; } else{ if( ans[i] + ans[i+1] <= s){ ct++; i+=2; } else{ ct++; i++; } } } cout << ct << endl; for ( i = 0; i < ans.size(); i++) { cout << ans[i] << " "; } return 0; } Edited by author 13.10.2012 20:42 |
|
|
|