ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1402. Cocktails

Test 9 why.Help me !!! Give me test. This is,,,,
Posted by Hamdam 3 Oct 2007 18:03
import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
  public class misol
  {
   public static void main(String[]args)
    {
     Scanner sc=new Scanner(System.in);
      int n=sc.nextInt();
      BigInteger[] a=new BigInteger[22];
      BigInteger s=new BigInteger("1");
      a[0]=new BigInteger("1");
      a[1]=new BigInteger("1");
      for(int i=2;i<=n;i++)
      {
        s=s.multiply(new BigInteger(Integer.toString(i)));
        a[i]=s;
      }
    s=new BigInteger("0");
    if (n>2)
    {
        for (int i=0;i<=n-2;i++)
            s=s.add(a[n].divide(a[i]));

        System.out.println(s);
    }
    else
    {
    if(n==2){System.out.println("2");}
    }
  }
 }
Re: Test 9 why.Help me !!! Give me test. This is,,,,
Posted by Meni Packeou 16 Aug 2008 23:18
Salom Hamdam sani shu misol utgan  yili echisha uringan
akansan misol oson,lekin ozginaqiyin joyi bor 3 soat bari
shu misol ustidaman uzi oson ekan javob chiqsa sanga yaraman bollarga salom ayt.
Re: Test 9 why.Help me !!! Give me test. This is,,,,
Posted by Meni Packeou 16 Aug 2008 23:33
Hamdam koding hatosi shundaki 1<= n <= 21
n=1
Sani dasturing hech nima chiqarmaydi.
Shuni uchun
if(n==1)System.out.println("0");
qo'ysang AC olasan.
H'op bo'pdi yozib tur man 6-kun,bozor kuni internetdaman