1.题目 Let’s define the following recurrence: an+1=an+minDigit(an)⋅maxDigit(an). Here minDigit(x) and maxDigit(x) are the minimal and maximal digits in the decimal representation of x without leading zeroes. For examples refer to notes. Your task is calculate aK for given a1 and ...
链接:https://codeforces.com/contest/1355/problem/A Let's define the following recurrence: an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an). Here minDigit(x)minDigit(x)&...A. Sequence with Digits time limit per test 1 second memory limit per test 256 meg...
DionysiosB 1355A-SequenceWithDigits ad113d6· May 22, 2020 HistoryHistory File metadata and controls Code Blame 31 lines (25 loc) · 547 Bytes Raw #include <cstdio> typedef long long ll; int getProduct(ll x){ int mn(10), mx(0); while(x > 0){ int cur = (x % 10); mn = ...
代码(Python3) # https://codeforces.com/problemset/problem/1355/A import sys import os import heapq import math try: path = "./file/input.txt" if os.path.exists(path): sys.stdin = open(path, 'r') # sys.stdout = open(r"./file/output.txt", 'w') except: pass t = int(input(...
但是,我们要求的是这些数合在一起,就像字符串拼接一样,一共有多少位。很简单,将不同位数的数的数量乘上它们各自的位数,就是一共的位数了。11 位:一共 99 个数,99 位。 22 位:一共 9090 个数,180180 位。 33 位:一共 900900 个数,27002700 位。 ……设位数为 lenlen,那么当前位数的数的总位数计算...
Given the values of a, b, you have to find the last m digits of f(n). Input Input starts with an integer T (≤ 10000), denoting the number of test cases. Each test case consists of a single line containing four integers a b n m. The values of a and b range in [0,100], ...
PracticeTwoPointersMethod2D-NumberOfSegmentsWithBigSum.cpp PracticeTwoPointersMethod2E-SegmentsWithSmallSet.cpp PracticeTwoPointersMethod2F-SegmentsWithSmallSpread.cpp PracticeTwoPointersMethod3A-LoopedPlaylist.cpp README.mdBreadcrumbs CodeForces / 1107A-DigitsSequenceDividing.cpp Latest...
1355A-SequenceWithDigits.cpp 1355B-YoungExplorers.cpp 1355C-CountTriangles.cpp 1355D-GameWithArray.cpp 1358A-ParkLighting.cpp 1358B-MariaBreaksTheSelfIsolation.cpp 1358C-CelexUpdate.cpp 1359A-BerlandPoker.cpp 1359B-NewTheatreSquare.cpp 1359C-MixingWater.cpp 1359D-YetAnotherYetAnotherTask.cpp 1360...