50分求助

P1200 [USACO1.1] 你的飞碟在这儿 Your Ride Is Here

第十一行是b[j]
by KING_OF_TURTLE @ 2019-07-22 08:25:56


你的n每乘一次就要mod一次,不然数字太大。 ###### #include <bits/stdc++.h> ###### using namespace std; ###### int fac(char a){ return int(a)-64; ###### } ###### int main() ###### { string f, s; int sums=1, sumf=1; getline(cin,f); getline(cin,s); for(int i=0;i<f.size();i++){ sumf*=fac(f[i]); sumf%=47; } for(int i=0;i<s.size();i++){ sums*=fac(s[i]); sums%=47; } if(sumf==sums) cout << "GO" << endl; else cout << "STAY" << endl; return 0; ###### }
by Howard浩然 @ 2019-07-22 08:50:36


|