Show all threads Hide all threads Show all messages Hide all messages |
Test Cases Here :-) | Varun Sharma | 1049. Brave Balloonists | 22 Feb 2023 12:09 | 8 |
10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 Ans:- 1681 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 Ans:- 1271 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Ans:- 12870 You are very stupid!!! 0<ans<9 Don't repeat my mistake and remember that you must calculate prime numbers up to 10000 (not to 100!). Maybe this test will help you: 9797 1 1 1 1 1 1 1 1 1 Answer = 4 (9797 = 97 * 101) Sorry for my English :) Edited by author 04.04.2010 19:55 oh!!! thank you very much, i just calculate to sqrt(10000)... if you have WA in test4, you can try this. oh!!! thank you very much, i just calculate to sqrt(10000)... if you have WA in test4, you can try this. I just got accepted. It is enough to calc prime nums up to Num div 2. Because if Num not divided on any prime <= than Num div 2 then Num itself is a prime num. Edited by author 22.02.2023 12:10ilyas: Please don't call people stupid. Everyone makes mistakes; the author simply forgot to calculate modulo 10. Thanks for tests, I join. Input: 1 1 1 1 1 1 1 1 1 1 Output: 1 Input: 43 5 49 2 3 5 3 4 5 5 Output: 0 Input: 10000 10000 12 10000 10000 10000 13 10000 10000 29 Output: 2 Input: 99 101 102 103 104 105 106 107 108 109 Output: 6 My program passes all these test cases... Still I am getting wrong answer at 6th test. |
Difficulty is overrated | 👾_challenger128_[PermSU] | 1049. Brave Balloonists | 13 Sep 2021 20:50 | 3 |
Hint: you should only know fundamental theorem of arithmetic It's easy if you know that number of divisors is (n_1+1)*(n_2+1)*...*(n_k+1), where n_i is power of prime that is included in number decomposition |
WA #1 | jiyujie | 1049. Brave Balloonists | 26 Jul 2019 21:38 | 3 |
WA #1 jiyujie 25 Apr 2012 13:57 i really don't understand why i got WA #1...i try a lot of tests and i always have the right answer, could anyone give me test 1, please, thx~ Edited by author 26.04.2012 11:47 Edited by author 26.04.2012 11:48 #include<bits/stdc++.h> using namespace std; int main(){ long long a[10],l,s,z=1,q,f; vector<long long>v; vector<long long>p; bool prime[10000]; memset(prime,true,sizeof(prime)); for(int i=2;i<=10000;i++){ if(prime[i]){ for(int j=i*2;j<=10000;j=j+i){ prime[j]=false; } } } for(int i=2;i<=10000;i++){ if(prime[i]){ v.push_back(i); } } q=v.size(); f=v[q-1]; for(int i=2;i<=f;i++){ p.push_back(0); } for(int j=0;j<10;j++){ cin>>a[j]; } for(int i=0;i<10;i++){ l=0,s=0; while(a[i]>=v[l]){ if(a[i]%v[l]==0){ //cout<<a[i]<<" "<<v[l]<<endl; p[v[l]]++; a[i]=a[i]/v[l]; } else{ l++; } } } for(int i=0;i<=p.size();i++){ z=(z*(p[i]+1))%10000; } z=z%10; cout<<z; return 0; } |
Very Useful Advice | SergeyGlazkov [SPbPU] | 1049. Brave Balloonists | 1 Mar 2018 20:46 | 1 |
Before sending your solution try this test on your pc and make sure that pc can calculate it faster than 10 hours :)) 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 1 |
WA#12 | Kirishima Touka | 1049. Brave Balloonists | 10 Dec 2017 09:03 | 1 |
WA#12 Kirishima Touka 10 Dec 2017 09:03 I really don't understand why i got WA #12...i try a lot of tests and i always have the right answer, could anyone give me test 12, please. |
Time limit excedeed test 9 python | Mark_Komissarov | 1049. Brave Balloonists | 14 Nov 2017 13:54 | 1 |
What's wrong? I have 'time limit excedeed' in 9th test. import functools def pr(n): result = [] i = 2 now = 1 while n >= 1: if n % i == 0: now *= i n //= i elif n % i != 0 and now > 1: result.append(now) i += 1 now = 1 else: i += 1 if n == 1: result.append(now) return result def f(n): result = 0 i = 1 while i ** 2 < n: if n % i == 0: result += 1 i += 1 if i ** 2 == n: return 2 * result + 1 else: return 2 * result newList = [int(input()) for _ in range(10)] product = functools.reduce((lambda x, y: x * y), newList) print(functools.reduce(lambda x, y: x * y, map(f, pr(product))) % 10) |
Brave Ballons | Niveditha | 1049. Brave Balloonists | 7 Oct 2016 20:50 | 2 |
import java.util.*; public class BallonNumber { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int a[]=new int[10]; int count=0; int prod=1,i; for(i=0;i<10;i++) { a[i]=sc.nextInt(); } for(i=0;i<10;i++) { prod=prod*a[i]; } //System.out.println(prod); for(i=1;i<=prod;i++) { if (prod%i==0) { count+=1;
} } System.out.println(count); } } So this is my code but it says wrong answer but I get the same answer in ide.What is wrong with this code Please estimate max value of prod. Then compare it with int capacity. |
why my code got WA #2 ? | vladimir | 1049. Brave Balloonists | 15 Feb 2015 23:30 | 2 |
var podschet,a,b,i:integer; begin a:=1; for i:=1 to 10 do begin readln(b); a:=a*b; end; for i:=1 to a do begin if a mod i=0 then podschet:=podschet+1; end; if podschet>9 then podschet:=podschet div 10; writeln(podschet); end. Edited by author 11.12.2014 15:46 Mistake is in this line: if podschet>9 then podschet:=podschet div 10; To take last digit you should be using mod instead of div. Edited by author 15.02.2015 23:31 Edited by author 15.02.2015 23:31 |
Some tips about this problem. | ElPsyCongroo | 1049. Brave Balloonists | 22 Jun 2014 15:41 | 1 |
1.You only need to identify the number of divisors. So, follow this: http://mathschallenge.net/library/number/number_of_divisors 2.Getting the product and then getting the number of divisors is going to take a LOT of time than getting the number of each of the 10 divisors. -> This is an important trick. All the best. ElPsyCongroo. |
cool idea!! | ivan145 | 1049. Brave Balloonists | 23 Feb 2013 19:34 | 2 |
decomposed into prime factors, and then submit to the canonical form then you will get AC!!! It is a good idea! I used the same method! |
I don't know what is the problem | Diego Alfonso Prieto Torres | 1049. Brave Balloonists | 9 Nov 2012 06:27 | 1 |
somebody know what is the test 3, I don't know what problem I have in my code; here is it #include <stdlib.h> #include <stdio.h> int main(){ int desicion[10]; int exponentes[1000]={0}; int i,j,valor=1; int numeroDivisores=1; int valorIteracion; int impresion; for(i=0;i<10;i++){ scanf("%i",&desicion[i]); valor*=desicion[i]; } i=2; j=0; while(valor!=1){ if(valor%i==0){ exponentes[j]++; valor=valor/i; }else{ i++; numeroDivisores=numeroDivisores*(exponentes[j]+1); j++; } } numeroDivisores=numeroDivisores*(exponentes[j]+1); numeroDivisores%=10; printf("%i\n",numeroDivisores); } |
wich is the test 3 | daynier | 1049. Brave Balloonists | 11 Sep 2012 01:12 | 1 |
|
what is the crash error?please help me | Milad | 1049. Brave Balloonists | 7 Sep 2012 16:26 | 1 |
this is my code so what is the crash error # include <iostream> # include <vector> using namespace std; const int maxN=10000+10; int p[maxN],t[maxN]; vector <int> v; int main () { int n,sum=1;
for (int i=2;i<=maxN;i++) for (int j=2*i;j<=maxN;j+=i) p[j]=1; for (int j=1;j<=10;j++) { cin>>n; for (int i=2;i<=n;i++) { int len = n; while (len>1 && !p[i] && len%i==0) { len/=i; v.push_back(i); } } }
for (int i=0;i<v.size();i++) t[v[i]]++; for (int i=2;i<maxN;i++) if (t[i]>0) { t[i]++; sum*=t[i]; sum%=10; } cout<<sum%10; //cin>>n; return 0; } |
WA#1 But i test it myself and it works!! TwT | makeshiftching | 1049. Brave Balloonists | 2 May 2012 18:37 | 1 |
#include<stdio.h> int arr[11]; int num = 1; int prime[10000]; int ans = 1; int main() { for( int j = 0 ; j< 10 ; j++ ) { scanf("%d",&arr[j]); if( arr[j] == 1 ) { continue; } for( int i = 2 ; i <= arr[j] ; i++ ) { while( arr[j] % i == 0 ) { prime[i]++; arr[j] = arr[j] /i; if( arr[j] == 1 ) { break; } } } }
for( int i = 2 ; i < 10001 ; i++ ) { ans *= (prime[i]+1) % 10 ; } ans = ans % 10; printf("%d\n",ans); //scanf("%d",&prime[0]); return 0; } |
WA on #1 ....Dont know why... Provide me #1 plz... | sourav_sust_10 | 1049. Brave Balloonists | 16 Feb 2012 02:50 | 1 |
here is my Code.. Removed After Getting AC Edited by author 20.02.2012 19:34 |
What is the test4 | Веселый Mальчик | 1049. Brave Balloonists | 26 Jan 2012 23:46 | 2 |
I think my code faster But only 4th test Is it? 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 And what will be correct answer this one? Thanks 10000 = 10^4=2^4*5^4 so 10000^10=2^40*5*40 so answer is 41*41 % 10 = 1 and what's test n#2 ??? |
WA on 4 | Pumar | 1049. Brave Balloonists | 2 Jan 2012 00:53 | 2 |
Can someone please say why the hell is it wrong?:( #include<iostream> using namespace std; int main() { const int size=10; int pro[10]={0}; long long int magic=1; int licz=2; const int n=10000; bool numbersTable[n+1]={0}; int pierw[1229]; int w=0; //sito
for (int i = 2; i <= n; i++ ) { if (numbersTable[i] == true) continue; pierw[w++]=i; for (int j = 2 * i ; j <= n; j += i) numbersTable[j] = true; }
for(int i=0;i<size;i++) { cin>>pro[i]; magic*=pro[i]; }
int k=0; long long int z=0; licz=1; for(int i=0; i<1229; i++) {
if(magic/pierw[i]<1) break; k=0; z=magic; while(z%pierw[i]==0) {
z/=pierw[i]; k++; } licz*=(k+1);
} if (magic==1) licz=1;
cout << licz%10;
} Dear friend: Is not necessary multiply the input, working each a_i you can reduce the complexity |
How many lines of code your solution? | pkl | 1049. Brave Balloonists | 15 Oct 2011 19:28 | 2 |
I think, my solution is very tricky. It can be more simpler and smaller. How many lines of code your solution? |
Idea | TSU: Machvi | 1049. Brave Balloonists | 10 Jun 2011 21:40 | 3 |
Idea TSU: Machvi 29 Apr 2007 23:09 I've just figured out that if a==p1^k1*p2^k2*...*pn^kn(where p_i are prime numbers) then (k1+1)*(k2+1)*...*(kn+1) amount of numbers devide a; so you can use this idea in this problem. I think its too strong hint! |
AC 0.031s 132K using stl | waterlink | 1049. Brave Balloonists | 3 Feb 2011 14:31 | 1 |
[hidden code:)] Edited by author 03.02.2011 14:33 |