|
|
Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | Hint about complexity | theAyconic1 | 1935. Слёзы утопленников | 16 авг 2023 19:06 | 1 | | what is wrong with the solution??? С++ | abram fedor | 1935. Слёзы утопленников | 25 мар 2022 06:29 | 1 | #include <iostream> using namespace std; int main() { int n,c; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++) if(a[i]<a[j]){c=a[i];a[i]=a[j];a[j]=c;} } c=a[n-1]; for(int i=0;i<n;i++) c=c+a[i]; cout<<c; return 0; } Edited by author 25.03.2022 06:30 | WA #5 why?? | Aguero | 1935. Слёзы утопленников | 14 апр 2020 10:54 | 6 | give me this test please.. 6 1 3 2 5 4 6 Answer: 27 May be this is not 5th test, but if you can solve this, you'll understand what's wrong in your current solving. :-) Can you explain it to me, how you get 27? | HINT | Alibi | 1935. Слёзы утопленников | 11 сен 2016 12:56 | 3 | HINT Alibi 27 дек 2014 09:39 Just sort it, before your solution. You can not use sort: ans=a1+...+an+max{a1,..,an} | Easy 5 second AC | IlushaMax | 1935. Слёзы утопленников | 23 апр 2016 00:39 | 1 | | Test Case | ROHAN GULATI | 1935. Слёзы утопленников | 5 ноя 2015 17:23 | 15 | What is the answer for the test case 6 1 3 2 5 4 6 Mine is also 29 I m getting WA#5 with my code Do u have any clue what is test case 5? What's 5 test? Give me this test, please. Edited by author 10.11.2012 14:59 Can we replace places of the bats 27. You can replace the bat. What's 11 test? Give me this test, please. Edited by author 24.04.2013 22:50 | Hint | Vetriti | 1935. Слёзы утопленников | 10 янв 2014 20:58 | 3 | Hint Vetriti 14 фев 2013 22:59 Simple try to find the biggest and double it, then find the sum. Good luck. Edited by author 14.02.2013 22:59 Re: Hint Thousbe[SamSU] 11 авг 2013 13:00 What is the logic of this decision? The smallest number of pages is needed if we put skins in the sorted order. Thus the total is the sum plus the largest. | I don't understand the problem‘s meaning,just ac it by guessing ! | kaa..........ai | 1935. Слёзы утопленников | 25 июн 2013 18:06 | 1 | |
|
|
|