首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
马客(Mark)
猪校
2020届
其它
马客
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(74)
酒店价格
2
用map或set维护区间即可,时间 NlogN ,N是区间个数,和区间大小无关。 //题意其实是:每次给出L, R, Color表示把[L, R]这个区间涂成Color这个颜色, //后来的涂色会覆盖之前的颜色。最后按顺序输出所有区间的颜色。 #include <bits/stdc++.h...
发表于 2017-09-03 22:02:54
最强大脑
1
子串查找,简洁版。 #include <bits/stdc++.h> using namespace std; char s[100010], a[110], b[110]; const char* ss[] = { "invalid", "forwar...
发表于 2017-09-03 15:59:31
坐标移动
11
OJ有问题吧,,,第一次提交答案错误,我把代码和数据复制到本地运行是对的(我是直接在网页上敲的代码),然后把原来错误的代码复制粘贴交一次就通过了。如果牛客的人看到这条消息,建议找我的提交记录看看。 PS: 评论中大多数人可能没理解我的意思,我的情况是:完全一样的代码提交了两次,一次错误,一次通...
发表于 2016-05-11 16:01:29
购物单
48
小数据的有依赖背包问题,可以直接转为分组背包问题。(搜“背包九讲完整版.PDF”有详细讲解) 但是这个OJ的标程有问题,坑爹 #include <bits/stdc++.h> using namespace std; const int N = 100, M = 33...
发表于 2016-05-11 15:09:06
求int型正整数在内存中存储时1的个数
1
最好写(也是最好记)的方法:lowbit,但不是复杂度最低的: #include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int c = ...
发表于 2016-05-11 13:50:30
字符串排序
5
#include <bits/stdc++.h> using namespace std; vector<string> a; string s; int main(){ int n; while(cin>>n){ a.clea...
发表于 2016-05-11 13:32:30
句子逆序
1
Python import sys for line in sys.stdin: print ' '.join(reversed(line.split())) C++ #include <bits/stdc++.h> using namespace std; vecto...
发表于 2016-05-11 13:29:58
字符串反转
1
和上一题一样的代码 #include <bits/stdc++.h> using namespace std; char s[1000]; int main(){ while(scanf("%s", s) == 1){ for(int ...
发表于 2016-05-11 13:20:20
数字颠倒
0
以字符串读入 #include <bits/stdc++.h> using namespace std; char s[30]; int main(){ while(scanf("%s", s) == 1){ for(int i = st...
发表于 2016-05-11 13:18:41
字符个数统计
1
#include <bits/stdc++.h> using namespace std; bool v[128]; int cnt, ch; int main(){ while(~(ch = getchar())){ if(!v[ch]){ ...
发表于 2016-05-11 13:16:41
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题