随笔分类 - 竞赛
摘要:题目链接
阅读全文
摘要:A.A Math Problem 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 inline ll read(){ 5 int x=0,f=1;char ch=getchar(); 6 whil
阅读全文
摘要:A.The Third Cup is Free 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 inline int read() 5 { 6 int x=0,f=1;char ch=getcha
阅读全文
摘要:A.The Fool 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 inline int read() 5 { 6 int x=0,f=1;char ch=getchar(); 7 while(ch<'0'||ch>'9'){if(ch=
阅读全文
摘要:I. Characters with Hash 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 #define inf 0x7fffffff 5 #define faster ios::sync_
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 using namespace std; 14 typedef long lon...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 using namespace std; 14 typedef long lon...
阅读全文
摘要:口算训练 1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <string> 6 #include <map> 7 #include <cmath> 8 #
阅读全文
摘要:A. Easy h-index 1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <string> 6 #include <map> 7 #include
阅读全文
摘要:B. Mancala
阅读全文
摘要:1 #include 2 using namespace std; 3 4 const int maxn = 2*1e5+5; 5 vectorp[maxn]; 6 vectorc; 7 bool check[maxn]; 8 9 10 void dfs(int x) { 11 check[x] = true; 12 c.push_back(x); 13...
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 5 const int maxn = 1e5 + 5; 6 int a[maxn]; 7 8 int main(){ 9 int t; 10 cin >> t; 11 while(t--){ 12 int n; 13 ci...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int a[150000]; 8 int b[150000]; 9 int dp[1005][1005]; 10 //dp[i][j] 前i个人从前j个药匙中到达终点的最小时间 11 12 int main() 13 { 14...
阅读全文
摘要:模拟题,运用强大的stl。
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 typedef long long ll; 6 const int N = 1e5 + 5; 7 ll x[N], y[N]; 8 int n; 9 10 bool gx(int a, int b, int c, int d) 11 { 12 re...
阅读全文
摘要:1 //暴力 2 #include 3 #include 4 #include 5 6 using namespace std; 7 const int N = 105; 8 string s1[N], s2[N], s3[N], s4[N]; 9 int a[N][N], b[N][N]; 10 11 int main() 12 { 13 int n; 14...
阅读全文
摘要:前缀后缀和搞一搞,然后枚举一下区间,找出最大值
阅读全文
摘要:额,只是一道签到题,emmm直接代码:
阅读全文
摘要:题目大意是有一堆猴子,然后每个猴子都有自己喜欢的香蕉类型,然后香蕉会在指定的位置,问每个猴子能不能在每个地方吃到自己喜欢的香蕉。 其实直接暴力即可(因为最大最大最大是50) 上代码:
阅读全文
摘要:最开始一直想不通,为什么推出这个公式,后来想了半天,终于想明白了。 题目大意是,有M个格子,有K个物品。我们希望在格子与物品之间连数量尽可能少的边,使得——不论是选出M个格子中的哪K个,都可以与K个物品恰好一一匹配。 然后你可以试着画图,每次必须有k个格子是单独的(与各物体只有一条线相连)所以还剩下
阅读全文