# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
533421 | Marslai24 | Crossing (JOI21_crossing) | C++17 | 303 ms | 31500 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>
using namespace std;
#define int long long // a.k.a. TLE creator
#define all(x) x.begin(), x.end()
template<class A, class B> istream& operator >>(istream &o, pair<A, B> &x){return o >> x.first >> x.second;}
template<class A, class B> ostream& operator <<(ostream &o, pair<A, B> &x){return o << x.first << ' ' << x.second << ' ';}
void setIO(){ios::sync_with_stdio(false); cin.tie(0);}
const int INF = 2e18, MOD = 998244353, N = 2e5 + 2;
int pw[N]{}, p = 9973;
void init(){
pw[0] = 1;
for(int i = 1; i < N; i++)pw[i] = pw[i - 1] * p % MOD;
}
struct Hash{
vector<int> h;
Hash(string s){
h.resize(s.size() + 1);
for(int i = 0; i < s.size(); i++){
h[i + 1] = (h[i] * p + s[i]) % MOD;
}
}
int get(int l, int r){
int ans = h[r + 1] - h[l] * pw[r - l + 1] % MOD;
if(ans < 0)ans += MOD;
return ans;
}
}J(string(N, 'J')), O(string(N, 'O')), I(string(N, '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... |