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 1576. Telephone Tariffs

:) thank you

Edited by author 05.11.2007 17:26
ok?

Edited by author 05.11.2007 18:09
for this i have WA1 plzz help me :((
"The number of minutes in a call is rounded up (i.e., a call with duration of 8:10 is charged the same as a call with duration of 9:00)". So the total time in the 1'st example is 1+10+7+2=20 minutes (the call that lasts 00:05 is ignored).
Thank you very much... :D thank you...
Now I get WA4 :((((((( can you look on my code(I will delete it otherwise):
#include <stdio.h>
#include <math.h>

long n1, c1, n2, t, c2, n3, nr, i, mnt, p1;
char s[16];

int main() {
    #ifndef ONLINE_JUDGE
    freopen("1576.in", "r", stdin);
    freopen("1576.out", "w", stdout);
    #endif
    scanf("%ld%ld", &n1, &c1);
    scanf("%ld%ld%ld", &n2, &t, &c2);
    scanf("%ld", &n3);
    scanf("%ld", &nr);
    for (i = 1;i <= nr; ++i) {
        scanf("%s", s);
        mnt =(((long)s[0] - '0') * 10 + ((long)s[1] - '0')) * 60 + ((long)s[3] - '0') * 10 + ((long)s[4] - '0');
        if (mnt > 6) {
            if (mnt % 60 != 0) {
                p1 = p1 + mnt / 60 + 1;
            } else {
                p1 = p1 + mnt / 60;
            }
        }
    }
    printf("Basic:     %ld\n", n1 + p1 * c1);
    printf("Combined:  %ld\n", (n2 + p1 - t) * c2);
    printf("Unlimited: %ld\n", n3);
    return 0;
}

Edited by author 06.11.2007 22:06

Edited by author 06.11.2007 22:07