- 博客(25)
- 收藏
- 关注
原创 EOJ2844排序去重【set集合/vector用unique去重/桶排序】
EOJ2844排序去重【set集合/vector用unique去重/桶排序】
2023-03-07 20:13:17 156
原创 EOJ 854 上古计算机 [字符串处理(atoi实现string转int)&&字符串带空格换行读入规则]
EOJ 854 上古计算机 【字符串处理(atoi实现string转int)和读取带空格的string串】【字符串带空格换行读入规则】
2023-03-01 16:00:41 158
原创 PTA 1012 The Best Rank(Advanced Level) 【结构体sort】
PTA 1012 The Best Rank(Advanced Level) 【结构体sort】
2023-02-22 17:46:56 55
原创 PTA1006 Sign In and Sign Out(Advanced Level)【结构体】
PTA1006 Sign In and Sign Out 结构体写法
2023-02-20 18:08:44 42
原创 PTA1005 Spell It Right(Advanced Level)
PTA1005 Spell It Right(Advanced Level)几个测试点不通过
2023-02-20 15:08:41 59
原创 CCF202104-2邻域均值【前缀和二维数组】
直接暴力会超时,用到一个前缀数组与后缀数组的思想,一个数组a存原像素点元素,一个数组b存a的前缀和,数组下标都从1开始,方便数组的边界处理。#include<bits/stdc++.h>using namespace std;int a[601][601],b[601][601];int main(){ int n,L,r,t; cin>>n>>L>>r>>t; for(int i=1;i<=n;i++){ for...
2021-11-22 21:33:39 466
原创 PTA甲级1007
1007 Maximum Subsequence Sum (25 分)Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of...
2021-10-07 21:18:36 93
原创 PTA甲级1004
1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing0&l.
2021-10-07 14:12:07 71
原创 PTA甲级1003
参考的zjuerLemon3w+浏览量题解:https://www.iteye.com/blog/zjuerlemon-2239454解题思路:1003 Emergency (25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Am
2021-10-06 21:22:13 127
原创 PTA甲级1002
思路:1、数据范围0到1000,直接开一个1000大小的数组做。2、定义exp和coef分别是指数和系数,通过exp对数组下标访问,数组存放的内容用coef修改3、遍历一次数组,用count记录非0项的个数4、逆序输出数组非0项的下标和该项的值Tips:注意输出的格式,一开始我测试点6没过就是因为忽略了count=0,多输出了一个空格代码如下:#include<iostream>#include<iomanip>using namespac...
2021-10-06 16:03:53 152
原创 PTA甲级1001
最近由于一个竞赛原因,赛制与pta相似,所以去了pta甲级做一些类似的题目,想着写一些刷题笔记,记录自己的刷题过程。题目如图,思路:1、sum和为负数先输出一个负号,再sum*=-1;与正数一起讨论2、用一个vector<int>数组,每次取模10并按位push_back()3、从高到低位依次取出vector中的值,注意如果遇到3的整数倍多输出一个‘,’#include<iostream>#include<vector>using name.
2021-10-06 15:26:05 166
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人