当前位置:网站首页>Codeforces Round #359 (Div. 2) C. Robbers' watch Violent Enumeration
Codeforces Round #359 (Div. 2) C. Robbers' watch Violent Enumeration
2022-08-09 07:04:00 【swust_fang】
Problem link
The meaning of the question is really annoying. At the end, I know that n m is actually the number of digits in the two time zones of the limited table, so when the number is not enough to fill the time zone, the front is automatically filled with zeros
Thinking: First of all, if there cannot be repeated numbers, the total number of digits in the hours and minutes must not be greater than 7.
7 to the 7th power is only 823543
So we can enumerate i from 0 to n, and j from 0 to m.Why is the complexity correct?
In fact, it is to consider the maximum number of LenN+LenM<=7 and n*m (Len indicates how many digits)
Consider two limits N1 bits, M6 bits, the maximum 7*7^6 is just the 7th power of 7
N4 bits, M3 bits, maximum 7^3*7^4 or 7^7, less than 1e6 complexity
//#pragma comment (linker, "/STACK:102400000,102400000")#include#include#include#include#include#include#include#include#include#include#include
边栏推荐
猜你喜欢
随机推荐
DSP+ARM+FPGA高速PCIE/千兆网口信号仿真介绍
TCP段重组PDU
高项 03 项目立项管理
tianqf的解题思路
分布式事务产生的原因
codeforces Valera and Elections (这思维题是做不明白了)
postgresql Window Functions
Inception V3 Eye Closure Detection
基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
HDU - 3183 A Magic Lamp 线段树
错误:为 repo ‘oracle_linux_repo‘ 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.
线程池总结
The water problem of leetcode
无重复的字符的最长子串
db.sqlite3 has no "as Data Source" workaround
2017 G icpc shenyang Infinite Fraction Path BFS + pruning
力扣 636. 函数的独占时间
字节也开始缩招了...
分布式理论
P7阿里面试题2020.07 之滑动窗算法(阿里云面试)