# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
892338 | dimashhh | Misspelling (JOI22_misspelling) | C++17 | 310 ms | 144720 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;
const int N = 5e5 + 1, MOD = 1e9 + 7;
typedef long long ll;
int n,m,mx_x[N],mx_y[N];
ll dp[N][26],sum[26],ss[26];
set<int> st,st1;
void test(){
cin >> n >> m;
for(int i = 1;i <= m;i++){
int a,b;
cin >> a >> b;
if(a < b){
mx_x[a + 1] = max(mx_x[a + 1],b);
}else{
mx_y[b + 1] = max(mx_y[b + 1],a);
}
}
for(int i = 0;i < 26;i++){
dp[n][i] = 1;
sum[i] = ss[i] = 1;
}
st.insert(n);
st1.insert(n);
for(int i = n - 1;i >= 1;i--){
if(mx_y[i + 1] >= i + 1){
while(!st.empty()){
auto it = st.lower_bound(i + 1);
if(it != st.end() && (*it) <= mx_y[i + 1]){
for(int c = 0;c < 26;c++){
# | 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... |