当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
P6 ali machine test of 2020 Fibonacci number
Integer 线程安全的
TCP段重组PDU
AD picture PCB tutorial 20 minutes clear label shop operation process, copper network
分布式事务产生的原因
ByteDance Written Exam 2020 (Douyin E-commerce)
【nuxt】服务器部署步骤
stm32定时器之简单封装
MVN 中配置flyway mysq
Singleton DCL (double check the lock) full han mode and the hungry
洛谷P1110 报表统计 multiset stl好题
虚拟机网卡报错:Bringing up interface eth0: Error: No suitable device found: no device found for connection
查看日志常用命令
事务总结
SIGINT, SIGKILL, SIGTERM signal difference, summary of various signals
bzoj 5333 [Sdoi2018]荣誉称号
P1505 [国家集训队]旅游 树链剖分
力扣第 305 场周赛复盘
SIGINT,SIGKILL,SIGTERM信号区别,各类信号总结
常用测试用例设计方法之正交实验法详解