Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

参考样例

Posted by ACM_Hohai at 2011-10-16 15:00:02 on Problem 1455
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int n,s;
    int pre,sufix;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d",&s);
        pre=(s>>1);
        sufix=s-pre;
        printf("%d\n",(pre*(pre-1)+sufix*(sufix-1))/2);
    }
    system("pause");
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator