csp
文章平均质量分 70
皋月十五
好奇,探索,还在路上
展开
-
csp 201809-2 买菜
csp 201809-2 买菜问题描述 小H和小W来到了一条街上,两人分开买菜,他们买菜的过程可以描述为,去店里买一些菜然后去旁边的一个广场把菜装上车,两人都要买n种菜,所以也都要装n次车。具体的,对于小H来说有n个不相交的时间段[a1,b1],[a2,b2]…[an,bn]在装车,对于小W来说有n个不相交的时间段[c1,d1],[c2,d2]…[cn,dn]在装车。其中,一个时间段[s, t]表示的是从时刻s到时刻t这段时间,时长为t-s。 由于他们是好朋友,他们都在广场上装车的时候会聊天,他们原创 2020-12-12 23:42:30 · 82 阅读 · 0 评论 -
CSP 201812-2 小明放学
CSP 201812-2 小明放学原创 2020-12-12 22:34:50 · 102 阅读 · 0 评论 -
csp 201903-2 二十四点
csp 201903-2 二十四点#include<stdio.h>int main(void){ int n,flag1,k,flag2,h,m; int a[5]={0},b[4]={0};char c[7]; //scanf("%d",&n); int score[n+1]={0}; for(int i=0;i<n;i++){ flag1=4;flag2=3;//flag1数字指针,2符号指针 s原创 2020-12-08 18:09:35 · 80 阅读 · 0 评论 -
csp 201912-2 回收站选址
csp 201912-2 回收站选址读题不仔细,评分机制理解错误,不是计算46,37,28,19是否有,而是计算4,2,8,6是否有。100分#include<stdio.h>int main(void){ int score[5]={0}; int n,xi,yi,flag1,flag2; scanf("%d",&n); int bin[n+1][2]={0}; for(int i=0;i<n;i++){原创 2020-12-08 15:16:39 · 100 阅读 · 0 评论 -
csp 201909-2 小明种苹果(续)
csp 201909-2 小明种苹果(续)30分 例子能过#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;int main(void){ int i = 0,n,m,ans = 0,ansi = 0,h,D = 0,k = 0,ansj = 0; int a[5] = {0}; scanf("%d",&n);bool b[n]原创 2020-12-08 14:29:35 · 124 阅读 · 0 评论 -
csp 202006-2 稀疏向量
csp 202006-2 稀疏向量60分#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;int main(){ int n,a,b,indexi,valuei,i; long long ans=0; scanf("%d%d%d",&n,&a,&b); int h[n+1]={0}; for(i=0;原创 2020-12-07 16:30:24 · 753 阅读 · 0 评论 -
csp 201903-1
csp 201903-1int a[n];int main(void){ int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); if(n % 2 == 1) { printf("%d %d %d\n", a[n - 1], a[n / 2], a[0]); } else { if((a[原创 2020-12-07 14:09:32 · 125 阅读 · 0 评论 -
csp 201909-1
csp 201909-1很简单scanf("%d %d",&n,&m); &不要忘,没有&会直接停止运行原创 2020-12-07 14:08:06 · 155 阅读 · 0 评论 -
csp 201912-1
csp 201912-1#include<stdio.h>#include<math.h>#include<algorithm>#include<cstdio>using namespace std;int main(){ int n,i; int a[5]={0,0,0,0,0}; scanf("%d",&n); for(i=1;i<=n;i++){ if(i%7==0){原创 2020-12-07 14:06:31 · 154 阅读 · 0 评论 -
csp 202006-1 线性分类器
csp 202006-1 线性分类器#include<stdio.h>#include<math.h>#include<algorithm>#include<cstdio>using namespace std;struct Station{ int xi; int yi; char typei;};struct Line{ int o1; int o2; int o3; bool原创 2020-12-07 14:04:53 · 91 阅读 · 0 评论 -
csp202009-1 称检测点查询
csp202009-1 称检测点查询题目背景2020 年 6 月 8 日,国务院联防联控机制发布《关于加快推进新冠病毒核酸检测的实施意见》,提出对“密切接触者”等八类重点人群“应检尽检”,其他人群“愿检尽检”。问题描述某市设有 n 个核酸检测点,编号从 1 到 n,其中 i 号检测点的位置可以表示为一个平面整数坐标 (xi,yi)。为方便预约核酸检测,请根据市民所在位置 (X,Y),查询距其最近的三个检测点。多个检测点距离相同时,编号较小的视为更近。输入格式输入共 n+1 行。第一行包含用原创 2020-12-07 14:00:51 · 300 阅读 · 2 评论