ICode9

精准搜索请尝试: 精确搜索
  • wxy 3.30 牛客练习赛59重现2022-02-27 13:32:20

    v> 5062 C 赛时解法 直接线性规划啊,2 * a+4 * b<=x和 3*a+b<=y 相加就是 ( a+b ) <=(x+y)/5 x->x-x%2,应为a,b一定是正 整数,所以考虑交点不在第一象限的情况, b或者a/2 # include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { int T; scanf("%d",&T)

  • wxy 3.26 #122022-02-27 13:32:00

    v> A 签到题 考虑全面,是否需要和0进行比较 G 思维题 aa bb 这样的直接交换第一个a和第二个b就可以了 ab ba那么先通过一次交换把他变成上面哪一种情况,再交换即可 F 还是写的太慢了,卡了好久。。。其实有更简便的方法的 就是计算前面有多少是可以到该点是符合要求的,每遇到一次0就更

  • Codeforces Round #580 (Div. 2)2022-02-26 23:00:17

    Codeforces Round #580 (Div. 2) A # include <bits/stdc++.h>using namespace std;​const int MAXN=250;int a[MAXN],b[MAXN];int mm[MAXN];int main(){ int n,m; int aa=0,bb=0; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf

  • Educational Codeforces Round 65 (Rated for Div. 2)2022-02-26 22:35:41

    Educational Codeforces Round 65 (Rated for Div. 2)                A    # include <bits/stdc++.h>    using namespace std;        int main()    {        int t;        scanf("%d",&t);                while(t--

  • Codeforces Round #560 (Div. 3)2022-02-26 22:34:50

    Codeforces Round #560 (Div. 3) A # include <bits/stdc++.h>using namespace std; ​const int MAXN=2e5+100;int main(){ int n,y,x; string a; int sum=0; scanf("%d %d %d",&n,&y,&x);​ cin>>a; //cout<<n<

  • 求最长公共子序列长度2022-02-26 17:04:57

    求最长公共子序列长度 题干 给定两个长度分别为 N 和 M 的字符串 A 和 B,求既是 A 的子序列又是 B 的子序列的字符串长度最长是多少。 输入格式 第一行包含两个整数 N 和 M。 第二行包含一个长度为 N 的字符串,表示字符串 A。 第三行包含一个长度为 M 的字符串,表示字符串 B。 字符串

  • 洛谷P1317 低洼地(凹点 坡)2022-02-25 19:03:34

      #include<stdio.h> main() { int n,i,before,after,left=0,count=0; scanf("%d",&n); scanf("%d",&before); for(i=2;i<=n;i++) { scanf("%d",&after); if(after<before) left=1; if(after>before&a

  • acwing 789. 数的范围(二分+适合理解二分边界)2022-02-25 17:59:08

    题目:789. 数的范围 思路:先用二分找到最左边的k,然后再二分找到最右边的 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,q; int a[100010]; void find(int k){ int i=0,j=n-1; while(i<j){ int mid=i+j>>1;

  • getchar();吸收回车符2022-02-25 10:33:34

    在进行如下代码时: #include <stdio.h> int main() { int data; char cdata; printf("请输入一个整数:\n"); scanf("%d",&data); switch(data){ case 1: puts("满足条件1的情况"); break; case 2: puts("满足条件2的情况"); b

  • FJ的字符串(递归)2022-02-24 21:31:27

      #include<stdio.h> int printf1(int n) { int c='A'; if(n==1) { printf("%c",c); return 0; } else { printf1(n-1); printf("%c",c+n-1); printf1(n-1); } }

  • Educational Codeforces Round 123 (Rated for Div. 2)2022-02-23 02:32:03

    Educational Codeforces Round 123 (Rated for Div. 2) 前言:这场\(CF\)不知道是良心发现还是什么的,突然变简单了(bushi A-Doors and Keys 有\(R,G,B\)三扇门,每扇门对应\(r,g,b\)三把钥匙,钥匙和门按顺序排在一个狭窄的走廊中,只有有了钥匙才能打开对应的门。有\(n\)组询问,每次有一个

  • PAT甲级10042022-02-22 23:34:07

    代码参考漂流瓶大佬,以下是原文链接。[PAT甲级 1004.Counting Leaves (30) 题目翻译与答案]先传代码,明天再修改。(https://blog.csdn.net/qq278672818/article/details/54915636) #include <iostream> #include <algorithm> using namespace std; struct Node { int father;

  • 信息学奥赛一本通1021-10302022-02-22 20:03:20

    1021` #include"iostream" #include"cstdio" using namespace std; int main() { int a; scanf("%d",&a); printf("%c",a); return 0; } 1022 #include"iostream" #include"cstdio" using namespace s

  • Codeforces Round #772 (Div. 2) A - E2022-02-21 19:04:07

    没写思路,等我补完E再说吧 A. Min Or Sum 思路 签到 #include <bits/stdc++.h> using namespace std; int num[40]; int main() { int t; scanf("%d", &t); while (t -- ) { for (int i = 0; i < 30; i ++ ) num[i] = 0; int n;

  • AtCoder Beginner Contest 2402022-02-20 23:31:42

    A #include <bits/stdc++.h> using namespace std; int main() { int a, b; scanf("%d%d", &a, &b); if (a > b) swap(a, b); if (b - a == 1 || b - a == 9) puts("Yes"); else puts("No"); retu

  • Codeforces Round #771 (Div. 2)思路分享2022-02-20 15:04:02

    Codeforces Round #771 (Div. 2) B题最后被hack了.....不过最后还是加了17。。。不掉就行,下场要上粉!!! A. Reverse 题目要求最小的字典序序列,比较显然的想法就是第一个元素找1,第二个元素找2....依次类推。 点击查看代码 #include<bits/stdc++.h> #define ll long long #define db

  • C语言第三天2022-02-17 22:34:22

    初始变量常量: 变量:不能改变的量 常量:能改变的量 创建的一个变量:类型    变量的名字=0;//推荐 变量的分类:  局部变量——{}内部定义的  全局变量——{}外部定义的  当局部变量和全局变量冲突情况下,局部优先,不建议:把全局变量的名字写成一样的    变量的使用 scanf函数是输

  • CDZSC_2022寒假个人训练赛21级(10)题解2022-02-17 22:04:44

    简单 D 枚举、dp、数学 G 素数 中等 A B dfs E 模拟、数学 F 贪心 困难 C 构造 H 整数的唯一分解定理+约数和定理+递归二分求等比数列+快速幂 A Visiting a Friend CodeForces - 902A 题意 在数轴上你从0点出发,要到达m点,只能通过传送点移动,传送点给你一对a,b,a代表传送点

  • ecnuoj2947:行数据的排序2022-02-16 08:01:03

    给定n行整型数据,对其进行排序,排序规则是:比较第一个数字,第一个数字大的排在前面,第一个数字相同再比较第二个数字,以次类推 可直接对vector进行排序 定义vector类型数组vt[MAXN],其中数组的每一个元素是一个vector,定义比较函数直接对vector进行排序即可 #include <iostream> #include

  • CDZSC_2022寒假个人训练赛21级(9)题解2022-02-15 17:00:48

    简单 E 简单模拟 F 模拟 中等 A 瞎搞,预处理 B 打表瞎搞 G H 贪心 D 简单模拟 困难 C 瞎搞,思维 I 枚举 A Memory Management System Gym - 102152B 题意 给你一个\(m\)长的空间,其间有部分空间已被\(n\)个\(l_i—r_i\)长的文件占据。现给出\(q\)个新文件的大小\(x_j\),试

  • 2022牛客寒假算法基础集训营52022-02-11 00:01:36

    G 163小孩  题意:编号1~13的牌,每种4种花色,求在不考虑花色的情况下,从中取出6张的不同方案数。 #include <bits/stdc++.h> using namespace std; int cnt[04]; int main() { ios::sync_with_stdio(false); cin.tie(0); long long res = 0; for (int a = 0

  • 第六章 C控制语句:循环2022-02-10 20:33:06

    目录6.1 再探while循环6.2 真值的问题6.3 for循环6.4 逗号运算符6.5 如何选择循环:6.6 关键概念 6.1 再探while循环 <details> <summary>点击查看代码</summary> `/* summing.c -- sums integers entered interactively */ #include <stdio.h> int main(void) { long num;

  • 关于C++ scanf的一个小知识2022-02-09 22:33:17

    关于C++的scanf,其实在使用时有一个注意的点。 我们来看一个简单的例子。 对于输入的一行,如果这一行的开头需要输入一个字符,例如这样的输入: A 10 20 B 30 A 3 50 ... 我们可以使用这种方式来读入,使用一段代码来进行试验: #include<stdio.h> using namespace std; int main(){ int

  • 《算法笔记》4.2小节——算法初步->哈希2022-02-08 22:06:08

    《算法笔记》4.2小节——算法初步->哈希 A 谁是你的潜在朋友题目描述输入输出样例输入样例输出代码提交错误代码 B 分组统计题目描述输入输出样例输入样例输出代码提交 C Be Unique (20)代码提交 D String Subtraction (20) A 谁是你的潜在朋友 题目描述 “臭味相投”

  • 14.3练习题12022-02-08 20:02:24

    (a) #include<stdio.h> #define N(x) (x*x*x) int main(){ int x; printf("请输入x的值: "); scanf("%d",&x); printf("x的立方是%d",N(x)); }或者 #include<stdio.h> #define N (x*x*x) int main(){ int x; printf("请输入x的值: ")

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有