# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
972898 | sleepntsheep | Palembang Bridges (APIO15_bridge) | C11 | 46 ms | 10324 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 <stdlib.h>
#define MAX_N 2000000
int min(int a,int b){return a<b?a:b;}
int max(int a,int b){return a>b?a:b;}
int cmpr(const void*a,const void*b){return *(const int*)a - *(const int*)b;}
int n, k, a[MAX_N], b[MAX_N], c[MAX_N<<1], o, p;
long long cost;
int main()
{
scanf("%d%d", &k, &n);
for (int s, t, i = 0; i < n; ++i)
{
char bb, cc;
scanf(" %c%d %c%d",&bb,&s,&cc,&t);
if(bb==cc) cost += abs(t-s);
else
{
a[o] = min(s, t);
b[o] = max(s, t);
c[p++] = s; c[p++] = t;
++o;
++cost;
}
}
if(k==1)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |