搜索结果
查询Tags标签: modulo,共有 4条记录-
C#根据数字获取Excel列名
/// <summary>/// 获取Excel列名/// </summary>/// <param name="columnNumber">从1开始的数字</param>/// <returns>列的序号,如:A、B、C、AA、BB</returns>public static string GetExcelColumnName(int columnNumber)…
2022/9/9 1:25:24 人评论 次浏览 -
cf1103 B. Game with modulo
题意: 交互题 有个未知整数 \(a\in[1,1e9]\),每次问两个数 \(x,y\),返回 \(x\pmod a \ge y\pmod a\) 是否成立 在 60 次内猜出 \(a\) 思路: 倍增猜法,长见识了 首先我想到猜 \(x,2x\),若 $\ge $ 说明 \(a\in [1,2x]\),否则 \(a\in [1,x)\cup (2x,1e9)\) 这样每次得…
2022/4/23 6:15:51 人评论 次浏览 -
英语题目翻译
题目地址: https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH13 Same Remainder 同样的余数 描述: Given A and B. Find the smallest X that X is greater than 1 and A modulo X equals to B modulo X. 给出A和B。找到最小的X,X是大于1且A模X等于B模X。 输入: Two pos…
2022/2/7 6:15:58 人评论 次浏览 -
LeetCode 5994. 查找给定哈希值的子串
题意 使用指定的hash函数,返回给定字符串s第一个长度为k的hash值 = 给定hashVal的子串的下标。 方法 hashNew=val(s[first])+power∗(hashNow−val(s[last])∗power^(k−1) 代码 class Solution { public:int indexChar(char s){return (int)(s - a) + 1;}int fastPow(in…
2022/2/1 7:01:15 人评论 次浏览