代号马蹄铁。以专题为单位的学习。
下期专题预告: prototype专题
个人博客入口:https://matiji.cn
如果觉得对你有帮助,欢迎点Star或者来我的博客亲口告诉我
所有文章采用 署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可
题意: 很好理解,给出四个数,我想要凑齐4个不同的数,如果四个数不同就输出0,此时不用再找别的数来满足要求。如果是四个一样的数,那么我就要找到3个不同的数来满足我的要求,此时输出3。 思路: 我们只需要判断这四个数中各不相同的数有res 个,输出的答案就是4-res。我用的是set这个c++中stl独有的库,集合里面的数是各不相同的,可通过此方法将相同的数直接排除,在判断集合的大小就是我们想知道的
题目链接:http://codeforces.com/problemset/problem/228/A 228A. Is your horseshoe on the other hoof? time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <math.h> #include <string> #include <algorithm> using namespace std; int a[4]; int main() { scanf("%d %d %d %d", &a[0
A. Is your horseshoe on the other hoof? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valera the Horse is going to the party with friend
A. Is your horseshoe on the other hoof? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valera the Horse is going to the party with friend
A. Is your horseshoe on the other hoof? time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Valera the Horse is going to the party with friends. H
A. Is your horseshoe on the other hoof? 点击打开题目 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valera the Horse is going to the party with
Problem description Valera the Horse is going to the party with friends. He has been following the fashion trends for a while, and he knows that it is very popular to wear all horseshoes of different
题目链接:http://codeforces.com/problemset/problem/228/A import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Isyourhorseshoeontheotherhoof { public static void main(S
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <queue> #include <algorithm> using namespace std; int main()
A. Is your horseshoe on the other hoof? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valera the Horse is going to the party with friend