HDU 5832 A water problem (water problem, large number)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.