- 博客(8)
- 收藏
- 关注
原创 Restore the Permutation by Merger(思维) CF - 1385B
题意:一个[1,n]长度为n的数组,复制一个相同的数组,将原数组插入到新数组中,使得前后顺序不变,给定插入后的数组,找到原数组。思路:遍历一遍,输出序列中当前没有出现过的数字即可。Code:#include<iostream>#include<cstring>using namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; ..
2020-08-01 11:07:56
314
原创 New Year and Counting Cards(for(auto)循环+思维) CF-908A
题意:一堆卡片,每个卡片两面分别写着字母和数字;验证 "元音字母’a’,‘e’,‘i’,‘o’,'u’后面一定是偶数"命题成不成立。我们可以翻卡片来检查,问最少需要翻多少次分析:元音字母:翻 辅音字母:不翻 奇数:翻 偶数:不翻Code:#include<iostream>using namespace std;int main(){ string a; cin>>a; int t=0; for(auto &c:a) //即fo...
2020-07-24 18:54:21
185
原创 A problem of sorting (String类)HDU - 5427
题目链接题意:输入一串字符,包含了名字和出生年份(由一个空格分隔,且名字中可以包含空格),输出从年轻到老的人的名字。Code:#include <string>#include <cstdio>#include <iostream>#include <algorithm>#include <cstring>using namespace std;struct stu{ int y; string name;};bo
2020-07-22 19:55:37
182
原创 排名(结构体排序)HDU - 1236
题目链接Code:Time Memory Length218ms 1884kB 868#include <cstdio>#include <vector>#include <string>#include <iostream>#include <algorithm>using namespace std;int num[11];//存储每个题的分数 struct
2020-07-16 12:26:37
247
转载 Shaolin (map)HDU - 4585
ShaolinShaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The master of Shaolin evaluates a young man mainly by his talent on understanding the Buddism scripture, but fightin
2020-07-07 21:21:59
167
原创 Misha and Changing Handles(map+思维)
Knowledge point①map: count() 返回指定元素出现的次数 find() 查找一个元素并返回其所在位置 erase() 删除一个元素 clear() 删除所有元素 begin() 返回指向map头部的迭代器 end() 返回指向map末尾的迭代器 size() 返回map中元素的个数 (*it).first会得到key,(*it).second会得到value, 等同于it->first和it->se...
2020-07-07 20:36:14
325
原创 Registration system(map)
第一周练习赛(AC)E - Registration systemA new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to imp
2020-07-07 18:48:18
274
原创 AbuTahun and Flash Memories(思维题)
Abu Tabun and Flash Memories题意:n个文件,每个文件xGB,一个闪存能存aGB,每个文件不能分开,求至少需要多少闪存思路:Ans=(n+[a/x]−1)/[a/x]代码:#include<bits/stdc++.h>//万能头文件using namespace std;int n,x,a;int main() { scanf("%d%d%d",&n,&x,&a); int b=a/x; ..
2020-07-04 22:10:21
196
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人