摘要: B - Game of Throwns Kattis - throwns 这道题目理解起来简单,但上手就会发现有很多小细节,如果疏忽,将导致错误。细节之一:学生的编号是0至n-1,而非1至n。 容易处理的细节:判断输入的是数字还是undo,可以直接判断输入的字符串的第一个字符是否为‘u’。若不是,则 阅读全文
posted @ 2020-02-01 17:55 John-C 阅读(99) 评论(0) 推荐(0)
摘要: F - 法法要穿过大门 CodeForces - 935B 这一题不难,可是题目是老长老长的英文,而且还有一些我不懂的词,导致我理解题意就花了很长的时间。 题意:统计法法一共穿过y=x这条直线几次(第一次不算)。 观察:法法穿过y=x一定有这样一个条件:这次所在位置与上两步所处位置分别分布在y=x的 阅读全文
posted @ 2020-01-14 00:05 John-C 阅读(81) 评论(0) 推荐(0)
摘要: G - 0011 NBUT - 1626 这道题考察的是字符数组、字符串方面的知识。我在字符数组、字符串上的知识比较薄弱,一开始就卡在了要如何输入这串字符上,没想到直接开一个字符数组,用cin输入就可以了。 在思维方面上,这题主要考验我们找特点、总结,找规律的能力。 根据题意所述,我们可以发现,一个 阅读全文
posted @ 2020-01-09 15:20 John-C 阅读(168) 评论(0) 推荐(0)
摘要: 猴子第一天摘下N个桃子,当时就吃了一半,还不过瘾,就又多吃了一个。第二天又将剩下的桃子吃掉一半,又多吃了一个。以后每天都吃前一天剩下的一半零一个。到第10天在想吃的时候就剩一个桃子了,问第一天共摘下来多少个桃子?并反向打印每天所剩桃子数。 #include <stdio.h>int getPeach 阅读全文
posted @ 2019-10-23 16:56 John-C 阅读(550) 评论(0) 推荐(0)
摘要: #include<cstdio>#include<iostream>#include<algorithm>using namespace std;struct mooncake{ double store; double sell; double price;}cake[1010];bool cmp 阅读全文
posted @ 2019-10-22 20:41 John-C 阅读(154) 评论(0) 推荐(0)
摘要: /***************************************************** File name:Quicksort Author:Zhengqijun Version:1.0 Date: 2016/11/04 Description: 对数组进行快速排序 Funci 阅读全文
posted @ 2019-10-17 23:04 John-C 阅读(146) 评论(0) 推荐(0)
摘要: #include<iostream>#include<algorithm>using namespace std;long long zu=0,n,a[100000],b[100000],c[100000];int main(){ cin>>n; for(int i=1;i<=n;i++) { ci 阅读全文
posted @ 2019-10-17 20:49 John-C 阅读(219) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<string.h>int main(){ int n,i,j=0,k,a[1000]; char str1[5]="push",str2[4]="pop",str3[4]="top",str[8]; while(~scanf("%d",&n)) { 阅读全文
posted @ 2019-10-13 19:52 John-C 阅读(173) 评论(0) 推荐(0)
摘要: 解法一: #include<stdio.h>int main(){ int a,b,c,d,e,f; scanf("%d:%d:%d",&a,&b,&c); scanf("%d:%d:%d",&d,&e,&f); if(a>d) { if(b>e) { if(c>=f) printf("%02d:% 阅读全文
posted @ 2019-09-30 00:20 John-C 阅读(158) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>int main(){ int a[55]; int i; int w; int j; int len; int max; char str[110]; while(gets(str)) { m 阅读全文
posted @ 2019-09-28 14:16 John-C 阅读(211) 评论(0) 推荐(0)