code1083,codeforces  385C   Bear and Prime Numbers
題意:給你一個數列,和m個詢問,求 數組種 l -r 中所有質數的的倍數的個數和。 解題思路:變形篩法。注意細節 解題代碼: 1 // File Name: 385c.cpp 2 // Author: darkdream 3 // Created Time: 2015年03月07日 星期六 18時24分53秒 4 5 #inc
时间:2023-10-06  |  阅读:16
code forces。codeforces 149E . Martian Strings    kmp
题目链接 给一个字符串s, n个字符串str。 令tmp为s中不重叠的两个连续子串合起来的结果, 顺序不能改变。问tmp能形成n个字符串中的几个。 初始将一个数组dp赋值为-1。 code forces。对str做kmp, 然后与串s进行匹配, 看哪些长度的串可以匹配到&#x
时间:2023-09-19  |  阅读:29
(Incomplete) Codeforces #395 (Div 1 + Div 2)
A. Taymyr is calling you 数据比较小,可以枚举每一次call的时间i*n, 然后检查 (i*n) % m 是否为0。如果为0,则答案加一。这种方法不需要想太多也不需要写太多。 数学上分析,答案为 z/lcm(n, m)。 lcm(n, m) 为n和m的最小公倍数,lcm(n, m) =
时间:2023-09-19  |  阅读:21
code forces 436 C. Bus
C. Bus time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0,
时间:2023-09-16  |  阅读:32
codeforce C. Okabe and Boxes
题目传送门 这道题 每次删除一个点 那么这个点必然在栈里面 那么如果堆顶不是他 我们就需要一次操作使得堆合理 这时我们可以把他删除然后把他下面的点打个标记表示这下面的点以后想怎么排就怎么排以后都不需要操作到 这样就解决问题啦 233 codeforces提升水平?‘ #include&l
时间:2023-09-15  |  阅读:13
codeforces  758 A
n 个数 找到最大的 codeforces中文官网?使得每个数都和最大的相等 花费求和 #include<stdio.h> #include<algorithm> #include<string.h> #include<math.h> #include<set> #include<string>using namespace std; typedef long long LL;#
时间:2023-09-11  |  阅读:31
codeforces  749
A 给你一个N 让你拆分成 个数最多 和素数的和 偶数 2... 奇数 2... 3 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> #include<queue>using namespace std;#define
时间:2023-09-11  |  阅读:20
codeforces166E - Tetrahedron DP
题意:求一个4面体从一个顶点出发经过n步到达原点的路线数 解题思路: 简单dp 解题代码: 1 // File Name: 166e.cpp 2 // Author: darkdream 3 // Created Time: 2014年07月24日 星期四 10时12分28秒 4 5 #include<vector> 6 #include<list> 7
时间:2023-09-10  |  阅读:30
Codeforces Round #280 (Div. 2)
B. Vanya and Lanterns code 128。题意:给出n个路灯,街道的长度,求出路灯的最小照射半径,使得整条街道都被照亮。 求出起点到第一盏灯的距离---n盏灯之间的距离/2---最后一盏灯到街尾的距离,找出这些值里面的最大值。 1 #include<iostr
时间:2023-09-10  |  阅读:20
codeforces C. Valera and Tubes
http://codeforces.com/contest/441/problem/C 题意:有nm个方格,然后把这些方格分成k部分,每个部分内的方格的坐标满足|xi - xi + 1| + |yi - yi + 1| = 1,且每一个部分内的方格数>=2,输出其中的一种方
时间:2023-09-10  |  阅读:20

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息