Submission #1892382


Source Code Expand

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N,Q;
	cin>>N>>Q;
	while(Q--){
		int a,b,s,t;
		cin>>a>>b>>s>>t;
		int ans = 0;
		if( a <= s && t <= b){
			ans = 0;
		}else if( s<=a && b<=t ){
			ans = t-s-(b-a);
		}else if( t <= a || b <= s ){
			ans = t-s;
		}else if( s <= a ){
			ans = a-s;
		}else{
			ans = t-b;
		}
		cout << ans * 100 << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Submission Info

Submission Time
Task D - 定期券
User akarin55
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1626 Byte
Status AC
Exec Time 195 ms
Memory 1024 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All large_01.txt, large_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, small_01.txt, small_02.txt
Case Name Status Exec Time Memory
large_01.txt AC 99 ms 640 KB
large_02.txt AC 184 ms 1024 KB
random_01.txt AC 188 ms 896 KB
random_02.txt AC 188 ms 896 KB
random_03.txt AC 192 ms 896 KB
random_04.txt AC 189 ms 896 KB
random_05.txt AC 187 ms 896 KB
random_06.txt AC 195 ms 896 KB
random_07.txt AC 190 ms 896 KB
random_08.txt AC 187 ms 896 KB
random_09.txt AC 189 ms 896 KB
random_10.txt AC 188 ms 896 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
small_01.txt AC 1 ms 256 KB
small_02.txt AC 1 ms 256 KB