Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

RunTime Error in testcase 1
Author: Bahman
ID: 065553
Problem: 222
Contest: 0
Date: 2015-04-04 20:04:58

i keep getting runtime error in 1st test.can anyone help me understand why???

here is my code(in c):


#include<stdio.h>

int main(){
int i,n,k,h,nfact=1,hfact=1,kfact=1,fact=1;
scanf("%d",&n);
scanf("%d",&k);
if(k>n){
printf("%d",0);
return(0);
}
h=n-k;
for(i=1;i<n;i++){
fact*=i+1;
if (i+1==h)
hfact=fact;
if (i+1==k)
kfact=fact;
if (i+1==n)
nfact=fact;
}
printf("%dn",(nfact*nfact)/(hfact*hfact*kfact));
return(1);
}

see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-11-23 06:28:54Online Contester Team © 2002 - 2016. All rights reserved.