[比赛]2015/12/25BNU新生赛
网络同步做了半个小时,然后就拉肚子了……嗯……
A:不解释……5min 1A
1 #include <algorithm> 2 #include <iostream> 3 #include <iomanip> 4 #include <cstring> 5 #include <climits> 6 #include <complex> 7 #include <fstream> 8 #include <cassert> 9 #include <cstdio> 10 #include <bitset> 11 #include <vector> 12 #include <deque> 13 #include <queue> 14 #include <stack> 15 #include <ctime> 16 #include <set> 17 #include <map> 18 #include <cmath> 19 20 inline int max(int a, int b) { 21 return a > b ? a : b; 22 } 23 24 int main() { 25 int T; 26 int a, b; 27 scanf("%d", &T); 28 while(T--) { 29 scanf("%d%d", &a, &b); 30 int xx = max(a, b); 31 if(xx * 5 < 1000) { 32 printf("1000\n"); 33 } 34 else if(xx * 5 >= 60000) { 35 printf("60000\n"); 36 } 37 else { 38 printf("%d\n", xx * 5); 39 } 40 } 41 }
A
B:看样例,看看代码里面奇怪的地方,不解释……1min 1A
1 #include <algorithm> 2 #include <iostream> 3 #include <iomanip> 4 #include <cstring> 5 #include <climits> 6 #include <complex> 7 #include <fstream> 8 #include <cassert> 9 #include <cstdio> 10 #include <bitset> 11 #include <vector> 12 #include <deque> 13 #include <queue> 14 #include <stack> 15 #include <ctime> 16 #include <set> 17 #include <map> 18 #include <cmath> 19 20 inline int max(int a, int b) { 21 return a > b ? a : b; 22 } 23 24 int main() { 25 int T; 26 scanf("%d", &T); 27 while(T--) { 28 int n; 29 scanf("%d", &n); 30 printf("%d\n", -n); 31 } 32 return 0; 33 }
B
C:读错题了好几次,贪心起始时间,然后从头开始走,看当前时间是否已经布置了作业。如果布置了那么就不加间隔时间,没布置要加上间隔时间…… 20min 3A
1 #include <algorithm> 2 #include <iostream> 3 #include <iomanip> 4 #include <cstring> 5 #include <climits> 6 #include <complex> 7 #include <fstream> 8 #include <cassert> 9 #include <cstdio> 10 #include <bitset> 11 #include <vector> 12 #include <deque> 13 #include <queue> 14 #include <stack> 15 #include <ctime> 16 #include <set> 17 #include <map> 18 #include <cmath> 19 20 using namespace std; 21 22 typedef struct QAQ { 23 int a; 24 int b; 25 }Q; 26 27 bool cmp(Q x, Q y) { 28 if(x.a == y.a) { 29 return x.b < y.b; 30 } 31 return x.a < y.a; 32 } 33 34 const int maxn = 1111; 35 int n, t; 36 Q q[maxn]; 37 38 int main() { 39 // freopen("in", "r", stdin); 40 int Qrz; 41 scanf("%d", &Qrz); 42 while(Qrz--) { 43 scanf("%d", &n); 44 for(int i = 0; i < n; i++) { 45 scanf("%d %d", &q[i].a, &q[i].b); 46 } 47 sort(q, q+n, cmp); 48 t = 0; 49 int cur = 0; 50 int cnt = 0; 51 if(q[0].a > 0) { 52 t += q[0].a + q[0].b; 53 cnt++; 54 cur = q[0].a; 55 } 56 for(cnt; cnt < n; cnt++) { 57 if(t >= q[cnt].a) { 58 t += q[cnt].b; 59 cur += q[cnt].a; 60 } 61 else { 62 t += (q[cnt].a - t) + q[cnt].b; 63 } 64 } 65 printf("%d\n", t); 66 } 67 return 0; 68 }
C
D:以前做过类似的题(doge那个…),KMP可以搞,O(n)也可以搞,随意了…… 10min 1A
1 #include <algorithm> 2 #include <iostream> 3 #include <iomanip> 4 #include <cstring> 5 #include <climits> 6 #include <complex> 7 #include <fstream> 8 #include <cassert> 9 #include <cstdio> 10 #include <bitset> 11 #include <vector> 12 #include <deque> 13 #include <queue> 14 #include <stack> 15 #include <ctime> 16 #include <set> 17 #include <map> 18 #include <cmath> 19 20 using namespace std; 21 22 const int maxn = 66666; 23 int na; 24 char a[maxn]; 25 char* b = "QAQ"; 26 int nb = strlen(b); 27 int pre[maxn]; 28 29 void getpre(char *b, int *pre) { 30 int j, k; 31 pre[0] = -1; 32 j = 0; 33 k = -1; 34 while(j < nb) { 35 if(k == -1 || b[j] == b[k]) { 36 j++; 37 k++; 38 pre[j] = k; 39 } 40 else { 41 k = pre[k]; 42 } 43 } 44 } 45 46 int kmp() { 47 int ans = 0; 48 int i = 0; 49 int j = 0; 50 while(i < na) { 51 if(j == -1 || a[i] == b[j]) { 52 i++; 53 j++; 54 } 55 else { 56 j = pre[j]; 57 } 58 if(j == nb) { 59 ans++; 60 } 61 } 62 return ans; 63 } 64 65 int main() { 66 getpre(b, pre); 67 int T; 68 scanf("%d", &T); 69 while(T--) { 70 memset(a, 0, sizeof(a)); 71 scanf("%s", a); 72 na = strlen(a); 73 printf("%d\n", kmp()); 74 75 } 76 return 0; 77 }
D
H:四边形对顶角互补,因此任意四边形均可密铺,Q神永远很happy…… ∞min 1A
1 #include <algorithm> 2 #include <iostream> 3 #include <iomanip> 4 #include <cstring> 5 #include <climits> 6 #include <complex> 7 #include <fstream> 8 #include <cassert> 9 #include <cstdio> 10 #include <bitset> 11 #include <vector> 12 #include <deque> 13 #include <queue> 14 #include <stack> 15 #include <ctime> 16 #include <set> 17 #include <map> 18 #include <cmath> 19 20 using namespace std; 21 22 typedef long long LL; 23 24 int main() { 25 int T; 26 LL x1,x2,x3,x4,y1,y2,y3,y4; 27 scanf("%d",&T); 28 while(T--) { 29 scanf("%lld %lld %lld %lld %lld %lld %lld %lld",&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4); 30 printf("BQG is happy!\n"); 31 } 32 return 0; 33 }
H
下面是理论AK阶段……
E:处理字串,先找一遍数字和匹配一遍"(n"以及"(log"字样,(可以胡来也可以ac自动机),接着把数字处理出来就可以AC啦……
F:嗯…是个数学题,找找规律胡搞一下肯定能过……
G:一定是个贪心+二分……胡搞一定能过……
转载于:https://www.cnblogs.com/kirai/p/5077244.html
[比赛]2015/12/25BNU新生赛相关推荐
- 论如何举办一个承载400人的比赛(XUPT新生赛承办小记)
XUPT新生赛承办小记 老师去年就想搞一个新生赛了,奈何去年时间不够,没有搞,于是今年就开始提前搞起来了.ZLS说要不然搞一个domjudge,我寻思着好鸭好鸭,看起来很牛逼,然后就开始了苦逼的配环境 ...
- [SUCTF2018]babyre [ACTF新生赛2020]fungame
文章目录 [SUCTF2018]babyre 惯用思维 常人思维 GAMEOVER [ACTF新生赛2020]fungame int __cdecl sub_401340(int a1) int __ ...
- 2019年安徽大学ACM/ICPC实验室新生赛题解
本文仅作个人收藏学习使用 题目及解析来源牛客竞赛网 //作者:王清楚 //链接:https://ac.nowcoder.com/discuss/351408?type=101&order=0& ...
- CTF新生赛之Writeup
CTF新生赛之Writeup 作为零基础的新生,也是在开学后才了解了CTF,感觉本次新生赛中颇有收获,也是应赛制要求,故写下这份WP,以纪念本人的第一次CTF竞赛. 回顾和感想 回顾本次的新生赛,难度 ...
- TJUCTF新生赛-AI安全专栏write up
以下题目为我本次为天津大学ctf新生赛出的AI安全专栏中的所有题目,所有代码仅限学习交流,请勿用于非法活动或商业用途. 1. 签到题 非常简单的签到题,不过其可能会对于其他题目有帮助哦 本题只有如下一 ...
- BUU [ACTF新生赛2020]Universe_final_answer
[ACTF新生赛2020]Universe_final_answer 首先查壳, 64bit 无壳 ida64位打开 main() __int64 __fastcall main(int a1, ch ...
- “蚁景杯”WUSTCTF2021新生赛writeup
"蚁景杯"WUSTCTF2021新生赛writeup Crypto 签到 滴答 AES With RSA GMC Vigenere give you d 银河信号 Misc Erx ...
- HNUCM信息科学与工程学院第二届新生赛——正式赛
HNUCM信息科学与工程学院第二届新生赛--正式赛 简单题 A:Yftc的字符串转换 题目描述 Ytfc来到了一个魔法密林,里面住着一只魔法兔子,Yftc想去见见这只魔法兔子,但是这个魔法密林很奇怪, ...
- 【weJudge】1106. [ACM][2014新生赛重现][现场]Gundam Unicorn
你上有一门威力巨大的光束炮,然而它现在剩下的能量只能再发射一次.为了使敌人受到更大的损失,你必须谨慎地使用这仅剩的一次机会. 敌军队形和光束炮的覆盖范围均为矩形(矩形不可旋转). 输入要求 输入数据有 ...
- 【weJudge】1107. [ACM][2014新生赛重现][现场]啊~啊~,麻婆豆~腐,麻婆豆~腐~
麻婆豆腐是小奏最爱的食物,为了做出最上等的麻婆豆腐,小奏准备了若干上等的食材,并且获得了传说中的麻婆豆腐的料理方法:每次将两种食材合二为一,成为一种新的食材,直到所有的食材都合并到一起,传说中的麻婆豆 ...
最新文章
- 用matlab读取三角波及其频谱,信号与系统利用MATLAB分析信号频谱作业(第四章)以及结论.doc...
- 在fvwm中将右手习惯改为左手习惯的简单办法
- metasploit 漏洞评级翻译
- Android中Toast的用法简介
- 乐鑫代理启明云端分享|ESP32驱动1.54inch(240*240)彩屏
- spark从hbase读取写入数据
- nigix文件解析漏洞
- 基于ABP落地领域驱动设计-04.领域服务和应用服务的最佳实践和原则
- python实现多智能体一致性_促进产学研,多智能体协同控制——科研与实践教学齐飞...
- 增值电信业务许可,经营性icp证书自助申请教程【详细】
- 收藏10个2012年最新发布的jQuery插件
- 分享一下淘宝iData技术嘉年华的几点感触
- 机器学习(1)---数据预处理
- 后台性能测试不可不知的二三事
- webpack官方文档分析(一):安装
- 2018 中国短视频开发者创意大赛震撼来袭,万元现金大奖邀你来战!
- cmd静默运行_exe、msi、dos、bat等静默运行,后台运行,不弹窗的解决办法
- 8种排序算法(Java实现)
- 一个泛型句柄类--C++模板和泛型编程--c++ primer
- windows下ping端口
热门文章
- 程序员让开,硅谷将是物理学家的天下,薪水高得离谱
- nginx学习笔记之安装
- C++ 中的深拷贝与浅拷贝
- Luogu 2939 [USACO09FEB]改造路Revamping Trails Luogu 4568 [JLOI2011]飞行路线
- Flask-WTF CSRF 保护P3
- Codeforces Round #409 C. Voltage Keepsake(二分+思维)
- linux php 扩展包 下载地址
- WEB前端开发书籍推荐
- 带叉叉的GridView
- 【监控笔记】【2.2】扩展事件——死锁监控