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