当前位置:网站首页>【leetcode周赛记录】第80场双周赛记录
【leetcode周赛记录】第80场双周赛记录
2022-06-13 08:25:00 【一二三o-0-O】
【leetcode周赛记录】第80场双周赛记录
赛后个人排名
赛题分析总结
第296场周赛
6095.强密码检验器II
class Solution {
public:
bool strongPasswordCheckerII(string password) {
bool a{
false},b{
false},c{
false},d{
false};
string l{
"[email protected]#$%^&*()-+"};
unordered_map<char,int> unMap;
for(char w : l) unMap[w]++;
if(password.size() < 8){
return false;
}
char cx;
for(int i{
};i<password.size();++i){
if(i > 0){
if(password[i] == cx) return false;
}
if(password[i] >= '0' && password[i] <= '9'){
a = true;
}
if(password[i] >= 'a' && password[i] <= 'z'){
b = true;
}
if(password[i] >= 'A' && password[i] <= 'Z'){
c = true;
}
if(unMap[password[i]] > 0){
d = true;
}
cx = password[i];
}
return a && b && c &&d;
}
};
6096.咒语和药水的成功对数
class Solution {
public:
// 使用二分nlogn复杂度求解
vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {
sort(potions.begin(),potions.end());
vector<int> result;
int sSize = spells.size();
int pSize = potions.size();
// 在potions中查询第一个大于等于success/spells[i] 的值
for(int i{
};i<spells.size();++i){
long long tmp1 = (long long)spells[i] * potions[pSize-1];
if(tmp1 < success){
result.push_back(0);
continue;
}
tmp1 = (long long)spells[i] * potions[0];
if(tmp1 >= success){
result.push_back(pSize);
continue;
}
int target = success/spells[i];
long long p = (long long)target*spells[i];
if(p < success){
target = target+1;
}
result.push_back(pSize-(lower_bound(potions.begin(), potions.end(), target) - potions.begin()));
}
return result;
}
};
6097.替换字符后匹配
困难题
6098.统计得分小于K的子数组数目
第四题暂不考虑
反思总结
个人情况
第32次参加leetcode竞赛;
总计得到过5次12分,1次8分,16次7分,10次3分;
后续改进
- 二分查找的专项复习、训练以及总结系统训练,总结
边栏推荐
- 【博弈论-完全信息静态博弈】 Nash均衡的应用
- 微服务项目搭建二:数据库设计
- Dest0g3 520迎新賽
- Logstash configuration reference article
- Phpexcel 10008 error resolution
- SQL injection question type (manual injection +sqlmap)
- Remote access and control
- Determine whether a string is rotated from another string
- DNS domain name resolution service
- AcWing 1977. Information relay (base ring tree, parallel search set)
猜你喜欢

学习记录4: einops // cudnn.benchamark=true // hook

CCNP_ BT-MGRE

How to install the bdtab (BD) new tab plug-in in edge browser (Graphic tutorial)

Wechat upload picture material interface

When submitting the laravel admin form and using the required verification, an error is reported when the value is 0

How does the BD new tab plug-in log in?

How app inventor accesses resource files in assets directory

Buuctf web (IV)

微服务系统架构搭建一:环境搭建

Cosmos star application case
随机推荐
Edge browser uses bdtab new tab plug-in (BD new tab)
MySQL queries difference sets (missing data) by linking tables based on an associated field
情绪处理技巧
Tiktok keyword search list interface, ultra detailed interface docking steps
Logstash failed to create queue
logstash配置参考文章
Reverse order and comparison of strings
Request alarm: refer policy: strict origin when cross origin or reference site policy: no refer when downgrade
Which is the stronger fresh food distribution and sorting management system?
LVM management exercise
星巴克创始人:出于安全考量 或不再向非店内消费者开放“公厕”
微服务项目搭建二:数据库设计
filebeat采集日志到ELK
Daffodil upgrade (self idempotent)
Remote access and control
平面合并(MATLAB)
天猫商品详情接口,天猫商品优惠券接口,天猫api接口,天猫价格监控接口,天猫比价接口,品牌维权接口,天猫销量api接口,接口代码可对接数据分析业务,品牌维权,比价业务,行业分析业务接口代码分享
How can the small and medium-sized lighting industry make use of the digital transformation to stand out from the encirclement?
Maternal and infant supplies wholesale industry uses management software to improve efficiency and realize cost reduction and efficiency increase
Logstash failed to create queue