Show all threads Hide all threads Show all messages Hide all messages |
hint | So Sui Ming | 1917. Titan Ruins: Deadly Accuracy | 5 Jan 2024 09:38 | 1 |
hint So Sui Ming 5 Jan 2024 09:38 Use cumulative count of sorted values. int64_t is not needed (e.g.WA3). |
W21 - test case | android_ | 1917. Titan Ruins: Deadly Accuracy | 22 Jan 2020 23:16 | 4 |
Hello My solution failed on test 21. Passed next cases: 5 5 2 2 2 3 4 0 0 5 4 4 1 4 1 2 3 2 5 4 2 2 1 1 1 5 2 5 7 4 1 4 1 2 3 1 10 18 2 2 2 2 2 2 2 2 2 2 0 0 If you have any idea please let me know. Thank you Edited by author 21.08.2015 10:49 5 8 2 2 2 1 2 5 2 Edited by author 24.08.2019 14:48 I passed all those tests, but have WA2 :D |
Please help, i don't understand conditions | yarmet | 1917. Titan Ruins: Deadly Accuracy | 31 Mar 2018 20:01 | 2 |
Hi. Can anyone help me? 5 4 4 1 4 1 2 Why answer 3 2 ?? why it isn't 3 1? i can cast power = 2, then i'll destroy three coin (1, 1, 2) which is equal to 4, and i can survive. But i can't cast with power 4, because then i take (4,4) = 8 damage.
Edited by author 31.03.2018 04:18 Edited by author 31.03.2018 04:18 Edited by author 31.03.2018 04:20 >If we destroy k coins, the response will be k times stronger than our spell This means, if we destroy 3 coins (1, 1, 2) with power 2, we'll take 3*2=6 damage. |
If you have WA3, test | KOTMAKRUS [SPbPU] | 1917. Titan Ruins: Deadly Accuracy | 13 Feb 2016 00:31 | 1 |
test 1002 1000000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1 2 answer 1002 2 Edited by author 13.02.2016 00:31 |
WA #43 | TinyJanssen | 1917. Titan Ruins: Deadly Accuracy | 22 Nov 2014 08:05 | 3 |
WA #43 TinyJanssen 9 Mar 2013 22:07 What could test 43 be? If the spell distroys 0 coins, is the minimum amount of spells also 0? Or is it 1? The amount of spells has to be 0 too. Problem #43 is the 0 0 case, but I didn't set my counters to 0 0 the right way. Not very smart. This case helped me 10 18 2 2 2 2 2 2 2 2 2 2 Thank you. This test case really helped me~ |
Test 22 Time limit exceeded! I need help | Egor14 | 1917. Titan Ruins: Deadly Accuracy | 24 Oct 2014 00:23 | 1 |
Hi! I have time limit exceeded in test 22. What's wrong with my code? What is the best approach for this task? Maybe use stack? Thanks; My code: #include <iostream> #include <vector> #include <algorithm> using namespace std; //Get all possible spell power variants vector<int> GetVariants(vector<int> vct) { vector<int> answ; for(unsigned int i=0;i<vct.size();i++) { if(find(answ.begin(),answ.end(),vct[i])==answ.end()) answ.push_back(vct[i]); } sort(answ.begin(), answ.begin()+answ.size()); reverse(answ.begin(),answ.end()); return answ; } //Get number or values, in vct which <= num (here it is destructable coins) int GetNumberOfLowerOrEqual(vector<int> vct,int num) { int number = 0; for(unsigned int i=0;i<vct.size();i++) { if(vct[i]<=num)number++; } return number; } int main() { int n,p,curr; scanf("%d",&n);//initial size of coins vector scanf("%d",&p);// health vector<int> coins; vector<int> variants; int deleted = 0; int spells = 0; for(int i=0;i<n;i++) { scanf("%d",&curr); coins.push_back(curr); } variants = GetVariants(coins); bool dChanged = false;
for(int times = 0; times<n && !coins.empty();times++) { for(int i=0;i<variants.size() && !coins.empty();i++) { if(GetNumberOfLowerOrEqual(coins,variants[i])*variants[i]<=p)//surrvived { dChanged = false; //here we remove all elements from coins, which <= variants[i] for(int t=0;t<coins.size();t++) { if(coins[t] <= variants[i]) { coins.erase(coins.begin()+t); t--; deleted++; dChanged = true; } } if(dChanged) { spells++;//if anything changed, add spell break; } } } } printf("%d ", deleted); printf("%d",spells); //system("pause"); return 0; } |
Help me !wa3 | almost | 1917. Titan Ruins: Deadly Accuracy | 20 Oct 2014 12:06 | 1 |
I have tried many tests but I didn't find what's wrong.Please give me some test!!!!! |
Help, WA20 | [RISE] Binary Mind [RAU] | 1917. Titan Ruins: Deadly Accuracy | 25 Jul 2014 13:08 | 4 |
Help, WA20 [RISE] Binary Mind [RAU] 25 Jul 2014 13:02 Edited by author 25.07.2014 13:04 |
For whom, who get WA 21 and more | Gleb_Kazantaev(NNSTU) | 1917. Titan Ruins: Deadly Accuracy | 18 Jul 2014 17:12 | 1 |
Try this test: 5 5 2 2 2 3 4 answer: 0 0 |
test #3 | yarmet | 1917. Titan Ruins: Deadly Accuracy | 18 May 2014 17:52 | 1 |
кто-нибудь знает какой 3 ий тест ? Уже 7ой раз на нем фейлится, long'и использую. Edited by author 18.05.2014 18:13 Edited by author 18.05.2014 18:13 |
Error in sample | Darwin's Grove | 1917. Titan Ruins: Deadly Accuracy | 10 May 2014 20:01 | 2 |
Sample 5 4 4 1 4 1 2 Why answer is 3 2 but not 3 1 ? 2*1+1*2 <= 4 (p = 4, p — максимальная сила всплеска, которую маги ещё могут пережить, пережить тоесть включно) ??? To kill the weakest 3 coins with one spell it would have to have spell power 2, which means you get 3*2 = 6 > 4 damage reflected. |
H | SPb SU Taken: Demidov, Korystov | 1917. Titan Ruins: Deadly Accuracy | 14 Jan 2014 09:37 | 7 |
H SPb SU Taken: Demidov, Korystov 20 Oct 2012 14:04 p - это суммарная сила всплеска по всем заклинаниям, которую могут выдержать волшебники, или максимальная сила всплеска за одно заклинание (каждый раз одна и та же)? Re: H iLko 20 Oct 2012 14:29 Re: H UEY 20 Oct 2012 16:18 Re: H Barsuk Alexey [Pskov SPI Ignorami] 21 Oct 2012 14:13 Maybe in 22 test : you can survive if [count_destroyable_coins] * [power_spell] <= [you_health]. Check your code : "<=" , not "<". Good Luck. Re: H Kashmir 7 Aug 2013 09:05 I don't understand. So why in the test case the coins with value 4 are not killed? What am I missing? Re: H Nguyen Trung Hieu 14 Jan 2014 09:37 If you use spell power 4 you will destroy two coins, so the strikes back will be 2 * 4 = 8 and you can't survive Re: H Bogatyr 20 Oct 2012 18:38 The question was: is the survival limit an accumulation of all previous spells, or is it just per spell? |
WA #21 | bladeandsoul | 1917. Titan Ruins: Deadly Accuracy | 11 Jul 2013 12:53 | 1 |
WA #21 bladeandsoul 11 Jul 2013 12:53 what is it? plz // Deadly Accuracy.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <algorithm> using namespace std; int n=0,p=0; int counter[1000001]={0}; int main() { cin>>n>>p; int a=0; int maxCoins=0; int timeOfAttack=0;
for (int i=0;i<n;i++){ cin>>a; counter[a]++; }
int tempR=0; int tempCoin=0; for (int i=1;i<=p && i<=1000000;i++) { if (i*counter[i]<=p && counter[i]!=0) {
if (i*(tempCoin+counter[i])>p) { if (tempR<=p && tempCoin!=0 &&tempR !=0){ timeOfAttack++; maxCoins+=tempCoin; } tempCoin=counter[i];
} else tempCoin+=counter[i]; tempR=i*tempCoin; } } if (tempR<=p && tempCoin!=0 &&tempR !=0) { timeOfAttack++; maxCoins+=tempCoin; }
cout<<maxCoins<<' '<<timeOfAttack<<endl; cin>>a; return 0; } |
WA #22 | Rapheal Chen | 1917. Titan Ruins: Deadly Accuracy | 23 Apr 2013 03:08 | 2 |
WA #22 Rapheal Chen 10 Mar 2013 08:41 what is test 22? i wa 22 what's wrong? #include<stdio.h> #include<string.h> int n,p,a[1000010],min=1000000,max=0,sum=0,ans=0; int main() { int i,x,j,k; memset(a,0,sizeof(a)); scanf("%d%d",&n,&p); for(i=1; i<=n; i++) { scanf("%d",&x); a[x]++; if(x<min) min=x; if(x>max) max=x; } for(i=min; i<=max; i++) if(a[i]!=0) { if(a[i]*i>=p) break; sum+=a[i]; ans++; } for(k=min; k<i; k++) if(a[k]!=0){ for(j=k+1; j<i; j++) if(a[j]!=0) break; if(a[j]==0) break; if(j*(a[k]+a[j])<p) { ans--; a[j]+=a[k]; a[k]=0; } } printf("%d %d\n",sum,ans); return 0; } Edited by author 10.03.2013 08:41 呃…… Edited by author 10.03.2013 08:48 Edited by author 10.03.2013 08:48 you can cast a spell with power of p |
Russian translation. | Tolstobrov Anatoliy[Ivanovo SPU] | 1917. Titan Ruins: Deadly Accuracy | 31 Jan 2013 12:36 | 1 |
Incorrect: "которую могут маги ещё могут пережить" Correct: "которую маги ещё могут пережить" |
tianma201211@gmail.com (I need anwer) | Pegasus | 1917. Titan Ruins: Deadly Accuracy | 28 Nov 2012 19:06 | 1 |
|
what's test2 ? | SODIQJOHN | 1917. Titan Ruins: Deadly Accuracy | 23 Nov 2012 21:36 | 8 |
It helped me: 5 4 2 2 1 1 1 answer: 5 2 EDITED - NEVER mind - I think I understand Edited by author 07.11.2012 09:58 Edited by author 07.11.2012 09:58 Becase 1 spell of strength 2 eliminates 3 coins (1, 1, 2) The (4,4) can never be eliminated because it causes a bounce back of 8, and 7 is the survival limit |
Need help wa#2 | Pegasus | 1917. Titan Ruins: Deadly Accuracy | 23 Nov 2012 21:02 | 1 |
I want some tips or tests |
WTF! | LyanA | 1917. Titan Ruins: Deadly Accuracy | 19 Nov 2012 22:12 | 3 |
WTF! LyanA 19 Nov 2012 21:34 Ouch. Input limits? Make sure variable types can hold the required range of values? solved. It's 0 0 cases thank u for attention Edited by author 19.11.2012 22:12 Edited by author 19.11.2012 22:13 |
test 4? | LyanA | 1917. Titan Ruins: Deadly Accuracy | 26 Oct 2012 23:51 | 1 |
Could you give me test 4? |