Search found 9 matches

by seraph
Fri Sep 17, 2010 6:13 pm
Forum: Volume 108 (10800-10899)
Topic: 10810 - Ultra-QuickSort
Replies: 36
Views: 25861

Re: 10810 - Ultra-QuickSort

why i got WA in my code ? #include <iostream> #include <vector> #include <algorithm> using namespace std; static long long sw,n; static long long v[500001]; void gabung(int p,int q,int r) { long long n1 = q-p+1; long long n2 = r-q; long long i,j; long long L[n1+1], R[n2+1]; for (i=0;i<n1;i++) L[i]=v...
by seraph
Sat Jun 26, 2010 6:43 am
Forum: Volume 105 (10500-10599)
Topic: 10509 - R U Kidding Mr. Feynman?
Replies: 41
Views: 18280

Re: 10509 - R U Kidding Mr. Feynman?

actually, you just missing enter after you print the output
try this for the output :

Code: Select all

printf("%.4lf\n",res);
and you will get AC :lol: :lol:
by seraph
Thu Jan 21, 2010 3:51 pm
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 27195

Re: 11321 - Sort! Sort!! and Sort!!!

finally, i got AC... i just use bool cmp(data a, data b) { if (a.mod==b.mod) if (a.stat==b.stat) if (a.stat==1) return a.angka > b.angka; else return a.angka < b.angka; return a.stat < b.stat; return a.mod < b.mod; } and sort(v.begin(),v.end(),cmp); :lol: :lol: :lol: :lol: :lol:
by seraph
Wed Jan 20, 2010 3:39 pm
Forum: Volume 106 (10600-10699)
Topic: 10635 - Prince and Princess
Replies: 29
Views: 18652

Re: 10635 - Prince and Princess

why my code is always RE ? this is my code : #include <iostream> #include <vector> using namespace std; int main() { int arr1[100000],arr2[100000]; vector<int> v,v1,v2; int t; cin>>t; for (int i=0;i<t;i++) { int n,a,b,temp; cin>>n>>a>>b; v.clear(); v1.clear(); v2.clear(); a++;b++; memset(arr1,0,size...
by seraph
Tue Jan 19, 2010 7:49 am
Forum: Volume 8 (800-899)
Topic: 847 - A Multiplication Game
Replies: 41
Views: 26166

Re: 847 - A Multiplication Game

@ eric :
i know where is your mistake.

1. you should delete this line :

Code: Select all

if (n>55009980288) cout << "Ollie Wins." <<endl; else
2. The word 'Wins' in 'Stan Wins' and 'Ollie Wins' its should change to 'Stan wins' and 'Ollie wins'..
:lol: :lol: :lol: :lol: :lol:
by seraph
Wed Jan 13, 2010 5:42 pm
Forum: Volume 8 (800-899)
Topic: 884 - Factorial Factors
Replies: 49
Views: 33723

Re: 884 - Factorial Factors

where is my mistake in this program? i always got TLE #include <iostream> #include <vector> using namespace std; int arr[1000001]={0}; vector<int> v; int main() { bool prime[1000001]={0}; prime[0]=1; prime[1]=1; for (int i=2;i<=1000000;i++) { if (prime[i]==0) { v.push_back(i); int temp=i+i; while (t...
by seraph
Sat Jan 09, 2010 5:43 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 46015

Re: 147 __int64 can't hold big results.Please help

i know why your code is WA :
your code

Code: Select all

printf("%6.2f%17llu\n", input, ways[ans]);
should :

Code: Select all

printf("%6.2f%17llu\n", input[b]+eps[/b], ways[ans]);
only thats, n you will AC :D :D :D
by seraph
Tue Jan 05, 2010 3:40 pm
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 65084

Re: 623 - 500!

Pliss help me... i always runtime error with my code, this is my code : #include <iostream> #include <math.h> using namespace std; int main() { double x[1010]; x[1] = x[0] = 0; for(int i=2;i<=1009;i++) x[i] = x[i-1] + log10(i); int n; int *fact[1010]; n=1009; { int hasil1[2600]={0}; int hasil2[2600]...
by seraph
Tue Dec 15, 2009 4:46 pm
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 36663

Re: 10110 - Light, More Light

you can use floor and ceil function to solve this problem.

i just use :

if (floor(sqrt(n))==ceil(sqrt(n)))
cout<<"yes"<<endl;
else
cout<<"no"<<endl;

and i accepted...
:D :D :D

Go to advanced search