void slove() { int n,k; cin >> n >> k; set<int> st; for(int i=0;i<n;i++){ int a; cin >> a; st.insert(a); } for(int i=0;i<k;i++){ if(st.find(i)==st.end()){ cout << i << "\n"; return ; } } cout << k << "\n"; } 发
}//vector<struct NODE> left;set<longlong>leftidx;for(inti=0; i<n; i++){if(drop[i]){continue; }//left.push_back(container[i]);leftidx.insert(container[i].i);//cout << "a = " << container[i].a << endl;//cout << "i = " << container[i].i << endl;} cout<< left...
-Codeforces/AtCoder(提升编码速度) 3. 操作系统 重点内容: - 进程与线程(创建、通信、同步) - 死锁条件及避免(银行家算法) - 内存管理(分页、分段、页面置换算法) - 文件系统(inode、硬链接/软链接) -Linux常用命令(grep/sed/awk/strace) 4. 计算机网络 核心协议: -TCP/UDP区别、三次握手/四次挥手 -HTT...
最近群友对int128这个东西讨论的热火朝天的。讲道理的话,编译器的gcc是不支持__int128这种数据类型的,比如在codeblocks 16.01/Dev C++是无法编译的,但是提交到大部分OJ上是可以编译且能用的。C/C++标准。IO是不认识__int128这种数据类型的,因此要自己实现IO,其他的运算,与int没有什么不同。 但是官方上写了GCC...
【AtCoder】ARC095 C-F题解 我居然每道题都能想出来 虽然不是每道题都能写对,debug了很久/facepalm C - Many Medians 排序后前N/2个数的中位数时排序后第N/2 + 1的数 其余的中位数都是排序后第N / 2的数 #include<iostream>#include<cstdio>#include<vector>#include<set>#include<cstring>#...
#include<cstdlib> #include<cmath> #include<set> usingnamespacestd; constintinf=(1<<30); typedeflonglongll; constllmaxn=1e5+5; vector<ll>vec; lln,sum[maxn*10],c[maxn*10],a[maxn]; lllowbit(llx) { returnx&(-x); } voidmodify(lli) ...
#include <set> #include <cstring> #include <string> #include <ctime> #include <algorithm> #include #define MAXN 200005 #define pii pair<int,int> #define pb push_back #define mp make_pair #define fi first #define se second #define...
AtCoder Context ABC 119- C - Synthetic Kadomatsu(比特运算解法) 运行要求 运行时间限制:2sec 内存限制:1024MB 原文链接 题目 你有N根竹竿子,这N根竹竿子的长度依次为l1,l2,l3..lN(单位是厘米) 你的任务是,从N根竹竿子里面选择一些竹竿子(全部选择也可以),用这些选出来的竹竿子,制作长度为A,B,C的3...
AtCoder arc098_b 题解报告 题目https://abc098.contest.atcoder.jp/tasks/arc098_b 分析 从二进制的角度来看,若两个数的异或值等于两个数的和,则要求这两个数的任何位数都不能同时为1, 53640 NSInvocation与ARC的恩怨 resultValue; [invocation invoke]; [invocation getReturnValue:&resultValue]; return ...
AtCoder ContextABC 126 C Typical Stairs(经典爬楼梯问题) 代码 方法1 import sys sys.setrecursionlimit(20000000) N = int(input()) memo = [-1 for i in range(110000)] def calculate(n): if n == 0: memo[n] = 0 return 0 if memo[n] != -1: ...