Test instructions: Given a large number, ask you if modulo 73 and 137 are all 0.
Analysis: There is nothing to say, first with a char stored down, and then one of the count is good.
The code is as follows:
#pragma COMMENT (linker, "/stack:1024000000,1024000000") #include <cstdio> #include <string> #include < cstdlib> #include <cmath> #include <iostream> #include <cstring> #include <set> #include < queue> #include <algorithm> #include <vector> #include <map> #include <cctype> #include < Stack>using namespace Std;typedef Long Long ll;typedef pair<int, int> p;const int INF = 0x3f3f3f3f;const double I NF = 0x3f3f3f3f3f3f;const LL LNF = 100000000000000000;const Double PI = ACOs ( -1.0); const double EPS = 1e-8;const int MAXN = 1e7 + 5;const int mod = 1e9 + 7;const char *mark = "+-*"; const int dr[] = {-1, 0, 1, 0};const int dc[] = {0, 1, 0, -1};i NT N, m;inline bool is_in (int r, int c) {return R >= 0 && r < n && C >= 0 && c < m; }inline ll Max (ll A, ll b) {return a < b b:a;} inline ll Min (ll A, ll b) {return a > b b:a;} Char S[maxn];int main () {int kase = 0; while (scanf ("%s", s) = = 1) {int ans1 = 0, ans2 = 0; n = strlen (s); for (int i = 0; i < n; ++i) {ans1 = (ANS1 * + s[i]-' 0 ')% 73; ANS2 = (ANS2 * + s[i]-' 0 ')% 137; } printf ("Case #%d:%s\n", ++kase,!ans1 &&!ans2? "YES": "NO"); } return 0;}
HDU 5832 A water problem (water problem, large number)