上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页
摘要: Cake Assembly Line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A cake assembly line i 阅读全文
posted @ 2023-06-29 11:54 o-Sakurajimamai-o 阅读(39) 评论(0) 推荐(0)
摘要: Dolce Vita time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Turbulent times are coming, s 阅读全文
posted @ 2023-06-29 10:21 o-Sakurajimamai-o 阅读(23) 评论(0) 推荐(0)
摘要: Scoring Subsequences time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output The score of a se 阅读全文
posted @ 2023-06-24 09:39 o-Sakurajimamai-o 阅读(78) 评论(0) 推荐(0)
摘要: 用nsqrt(n)的时间复杂度就能过 //Dreaming of Freedom:https://codeforces.com/problemset/problem/1826/C #include <bits/stdc++.h> //#define int long long using names 阅读全文
posted @ 2023-06-23 10:25 o-Sakurajimamai-o 阅读(48) 评论(0) 推荐(0)
摘要: 比普通幂运算更快,只需要预处理一些数就可以 普通幂: 1 int res=1; 2 for(int i=0;i<k;i++) 3 res=res*n; 4 return res; 快速幂: //快速幂:https://www.luogu.com.cn/problem/P1226 #include < 阅读全文
posted @ 2023-06-21 14:25 o-Sakurajimamai-o 阅读(20) 评论(0) 推荐(0)
摘要: 欧拉函数:指从1-n中与n互质的数的个数 首先要知道,一个数 $n$ 分解质因数之后会变成这样一个形式: $n$ = $p1k1$ + $p2k2$+ ... + $pnkn$ 而欧拉函数: $φ$= $n$ * (1-1/p1) * (1-1/p2) * ... * (1-1/pn). 证明: 1 阅读全文
posted @ 2023-06-21 14:05 o-Sakurajimamai-o 阅读(51) 评论(0) 推荐(0)
摘要: Getting Zero time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Suppose you have an integer 阅读全文
posted @ 2023-06-21 13:05 o-Sakurajimamai-o 阅读(29) 评论(0) 推荐(0)
摘要: //[POI2006] OKR-Periods of Words:https://www.luogu.com.cn/problem/P3435 //题意就是求每个子串的最小公共前后缀,也就是让我们的next数组缩到最小就可以 //这里要记忆化一下,枚举到i的时候可以直接跳到j,减少枚举次数 #inc 阅读全文
posted @ 2023-06-21 10:58 o-Sakurajimamai-o 阅读(15) 评论(0) 推荐(0)
摘要: 考试的时候看到这道题一眼前缀和,但是想了想要枚举每个区间是不是复杂度有点高,还是交上去了 不出意外的 $TLE$ 了,想了十来分钟还是没想到怎么优化,考完问了一下大佬,原来用等差数列1ms就能过,听说双指针0ms(蒟蒻的我呜呜) 众所周知等差数列的前 $N$ 项和是 $S$ =a1 *n+(n*(n 阅读全文
posted @ 2023-06-20 13:10 o-Sakurajimamai-o 阅读(24) 评论(0) 推荐(0)
摘要: 思路:找规律情况一: 尾数为5或0 为5时进行一次操作变成0的情况。而尾数是 0 时操作无意义,所有数必须相等。情况二:尾数为 1,3,7,9可进行一次操作变成情况三。情况三:尾数为 2,4,6,8我们通过找规律发现: 2⇒4⇒8⇒16⇒22 4⇒8⇒16⇒22⇒24 6⇒12⇒14⇒18⇒26 8 阅读全文
posted @ 2023-06-20 11:47 o-Sakurajimamai-o 阅读(52) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页
-- --