# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
118598 | roseanne_pcy | Pinball (JOI14_pinball) | C++14 | 2 ms | 356 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 <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;
const int maxn = 1e5+5;
int n, m;
int A[maxn], B[maxn], C[maxn], pay[maxn];
vector<int> cut;
map<int, int> bst;
struct node
{
ll L, R, fill;
node(){}
node(ll L, ll R, ll fill) : L(L), R(R), fill(fill){}
};
node st[12*maxn];
int main()
{
scanf("%d %d", &n, &m);
for(int i = 1; i<= n; i++)
{
scanf("%d %d %d %d", &A[i], &B[i], &C[i], &pay[i]);
cut.pb(A[i]); cut.pb(B[i]); cut.pb(C[i]);
}
sort(cut.begin(), cut.end());
cut.resize(unique(cut.begin(), cut.end())-cut.begin());
int cnt = 0;
if(cut[0] != 1) cnt++;
for(int x : cut)
{
cnt++;
bst[x] = cnt;
}
if(cut.back() != m) cnt++;
for(int i = 1; i<= n; i++)
{
A[i] = bst[A[i]];
B[i] = bst[B[i]];
C[i] = bst[C[i]];
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |