Submission #57130494
Source Code Expand
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ui = unsigned;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,l,r) for(int i=(l);i>=(r);--i)
#define repn(i,n) for(int i=0;i<(n);++i)
#define sizc(x) ((int)x.size())
#define allc(x) x.begin(),x.end()
#define fir first
#define sec second
constexpr int N = 505;
using Z=modint998244353;
int n,m;
Z f[N][N],C[N][N];
bool d[N][N][N];
signed main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>n>>m;
rep(i,1,m){
int l,r,x;cin>>l>>r>>x;
d[l][r][x]=1;
}
rep(i,1,n){
}
rep(i,0,n){
C[i][0]=1;
rep(j,1,i)C[i][j]=C[i-1][j]+C[i-1][j-1];
}
rep(i,0,n)f[i+1][i]=1;
per(l,n,1)rep(r,l,n){
rep(i,l,r){
d[l][r][i]|=d[l+1][r][i]||d[l][r-1][i];
if(!d[l][r][i]){
f[l][r]+=f[l][i-1]*f[i+1][r]*C[r-l][i-l];
}
}
}
cout<<f[1][n].val()<<'\n';
}
Submission Info
Submission Time |
|
Task |
C - Not Argmax |
User |
KnownError_ |
Language |
C++ 20 (gcc 12.2) |
Score |
600 |
Code Size |
1192 Byte |
Status |
AC |
Exec Time |
101 ms |
Memory |
69192 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
600 / 600 |
Status |
|
|
Set Name |
Test Cases |
Sample |
00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 00-sample-004.txt |
All |
00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 00-sample-004.txt, 01-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt, 01-006.txt, 01-007.txt, 01-008.txt, 01-009.txt, 01-010.txt, 01-011.txt, 01-012.txt, 01-013.txt, 01-014.txt, 01-015.txt, 01-016.txt, 01-017.txt, 01-018.txt, 01-019.txt, 01-020.txt, 01-021.txt, 01-022.txt, 01-023.txt, 01-024.txt, 01-025.txt, 01-026.txt, 01-027.txt |
Case Name |
Status |
Exec Time |
Memory |
00-sample-001.txt |
AC |
2 ms |
5412 KB |
00-sample-002.txt |
AC |
2 ms |
5504 KB |
00-sample-003.txt |
AC |
2 ms |
5600 KB |
00-sample-004.txt |
AC |
1 ms |
5524 KB |
01-001.txt |
AC |
1 ms |
5548 KB |
01-002.txt |
AC |
1 ms |
5488 KB |
01-003.txt |
AC |
57 ms |
50152 KB |
01-004.txt |
AC |
9 ms |
14552 KB |
01-005.txt |
AC |
2 ms |
6668 KB |
01-006.txt |
AC |
82 ms |
65192 KB |
01-007.txt |
AC |
9 ms |
13728 KB |
01-008.txt |
AC |
101 ms |
69084 KB |
01-009.txt |
AC |
101 ms |
69036 KB |
01-010.txt |
AC |
101 ms |
68980 KB |
01-011.txt |
AC |
101 ms |
69120 KB |
01-012.txt |
AC |
99 ms |
69184 KB |
01-013.txt |
AC |
99 ms |
69080 KB |
01-014.txt |
AC |
85 ms |
69052 KB |
01-015.txt |
AC |
76 ms |
69056 KB |
01-016.txt |
AC |
65 ms |
69056 KB |
01-017.txt |
AC |
55 ms |
69192 KB |
01-018.txt |
AC |
68 ms |
69124 KB |
01-019.txt |
AC |
60 ms |
69192 KB |
01-020.txt |
AC |
58 ms |
69044 KB |
01-021.txt |
AC |
59 ms |
69084 KB |
01-022.txt |
AC |
58 ms |
69140 KB |
01-023.txt |
AC |
60 ms |
69104 KB |
01-024.txt |
AC |
59 ms |
69056 KB |
01-025.txt |
AC |
61 ms |
69180 KB |
01-026.txt |
AC |
69 ms |
69040 KB |
01-027.txt |
AC |
70 ms |
69044 KB |