# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1080628 | thelegendary08 | City (JOI17_city) | C++14 | 0 ms | 0 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 "Device.h"
#define ll long long
void InitDevice()
{
}
int Answer(long long S, long long T)
{
ll szs, cs, szt, ct;
//cout<<S<<' '<<T<<'\n';
if(S >= 250000ll * 125000ll){
S -= 250000ll * 125000ll;
szs = S % 250000ll;
cs = S / 250000ll;
}
else{
szs = S % 125000ll;
cs = S / 125000ll;
}
if(T >= 250000ll * 125000ll){
T -= 250000ll * 125000ll;
szt = T % 250000ll;
ct = T / 250000ll;
}
else{
szt = T % 125000ll;
ct = T/ 125000ll;
}
//cout<<cs<<' '<<ct<<' '<<szs<<' '<<szt<<'\n';
if(cs + szs > ct && ct > cs)return 1;
if(ct + szt > cs && cs > ct)return 0;
return 2;
}
#include "Device.h"
#define ll long long
void InitDevice()
{
}
int Answer(long long S, long long T)
{
ll szs, cs, szt, ct;
//cout<<S<<' '<<T<<'\n';
if(S >= 250000ll * 125000ll){
S -= 250000ll * 125000ll;
szs = S % 250000ll;
cs = S / 250000ll;
}
else{
szs = S % 125000ll;
cs = S / 125000ll;
}
if(T >= 250000ll * 125000ll){
T -= 250000ll * 125000ll;
szt = T % 250000ll;
ct = T / 250000ll;
}
else{
szt = T % 125000ll;
ct = T/ 125000ll;
}
//cout<<cs<<' '<<ct<<' '<<szs<<' '<<szt<<'\n';
if(cs + szs > ct && ct > cs)return 1;
if(ct + szt > cs && cs > ct)return 0;
return 2;
}