fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n,m;
  4. #define mod 998244353
  5.  
  6. int ar[200000];
  7. int seg[800000];
  8. void build(int low,int high,int node){
  9.  
  10. if(low==high){
  11. seg[node] = ar[low];
  12. return;
  13. }
  14. int mid = (low+high)/2;
  15. build(low,mid,2*node);
  16. build(mid+1,high,2*node+1);
  17. seg[node] = (seg[2*node]%mod + seg[2*node+1]%mod)%mod;
  18.  
  19. }
  20. int main() {
  21. // your code goes here
  22.  
  23. cin>>n>>m;
  24. for(int i=0;i<n;i++){
  25. ar[i] = 1;
  26. }
  27.  
  28. build(0,n-1,1);
  29. for(int i=1;i<=40;i++){
  30. cout<<seg[i];
  31. }
  32. //cout<<seg[1];
  33. return 0;
  34. }
Success #stdin #stdout 0s 4240KB
stdin
6 5
stdout
6332121110011000000000000000000000000000