存储结构体如果你认为每个人都有自己的 number 是一件很酷的事,那让我们试着给每个人添加虚拟 kitties。首先,我们需要以 struct 的形式定义我们的 kitties 具有哪些属性,然后我们需要学习如何在 runtime 存储中存储这些自定义结构。5.1 定义一个自定义 Struct你可以为 runtime 定义一个自定义结构,如下所示:#[derive(
转载
2024-05-21 06:51:23
38阅读
题目链接:点击打开链接#include #include #include #include #include #include using namespace std;#define N 105int n,m,a,b,c;char s[N][N];setmyset;bool inmap(int x,int y){return 0<=x&&x<n&&0<=y&&y<m;}
原创
2021-08-13 14:08:20
55阅读
题目链接: 题目链接:点击打开链接 #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <iostream> #include <map> #include <set> #inclu
转载
2016-02-03 21:31:00
117阅读
2评论
题干:One day Ms Swan bought an orange in a shop. The orange consisted of n·k segments, .
原创
2022-06-15 13:13:18
113阅读
题目链接:题目链接:点击打开链接#include #include #include #include #include #include #include #include using namespace std;#define inf 10000000#define N 100050#define ll __int64ll n;ll a[N], lsu
原创
2021-08-13 13:51:08
356阅读
题干:Vasya came up with a password to register for EatForces — a string ss. The password in EatForces shou
原创
2022-06-15 12:17:46
120阅读
Description有一个n*n的网格,你需要在上面设置一些传送门,传送门由两个配对的格子组成,从一个进入会立刻从另一个同一方向出来。现在有n个人从第1列出发向右走,位于(i,1)的人要走到(ri,n)n个人从第一行出发向下走,位于(1,i)的人要走到(n,ci)求一种设置传送门的方案。n<=1000Solution很有意思的一个构造。我们先考虑第一行第一列如果他们都是一...
原创
2019-06-13 22:35:27
89阅读
题目链接:点击打开链接题意:给定n个点 m条边的无向图 需要在图里增加p条边 使得图最后连通分量数为q问是否可行,不可行输出NO可行输出YES,并输出添加的p条边。set走起。。#include#include#include#include#include#includeusing namespace std;#define N 123456#defin
原创
2021-08-13 14:10:47
64阅读
题目链接:点击打开链接题意:给定n个点 m条边的无向图 须要在图里添加p条边 使得图最后连通分量数为q问是否可行,不可行输出NO可行输出YES,并输出加入的p条边。set走起。。#include#include#include#include#include#includeusing namespa...
转载
2014-10-02 21:27:00
80阅读
2评论
构造题,利用二维数组a[x][0],a[x][1]分别表示x后面紧跟着的两个数,比如我先找1,然后后面是3和5,我就看3后面那俩有没有一个是5,如果是关系就确定,如果不是那说明5不在3的后面而在3的前面关系也确定,确定以后直接输出,然后依次类推。AC代码:#include <iostream>#include <cstring>#include <cstdio>
原创
2023-02-09 00:41:05
46阅读
// Problem: 构造题// Contest: NowCoder// URL: https://ac.nowcoder.com/acm/c
原创
2022-08-16 14:49:41
89阅读
题目链接C. Eugene and an array题意:给你n长度的序列,问你有多少个子序列(下标是连续的)是 好 的子序列一个好的子序列定位:该序列中的子序列(下标不连续)没有和为0的。做法:总的减去不合法的。不合法的求法:l表示左边的边界。用前缀和得到当前左坐标 L和 右坐标 R 区间内和为零。 左坐标的左边和右做坐标的右边都是可以组合一下 都是不合法的。此时...
原创
2021-09-06 13:57:38
131阅读
题目链接C. Eugene and an array题意:给你n长度的序列,问你有多少个子序列(下标是连续的)是 好 的子序列一个好的子序列:
原创
2022-02-15 14:40:29
77阅读
Kids in a Friendly Class 题目连接: http://codeforces.com/gym/100269/attachments Description Kevin resembles his class in primary school. There were girls
原创
2021-07-16 11:56:41
111阅读
题意Split aunique array into twoalmost unique arrays.unique arrays指
转载
2013-08-19 00:05:00
40阅读
2评论
D. Optimal Number Permutation 题目连接: http://www.codeforces.com/contest/622/problem/D Description You have array a that contains all integers from 1 to
原创
2021-07-15 16:06:31
79阅读
C. Necklace 题目连接: http://www.codeforces.com/contest/613/problem/C Description Ivan wants to make a necklace as a present to his beloved girl. A neckla
原创
2021-07-15 15:53:38
119阅读
Problem - F1 - Codeforces题目大意:给定一个长度为n的字符串,相邻的两个减号可以合并成一个加号,判断所有字串当中有多少字串在操作之后(或者不操作)加号和减号的数量一样。思路:假定减号数量为啊,加号数量为b,依照题目含义有a - 2*k ==b + k,即a - b ==3k。可能会问,题目要求是说相邻的两个减号才能合并呀,其实,假设他们都不相邻,也也就是像-+-+-+-+这
转载
2024-02-27 14:31:02
105阅读
目录CF1197D(dp)题意:思路:代码:CF1201D(dp)题意:思路: - 代码:CF1187(换根dp)- 题意:- 思路:- 代码:CF 1205B Shortest Cycle(最小环)- 题意:- 思路:- 代码:CF 1204D Kirk and a Binary String(思维)- 题意:- 思路:- 代码:CF 1207D N
A.InputThe only line contains the integer xx (1≤x≤100)(1≤x≤100).OutputYou should output two integers aa and bb, satisfying the given conditions, separated by a space. If no pa
原创
2022-06-15 12:23:16
129阅读