Submission #1943553


Source Code Expand

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	ll n, m;
	cin>>n>>m;
	rep(i, m){
		ll a, b, c, d;
		cin>>a>>b>>c>>d;
		a = max(a, c);
		b = min(b, d);
		ll res = d-c;
		if(a<=b) res -= b-a;
		cout<<res*100<<endl;
	}
	return 0;
}

Submission Info

Submission Time
Task D - 定期券
User Lepton
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1340 Byte
Status AC
Exec Time 278 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 140 ms 640 KB
large_02.txt AC 266 ms 1024 KB
random_01.txt AC 277 ms 896 KB
random_02.txt AC 273 ms 896 KB
random_03.txt AC 274 ms 896 KB
random_04.txt AC 274 ms 896 KB
random_05.txt AC 275 ms 896 KB
random_06.txt AC 274 ms 896 KB
random_07.txt AC 276 ms 896 KB
random_08.txt AC 278 ms 896 KB
random_09.txt AC 275 ms 896 KB
random_10.txt AC 276 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