Advertisement
MaskerQwQ

Time is limited.

Apr 2nd, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. //A
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     long long n,k;
  9.     while(cin>>n>>k){
  10.         if((n&k)==k){
  11.             cout<<"1"<<endl;
  12.         }else{
  13.             cout<<"0"<<endl;
  14.         }
  15.     }
  16.     return 0;
  17. }
  18. //B
  19. #include<bits/stdc++.h>
  20.  
  21. using namespace std;
  22. typedef long long ll;
  23. const int N=1e9;
  24. const int mod=998244353;
  25. ll fac[1010];
  26.  
  27. void init(){
  28.     fac[0]=1;
  29.     for(int i=1;i<=1010;i++){
  30.         fac[i]=fac[i-1]*i%mod;
  31.     }
  32. }
  33. ll ans(int n){
  34.     if(n&1){
  35.         return 0;
  36.     }else{
  37.         return (fac[n/2]*fac[n/2])%mod;
  38.     }
  39. }
  40. int main(){
  41.     int t;
  42.     cin>>t;
  43.     init();
  44.     while(t--){
  45.         int n;
  46.         cin>>n;
  47.         cout<<ans(n)<<endl;
  48.     }
  49.     return 0;
  50. }
  51. //E 题你写过的原题
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement