# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480119 | rainboy | ACM (COCI19_acm) | C11 | 6 ms | 460 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <string.h>
#define N 1000
int main() {
static char cc[N][32];
static int aa[N], bb[N];
int n, m, i, j, a, b, cnt;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%s", cc[i]);
for (j = 0; j < m; j++) {
static char str[16];
int k, h, m, s;
scanf("%s", str);
if (str[0] == '-')
continue;
sscanf(str, "%*c%d/%d:%d:%d", &k, &h, &m, &s);
aa[i]++, bb[i] += k * 20 * 60 + (h * 60 + m) * 60 + s;
}
}
scanf("%*s");
a = b = 0;
for (j = 0; j < m; j++) {
static char str[16];
int k, h, m, s;
scanf("%s", str);
if (str[0] == '+') {
sscanf(str, "%*c%d/%d:%d:%d", &k, &h, &m, &s);
a++, b += k * 20 * 60 + (h * 60 + m) * 60 + s;
}
}
cnt = 1;
for (i = 0; i < n; i++) {
int c = strcmp(cc[i], "NijeZivotJedanACM");
if (c == 0)
continue;
if (a < aa[i] || a == aa[i] && (b > bb[i] || b == bb[i] && c < 0))
cnt++;
}
printf("%d\n", cnt);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |