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

Re:按都不懂乃们为什么要分类,贴

Posted by Dumpling at 2013-02-11 00:40:46 on Problem 2586
In Reply To:贴个简单代码 Posted by:GreatAccepted at 2010-01-25 16:54:07
    while (scanf("%lld%lld", &s, &d) != EOF) {
        cs = 5, cd = 0;
        while (cs * s >= cd * d)
            --cs, ++cd;
        int64 ans = (cs * s - cd * d) * 2ll;
        ans += min(cs, 2ll) * s - max(2ll - cs, 0ll) * d;
        if (ans <= 0)
            printf("Deficit\n");
        else
            printf("%lld\n", ans);
    }

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