GNU C++17 Diagnostics (Dr Memory) compiler giving the time limit error in my code.

Правка en2, от akshayarise, 2018-08-18 09:26:38

Here is my code which is got accepted in GNU G++17 7.3.0 compiler but I am not able to find out why this is showing time limit error in GNU C++17 Diagnostics (Dr Memory) compiler.

A. New Building for SIS

include <bits/stdc++.h>

using namespace std; int main(){ register int n,h,low,high,k; ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

cin>>n>>h>>low>>high>>k;

register int ta,fa,tb,fb;

while(k--){

 cin>>ta>>fa>>tb>>fb;

 if(ta == tb)  
   cout<<abs(fa - fb)<<"\n";
 else if(fa < low && fb < low )
   cout<<abs(ta-tb) + low - fa + low - fb<<"\n";
 else if(fa > high && fb > high )
   cout<<abs(ta-tb) + fa - high + fb - high<<"\n";   
 else
   cout<<abs(ta-tb) + abs(fa-fb)<<"\n";

}

return 0; }

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский akshayarise 2018-08-18 09:26:38 8 (published)
en1 Английский akshayarise 2018-08-18 09:19:32 903 Initial revision (saved to drafts)