Weird runtime

Any suggestion and feature request can be discussed here.

Weird runtime

by froghramar » Tue Aug 02, 2016 7:56 am

I submitted a solution of the problem "DCP - 85 : Tomorrow is Eid". My solution is
Code: Select all
#include <bits/stdc++.h>

using namespace std;
const int N = 100005;

int n;

void init(){
   scanf("%d",&n);
   if(n > 28) puts("YES");
   else puts("NO");
}

int main(){
   init();
   return 0;
}


I wonder how this code runs for 1.18 seconds. If I submit this code on codeforces the runtime should not be more than 30 milliseconds.
User avatar
 
Posts: 33
Joined: Thu Jul 28, 2016 8:14 am
Location: Amar Ekushey Hall, University of Dhaka

Re: Weird runtime

by devskill » Mon Aug 08, 2016 7:47 am

First of all rum time depends on the machine where it is run. We are not saying our machine is slow, but it can be different based on the configuration. 2ndly previously we used to show the total time of all test data as rum time, but just before coding contest 7 we are considering only the highest test set run time as the run time of the problem. This is applicable when there is multiple judge data file. Can you please resubmit the problem now and see how much time it takes. But I do not think it will be 30 millisecond though. May be codeforces use vertically higher grace CPU which computes lot faster. We instead use horizontal scaling and do not put too much computation effort, rather rely on many small compiler servers to execute compilation in parallel.
User avatar
Site Admin
 
Posts: 118
Joined: Tue Feb 02, 2016 10:24 pm

Re: Weird runtime

by froghramar » Mon Aug 08, 2016 9:10 am

When I run this program on my PC, it takes 0.4 seconds which includes compilation time. As far as I know, online judges generally ignores compilation time and only calculates execution time for each data set. This fraction of time may not be big issue in this problem. But when I will submit a code with higher complexity ( for example, O(nlogn), O(n(logn)^2) ) this may be a issue. I have experienced through some online judges like lightoj, codeforces, codemarshal, uva, spoj which can execute approximately 10^9 atomic instructions in 1 second. On the other hand, devskill seems not to be fast enough.
User avatar
 
Posts: 33
Joined: Thu Jul 28, 2016 8:14 am
Location: Amar Ekushey Hall, University of Dhaka

Re: Weird runtime

by devskill » Mon Aug 08, 2016 7:14 pm

We do not have knowledge of their server configuration, but we use 2.8Ghz processor. But it is not bottleneck of Dev Skill. Because we can change our compiler types on the fly at any time. It is our choice what type of server we choose to use. We do not use more powerful servers at this time, because it is not adding any value. If it was necessary, we could have used it. Our main objective is to get the result within the time limit of the problem. Dev Skill platform is designed in a very flexible micro service model and can tune each of its parts as it wish for but the necessity needs to be there.
User avatar
Site Admin
 
Posts: 118
Joined: Tue Feb 02, 2016 10:24 pm


Who is online
Users browsing this forum: Google [Bot] and 1 guest
cron