一二三四五 上山打老虎

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要: 链接:http://118.190.20.162/view.page?gpid=T15 代码: map: #include<bits/stdc++.h> using namespace std; map<pair<int,int>,int>mp; int main (){ ios::sync_wit 阅读全文
posted @ 2021-03-30 14:42 黒川川 阅读(50) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T16 注意数据范围,或者直接1e5+5 代码: #include<bits/stdc++.h> using namespace std; int a[10005]; int main (){ int n,num; ci 阅读全文
posted @ 2021-03-30 14:23 黒川川 阅读(49) 评论(0) 推荐(0)
摘要: ####问题的开始: 在编译原理的词法分析器中,进行字符串相加时出现了报错的情况,代码和报错如下: //str是字符型指针 string pstr=*(str+i)+*(str+(i+1)); 报错提示为: C:\Users\zwx\Desktop\test.cpp|130|error: conve 阅读全文
posted @ 2021-03-30 09:56 黒川川 阅读(2702) 评论(0) 推荐(0)
摘要: strtok() (C) 头文件:#include<string.h> 声明:char *strtok(char str,const chardelim); 参数:str被分割的的字符串,delim,包含分隔符的字符串 注意:str被分割后会指向分割后的第一个字符串。 用例: #include<st 阅读全文
posted @ 2021-03-29 17:34 黒川川 阅读(229) 评论(0) 推荐(0)
摘要: 链接:https://www.luogu.com.cn/contest/42343 A题:T172096 课程: 思路1:map<int,int>记录选A课程的人,然后枚举选B课程的人进行判断即可,数据范围小也可以用数组作为表来记录 思路2:对a,b进行排序,然后通过双指针计算两个数组的交集个数即可 阅读全文
posted @ 2021-03-28 20:29 黒川川 阅读(200) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T9 思路: 增加一个数组来记录当前的窗口从上到下依次是多少,如果有点击,则把点击的窗口移动到最上边(通过相邻的swap来移动达到维护目的) 代码: #include<bits/stdc++.h> using names 阅读全文
posted @ 2021-03-27 20:00 黒川川 阅读(63) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T10 代码: #include<bits/stdc++.h> using namespace std; unordered_map<int,int>mp; int main (){ int n,num,ans=0; c 阅读全文
posted @ 2021-03-27 19:17 黒川川 阅读(42) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T4 代码: #include<bits/stdc++.h> using namespace std; int a[]={0,0,2,3,4,6,7,8,9,10}; string str; int main (){ c 阅读全文
posted @ 2021-03-27 19:12 黒川川 阅读(36) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T5 总结:注意迭代器的用法:map<int,int>::iterator it, it->first,it->second, pair<int,int> node=*it; 代码: #include<bits/stdc 阅读全文
posted @ 2021-03-27 18:57 黒川川 阅读(39) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T56 代码: #include<bits/stdc++.h> using namespace std; int a[1005]; int main (){ int n,k; cin>>n>>k; int p,q; fo 阅读全文
posted @ 2021-03-23 21:29 黒川川 阅读(31) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页