数论
文章平均质量分 84
卿与
博览而约取,厚积而薄发
展开
-
最大公约数
大厂笔试模拟练习网站(含题解)最近我们一直在将收集到的各种大厂笔试的解题思路还原成题目并制作数据,挂载到我们的OJ上,供大家学习交流,体会笔试难度。现已录入200+道互联网大厂模拟练习题,还在极速更新中。每道题目附有思路提示,对应的题解(各种语言)欢迎前往查看。现在塔子哥给出两个整数 a 和 b , 你现在有 k 次操作,每次要么选择 a,使其自增1,要么选择b使其自增1.现在塔子哥想知道,执行完 k 次操作后,a 和 b 的最大公约数最大可以是多少?原创 2023-07-14 16:52:21 · 189 阅读 · 0 评论 -
青蛙兔子的约会
现在青蛙与兔子在明天白天有个约会,但是青蛙不想等太久兔子,他决定在今天夜晚时就开始行动。行,每行一个"YES" 或 “NO”(不包括双引号),表示青蛙和兔子能否约会。每当晚上时,青蛙都会出来活动,白天休息。白天时,兔子就会出来活动,晚上休息。但是青蛙又怕累,所以晚上时青蛙只会向兔子的方向跳。次,然后无论白天兔子怎么跳,都无法和青蛙相遇。有交集则有能约会,没有则不能约会。次,白天无法与兔子相遇。次中,存在青蛙和兔子可以相遇。的距离,白天兔子向左跳。第一问,青蛙晚上向右跳。第二问,青蛙晚上向右跳。原创 2023-05-13 16:23:43 · 830 阅读 · 1 评论 -
二叉树的个数
已知一棵节点个数为 n 的二叉树的中序遍历单调递增, 求该二叉树能能有多少种树形, 输出答案对 109 +7 取模。如果你了解 卡塔兰数 的话,你就会发现我们的结果就是 卡塔兰数。由于数据较大,我们又要取模还有除法,我么需要使用逆元,即为。的所有二叉树的形状数。原创 2023-05-11 14:38:28 · 584 阅读 · 0 评论 -
CF1244C The Football Season
C. The Football SeasonThe football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or...原创 2019-10-14 20:03:43 · 467 阅读 · 0 评论 -
The Nth Item
题目描述 传送门For a series FFF:We have some queries. For each query N, the answer A is the value F(N) modulo 998244353.Moreover, the input data is given in the form of encryption, only the number...原创 2019-09-09 14:47:56 · 436 阅读 · 0 评论 -
D. Anton and School - 2
D. Anton and School - 2time limit per test2 secondsmemory limit per test256 megabytesAs you probably know, Anton goes to school. One of the school subjects that Anton studies is Bracketology...原创 2019-04-15 22:35:21 · 163 阅读 · 0 评论 -
E. Median String
E. Median String time limit per test 2 seconds memory limit per test 256 megabytesYou are given two stringsssandtt, both consisting of exactlykklower...原创 2019-04-02 20:25:47 · 204 阅读 · 0 评论 -
Superhero Battle
E. Superhero Battletime limit per test2 secondsmemory limit per test256 megabytesA superhero fights with a monster. The battle consists of rounds, each of which lasts exactlynnminutes. Aft...原创 2019-03-20 21:47:46 · 266 阅读 · 0 评论 -
How Many Trees?
How Many Trees?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4555 Accepted Submission(s): 2534Problem DescriptionA binary search tree is a...原创 2019-03-14 22:33:45 · 374 阅读 · 0 评论 -
CodeForces 677C Vanya and Label
C. Vanya and Label time limit per test 1 second memory limit per test 256 megabytesWhile walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he...原创 2019-03-03 22:26:33 · 224 阅读 · 0 评论 -
Equations of Mathematical Magic
B. Equations of Mathematical Magichttp://codeforces.com/contest/1064/problem/Btime limit per test 1 secondmemory limit per test 256 megabytes Colossal! — exclaimed Hawk-nose...原创 2018-10-14 21:56:53 · 639 阅读 · 0 评论 -
Prime Number
Simon has a prime number x and an array of non-negative integers a1, a2, ..., an.Simon loves fractions very much. Today he wrote out number on a piece of paper. After Simon led all fractions to ...转载 2018-09-24 20:09:37 · 806 阅读 · 0 评论