摘要: https://ac.nowcoder.com/acm/problem/53675 为什么加上mod2333就对了? #include <bits/stdc++.h> using namespace std; int a[3005][3005],dp[3005][3005]; template<cl 阅读全文
posted @ 2020-09-12 15:50 asunayi 阅读(126) 评论(0) 推荐(0)
摘要: https://codeforces.com/contest/1409/problem/D #include<bits/stdc++.h> using namespace std; const int N=1e6+5; #define ll long long int main(){ int t;c 阅读全文
posted @ 2020-09-09 23:43 asunayi 阅读(181) 评论(0) 推荐(0)
摘要: https://codeforces.com/contest/1409/problem/B 可以考虑先让a最小,再让b最小,最后取最小值。这个题很简单,可能是思维局限了。 #include<bits/stdc++.h> using namespace std; const int N=1e6+5; 阅读全文
posted @ 2020-09-08 18:58 asunayi 阅读(262) 评论(0) 推荐(0)
摘要: https://codeforces.com/contest/1389/problem/B 题意:给出一个数组a[],起点在第一个数,每次移动加分为落脚出的数,总共可以移动k步,最多向左移动z步,求一个最大分数。 可用dp,感觉自己不太熟练。dp[i][j]表示当前在第i个数,向左走了j步,已走k步 阅读全文
posted @ 2020-07-31 00:07 asunayi 阅读(212) 评论(0) 推荐(0)
摘要: 链接:https://codeforces.com/contest/1379/problem/C 题意:弗拉基米尔想为他的妻子准备一份礼物:他决定给买整整n朵花。弗拉基米尔去了一家花店, 那里有m种花卉出售,每种类型的花卉供应无限。他知道在收到第i种类型的第一朵花后,他的妻子的幸福感增加了ai,在收 阅读全文
posted @ 2020-07-22 15:00 asunayi 阅读(340) 评论(0) 推荐(0)
摘要: 链接:https://atcoder.jp/contests/abc171/tasks/abc171_e 题意:已知a1,a2,...,an,n为偶数,定义xor为:某二进制位上有奇数个1,则该位位1,否则为0 ( 其实就是异或 ) ;a1=b2xorb3xor...xorbn, a2=b1xorb 阅读全文
posted @ 2020-07-17 17:53 asunayi 阅读(168) 评论(0) 推荐(0)
摘要: 题目链接:https://atcoder.jp/contests/aising2020/tasks/aising2020_d 题意:对输入的二进制串x,设它每一位分别取反后的十进制结果为f,二进制的f中1的个数为n,令f=f%n,输出使f=0需要经过该操作的次数。 代码: #include<bits 阅读全文
posted @ 2020-07-17 15:35 asunayi 阅读(171) 评论(0) 推荐(0)
摘要: We have N bulbs arranged on a number line, numbered 1 to N from left to right. Bulb i is at coordinate i. Each bulb has a non-negative integer paramet 阅读全文
posted @ 2020-06-15 15:17 asunayi 阅读(214) 评论(0) 推荐(1)
摘要: 描述 C 库函数 char *strstr(const char *haystack, const char *needle) 在字符串 haystack 中查找第一次出现字符串 needle 的位置,不包含终止符 '\0'。 声明 char *strstr(const char *haystack 阅读全文
posted @ 2020-05-29 22:47 asunayi 阅读(201) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5773/E来源:牛客网 牛客幼儿园的小朋友课间操时间需要按照学号从小到大排队,但是他们太小了只能站成一列顺序却不对,现在幼儿园的阿姨需要帮忙交换小朋友的位置让他们最终有序,阿姨希望能尽快完成交换操作,问最少需要交换多少次 阅读全文
posted @ 2020-05-28 14:02 asunayi 阅读(281) 评论(0) 推荐(0)