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

sandro, plzzz look on test 1 from the example, i think it is 135 + 19(18.25) * 1 = 154 not 155 :p
Posted by alexutz_mircescu 5 Nov 2007 17:22
:) thank you

Edited by author 05.11.2007 17:26
Re: sandro, plzzz look on test 1 from the example, i think it is 135 + 19(18.25) * 1 = 154 not 155 :p
Posted by alexutz_mircescu 5 Nov 2007 17:46
ok?

Edited by author 05.11.2007 18:09
Re: sandro, plzzz look on test 1 from the example, i think it is 135 + 19(18.25) * 1 = 154 not 155 :p
Posted by alexutz_mircescu 5 Nov 2007 18:11
for this i have WA1 plzz help me :((
Both examples and all the tests are correct. Read the statement more carefully.
Posted by Sandro (USU) 6 Nov 2007 00:01
"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).
Re: Both examples and all the tests are correct. Read the statement more carefully.
Posted by alexutz_mircescu 6 Nov 2007 21:40
Thank you very much... :D thank you...
Re: Both examples and all the tests are correct. Read the statement more carefully.
Posted by alexutz_mircescu 6 Nov 2007 22:05
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
Re: Both examples and all the tests are correct. Read the statement more carefully.
Posted by alexutz_mircescu 11 Nov 2007 01:16
thank you?!