码迷,mamicode.com
首页 >  
搜索关键字:ans    ( 3741个结果
每日一题-1
给出?N 名运动员的成绩,找出他们的相对名次并授予前三名对应的奖牌。前三名运动员将会被分别授予 “金牌”,“银牌” 和“ 铜牌”("Gold Medal", "Silver Medal", "Bronze Medal")。 (注:分数越高的选手,排名越靠前。) 示例 1: Ans ...
分类:其他好文   时间:2020-04-13 00:22:57    阅读次数:88
leetcode-184周赛-5381-查询带键的排列
题目描述: 自己的提交: class Solution: def processQueries(self, queries: List[int], m: int) -> List[int]: l = [i for i in range(1,m+1)] ans = [] for i in querie ...
分类:其他好文   时间:2020-04-12 20:55:18    阅读次数:67
poj 1312
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; int n,k; char ch[10][10]; long long ans; int vis[10 ...
分类:其他好文   时间:2020-04-12 10:23:42    阅读次数:54
CodeForces - 964A(找规律)
"原题" 题意:给你个数N,问你能得到多少种权重不同的分解(权重指将数分解成一个不上升的正整数序列后,序列中等于序列第一个数的个数) 思路:看到题感觉就是规律题,但是开始一直没搞懂输入8为啥出来5,如果能够简单将前几个数模拟一下,就会发现规律 n | ans | | | 1 | 1 2 | 2 3 ...
分类:其他好文   时间:2020-04-11 00:36:09    阅读次数:62
CF452E Three strings【广义SAM】
"传送门" 也是广义 SAM 的板子题,建好广义 SAM,统计 $epA,epB,epC$,然后对于区间 $ans[len[fa[x]]+1],...,ans[len[x]]$ 加上 $epA\times epB\times epC$ 就行了,当然这个用差分实现简单快捷。 到这里,我后缀自动机的刷题 ...
分类:其他好文   时间:2020-04-10 09:12:31    阅读次数:58
2019-2020 ACM-ICPC Latin American Regional Programming Contest I - Improve SPAM 树形dp?
``` #include #include #define int long long using namespace std; const int N=4010,mod=1e9+7; int a[N]; int e[N*N],ne[N*N],idx,h[N]; int st[N]; int ans... ...
分类:其他好文   时间:2020-04-09 10:53:11    阅读次数:150
leetcode-面试题13-机器人的运动范围
题目描述: 方法一:dfs/bfs class Solution: def movingCount(self, m: int, n: int, k: int) -> int: def digitsum(n): ans = 0 while n: ans += n %10 n//=10 return a ...
分类:其他好文   时间:2020-04-09 00:29:48    阅读次数:70
杂题选讲1
把序列排序后 问题转化为子序列两两之间的异或和大于等于k 用户$Trie$树优化$dp$ 因为不满足单调性所以不能用二分来优化 $ans=\sum_{i=1}^{n}n%i$ $ans=\sum_{i=1}^{n}(n n/i i)$ $ans=n^2 \sum_{i=1}^{n}i (n/i)$ ...
分类:其他好文   时间:2020-04-07 18:37:19    阅读次数:97
Problem Toki’s function
#include <bits/stdc++.h> #define ll long long using namespace std; int n, mod = 1000000007; char s[200005]; int main() { cin >> n >> s + 1; ll ans = 0 ...
分类:其他好文   时间:2020-04-05 13:44:59    阅读次数:56
UCF “Practice” Local Contest — Aug 25, 2018 Boots Exchange 水题
#include <bits/stdc++.h> using namespace std; int n; set <int> a; map <int,int> cnt; int main() { cin >> n; int ans = 0; for (int i = 1; i <= n; ++i) ...
分类:其他好文   时间:2020-04-05 13:33:18    阅读次数:70
3741条   上一页 1 ... 15 16 17 18 19 ... 375 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!