AtCoder Grand Contest 6】的更多相关文章

AtCoder Grand Contest 012 A - AtCoder Group Contest 翻译 有\(3n\)个人,每一个人有一个强大值(看我的假翻译),每三个人可以分成一组,一组的强大值定义为三个人中第二强的人的强大值.求\(n\)组最大的强大值之和. 题解 这...不是倒着选两个人,正着选一个人构成一组就好了嘛.. #include<iostream> #include<cstdio> #include<algorithm> using namespa…
AtCoder Grand Contest 011 upd:这篇咕了好久,前面几题是三周以前写的... AtCoder Grand Contest 011 A - Airport Bus 翻译 有\(n\)个乘客到达了飞机场,现在他们都要坐车离开机场.第\(i\)个乘客到达的时间是\(T_i\),一个乘客必须在\([T_i,T_i+k]\)时刻做到车,否则他会生气.一辆车最多可以坐\(C\)个人.问最少安排几辆车可以让所有人都不生气. 题解 从前往后贪心即可. #include<iostream…
AtCoder Grand Contest 031 Atcoder A - Colorful Subsequence description 求\(s\)中本质不同子序列的个数模\(10^9+7\).两个子序列不同当且仅当存在一种字符在两者中的出现次数不同. \(|s|\le10^5\) solution \(\prod_{i='a'}^{'z'}(\mbox{字符}i\mbox{出现的次数}+1)-1\) #include<cstdio> #include<algorithm>…
AtCoder Grand Contest 010 A - Addition 翻译 黑板上写了\(n\)个正整数,每次会擦去两个奇偶性相同的数,然后把他们的和写会到黑板上,问最终能否只剩下一个数. 题解 洛谷认为此题过水,已被隐藏. #include<iostream> #include<cstdio> using namespace std; inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch…
AtCoder Grand Contest 009 A - Multiple Array 翻译 见洛谷 题解 从后往前考虑. #include<iostream> #include<cstdio> using namespace std; #define ll long long #define MAX 100100 inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch<'0'||ch>…
AtCoder Grand Contest 008 A - Simple Calculator 翻译 有一个计算器,上面有一个显示按钮和两个其他的按钮.初始时,计算器上显示的数字是\(x\),现在想把这个数字给变成\(y\).两个按钮的作用分别是让这个数加一和把这个数取反.问最少的按按钮的次数. 题解 神仙特判题,想清楚再写. #include<iostream> using namespace std; int x,y,ans=2147483647; int main() { cin>…
AtCoder Grand Contest 007 A - Shik and Stone 翻译 见洛谷 题解 傻逼玩意 #include<cstdio> int n,m,tot;char ch[10]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;++i) { scanf("%s",ch+1); for(int j=1;j<=m;++j) tot+=ch[j]=='#'…
AtCoder Grand Contest 006 吐槽 这套题要改个名字,叫神仙结论题大赛 A - Prefix and Suffix 翻译 给定两个串,求满足前缀是\(S\),后缀是\(T\),并且长度至少为\(n\)的最短串串长. 题解 暴力枚举\(S\)和\(T\)的重叠部分长度,然后直接\(check\) #include<iostream> #include<cstdio> #include<cstring> using namespace std; #de…
AtCoder Grand Contest 005 A - STring 翻译 给定一个只包含\(ST\)的字符串,如果出现了连续的\(ST\),就把他删去,然后所有位置前移.问最后剩下的串长. 题解 模拟栈,和维护括号一样的. #include<iostream> #include<cstring> using namespace std; #define MAX 200200 char ch[MAX]; int ans,tot; int main() { cin>>…
AtCoder Grand Contest 004 A - Divide a Cuboid 翻译 给定一个\(A*B*C\)的立方体,现在要把它分成两个立方体,求出他们的最小体积差. 题解 如果有一条边是偶数显然可以均分,否分沿着最长边隔开. #include<iostream> using namespace std; int a,b,c; int main() { cin>>a>>b>>c; if(a%2==0||b%2==0||c%2==0) cout…