题解 | #方程#
方程
https://www.nowcoder.com/practice/1d0682f610f14e7c910dd7d97aa396a3
#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long mul(int a,int b){
return 1ll*a*b%mod;
}
long long mpow(int a,int b){
long long ret(1);
while(b){
if(b&1) ret = mul(ret,a);
a = mul(a,a);
b >>= 1;
}
return ret;
}
int main() {
int n;
string s;
cin >> n;
getline(cin, s);
getline(cin, s);
int cnt = 0;
for(auto x : s){
if(x == '0') cnt++;
}
cout << mpow(2,cnt) << endl;
return 0;
}
查看25道真题和解析
