摘要: 题意:在笛卡尔坐标系上给定n个点的x,y坐标,判断是否左右对称 auto 遍历map,vector: #include <iostream> #include <map> #include <queue> using namespace std; int main() { map<int, stri 阅读全文
posted @ 2020-06-04 22:50 ジャスミン 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题意:给定n个学生的出发点A和目的地B,若每个学校的被作为出发点和目的地的次数相同,则项目可以进行;否则不可 思路就是:不要把题想的太复杂了 #include<bits/stdc++.h> int main(void) { int t=0; int tmp1,tmp2; vector<int> a, 阅读全文
posted @ 2020-06-04 21:43 ジャスミン 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题意:给定若干单词,按字典序输出由两个单词拼接而成的单词 思路:这算是一道水题吧,但是由于个人对字符串处理的知识点实在太贫瘠,参考参考别人写的代码查漏补缺,555 assign方法可以理解为先将原字符串清空,然后赋予新的值作替换。 count可以实现判断拼接的单词是否包含在原来的集合中,这个一开始真 阅读全文
posted @ 2020-06-04 21:41 ジャスミン 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 水题 #include<bits/stdc++.h> int main(void) { int n; while(cin>>n && n!=0) { queue<int> q; printf("Discarded cards:"); for(int i=1;i<=n;i++)q.push(i); w 阅读全文
posted @ 2020-06-04 19:46 ジャスミン 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题意:给定n元组(a1,a2,...,an),ai均为整数,得到下一个序列为(|a1-a2|,|a2-a3|,...,|an-a1|),如此循环下去,必定会出现全零序列或周期循环序列。 现要求判断给定序列是全零序列(ZERO)还是周期循环序列(LOOP)。 思路:这道题也太水了吧,一开始还在想要处理 阅读全文
posted @ 2020-06-04 19:20 ジャスミン 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题意: 给出若干行字符串和 空格,输出:开头,结尾都没有空格;每一行 两个字符串之间最少有一个空格,每一列字符串 左对齐。 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> // for mem 阅读全文
posted @ 2020-06-04 11:56 ジャスミン 阅读(115) 评论(0) 推荐(0) 编辑