# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959069 | Abito | Arranging Tickets (JOI17_arranging_tickets) | C++17 | 6055 ms | 4688 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>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
#define int long long
#define ll long long
typedef unsigned long long ull;
using namespace std;
const int N=2e5+5;
int a[N],b[N],n,m,f[N];
int rec(int i,int mx){
//cout<<i<<endl;
//for (int j=0;j<n;j++) cout<<f[j]<<' ';cout<<endl<<endl;
if (i>m) return mx;
int x=mx;
for (int j=a[i];j!=b[i];j=(j+1)%n){
f[j]++;
x=max(x,f[j]);
}int ans=rec(i+1,x);
for (int j=a[i];j!=b[i];j=(j+1)%n) f[j]--;
x=mx;
for (int j=b[i];j!=a[i];j=(j+1)%n){
f[j]++;
x=max(x,f[j]);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |