The first week match's conclusion
自我声讨(不是
这周比赛有难也有易,但是我都是写得很少,摸鱼实在太严重,当然技术不到位也是一个方面,主要还是自己的问题。不再讨论
这周比赛学到、用到的的语法如下
快读
int read()
{
int x = 0 , f = 1;
char ch = getchar();
while(ch < '0' || ch > '9'){if(ch == '-') f = -1;ch = getchar();} \\判断负数
while(ch >= '0' && ch <= '9') {x = x * 10 + ch - 48;ch = getchar();}
return x * f;
}
C++带空格的字符串读入
// for (int i = 1; i <= n; i++) {
// getline(cin,s[i]);
// }
c++读到回车结束这轮输出
for (int i = 1; i <= n; i++) {
for (int j = 1; 1; j++) {
cin >> TY[i][j];
if(cin.get() == '\n')break;
}
}
模拟、标记、二叉树(弱项)、链表(弱项)、二分(弱项)、set的基本用法(有序不重复)
对于不熟悉的、弱项会在自主练习的时间或者其他时间中加强
在练习中比较有意思的题目
1.模拟(往死里模拟(依旧没过)
引以为戒
(https://www.luogu.com.cn/problem/P1148?contestId=96294)
代码篇幅过长只截取一部分有用的条件
if(win){ //如果有记分牌
if(c10){ //如果有加倍牌
if(win == 16){ //判断是否为赢家
ans[0] = ans[1] = ans[2] = ans[3] = 0;
ans[lis] +=1000;
break;
}else{
if(los == n-1)ans[lis] +=50;//如果只有一张加倍牌
else {
if(h == 13){
ans[lis] = 200;//所有的红心牌视为+200
if(s12)ans[lis] += -100;
if(d11)ans[lis] += 100;
if(s12 && d11)ans[lis]+=500;
ans[lis] *= 2;
}else {
if(s12)ans[lis] += -100;
if(d11)ans[lis] += 100;
ans[lis] *= 2;
}
}
}
}else{
if(h == 13){
ans[lis] = 200;
if(s12)ans[lis] += -100;
if(d11)ans[lis] += 100;
if(s12 && d11) ans[lis]+= 500;
}else{
if(s12)ans[lis] += -100;
if(d11)ans[lis] += 100;
}
}
}else ans[lis] = 0;
后缀表达式
一种新的计算方法(我没学过)
(https://www.luogu.com.cn/problem/P8683?contestId=95102)
/*
*后缀和
* 如(3+4)x 6 - 9;
* 则表示为 3 4 + 6 * 9 -;
*/
sort(TY+1,TY+count+1,cmp);
ll ans=0;
for (int i = 1; i <= add+1; i++) {
ans+=TY[i];
}
for (int i = count; i >= count - dec + 1; i--) {
ans -= TY[i];
}
cout << ans;
return 0;
}
The first week match's conclusion的更多相关文章
- Greedy is Good
作者:supernova 出处:http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=greedyAlg Joh ...
- Elasticsearch 5.0 中term 查询和match 查询的认识
Elasticsearch 5.0 关于term query和match query的认识 一.基本情况 前言:term query和match query牵扯的东西比较多,例如分词器.mapping ...
- SQL Server-聚焦查询计划Stream Aggregate VS Hash Match Aggregate(二十)
前言 之前系列中在查询计划中一直出现Stream Aggregate,当时也只是做了基本了解,对于查询计划中出现的操作,我们都需要去详细研究下,只有这样才能对查询计划执行的每一步操作都了如指掌,所以才 ...
- Java compiler level does not match解决方法
从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description Resource Path Location Type Java compiler level d ...
- 钉钉开放平台demo调试异常问题解决:hostname in certificate didn't match
今天研究钉钉的开放平台,结果一个demo整了半天,这帮助系统写的也很难懂.遇到两个问题: 1.首先是执行demo时报unable to find valid certification path to ...
- .net正则表达式大全(.net 的 System.Text.RegularExpressions.Regex.Match()方法使用)
正则表达式的本质是使用一系列特殊字符模式,来表示某一类字符串.正则表达式无疑是处理文本最有力的工具,而.NET的System.dll类库提供的System.Text.RegularExpression ...
- 在mongoose中使用$match对id失效的解决方法
Topic.aggregate( //{$match:{_id:"5576b59e192868d01f75486c"}}, //not work //{$match:{title: ...
- index+match函数在压实度中对盒号盒质量随机不重复的最佳使用
首先按照升序排列好盒号和盒质量,使其一一对应, 盒号 盒重量 随机值rand() 随机值大小排列rank 1 2001 0.01 ...
- MongoDB查询转对象是出错Element '_id' does not match any field or property of class
MongoDB查询转对象是出错Element '_id' does not match any field or property of class 解决方法: 1.在实体类加:[BsonIgno ...
- Excel——使用OFFSET、MATCH、COUNTA实现二级菜单
如图所示,接下来提供两种办法实现: 1.将A.B.C.D定义为名称NAME. 2.设置一级菜单单元格数据有效性为NAME. 3.设置二级菜单格数据有效为: =OFFSET($A$1,MATCH($A6 ...
随机推荐
- STM32任意引脚模拟IIC
关于模拟I2C,任意接口都可模拟(未全部测试,可能存在特殊情况). 关于SDA_IN与SDAOUT:如下定义: 举例:#define MPU_SDA_IN() {GPIOA->CRL&= ...
- WEB应用中配置和使用springIOC容器是成功的
Sring web应用学习(1)https://www.cnblogs.com/xiximayou/p/12172667.html
- HTML第四章作业
学生实践4.1.3 1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8" ...
- termux搭建服务器方式
pkg install vim apt update 安装debian系统apt install proot-distroproot-distro install debianproot-distro ...
- Python之常用数据类型详解
tuple 元组 1 # 定义 2 temp = (2, ) # 规范定义,单个元素的元组 3 tem = 2, # 可行,但不规范定义 4 tep = () # 空元组 5 6 tp = (1, ' ...
- mysql取消/开启外键约束
删除外键约束: SET foreign_key_checks=0; 启动外键约束: SET foreign_key_checks=1;
- VMware安装Rocky Linux8服务器系统并执行优化,包括修改安装镜像源、ssh免密等等
1. https://blog.csdn.net/DCTANT/article/details/125430461?utm_medium=distribute.pc_relevant.none-tas ...
- (转载)一篇文章详解python的字符编码问题
一篇文章详解python的字符编码问题 一:什么是编码 将明文转换为计算机可以识别的编码文本称为"编码".反之从计算机可识别的编码文本转回为明文为"解码". ...
- 《MySQL是怎样运行的》第七章小结
- AttributeError: module 'torchvision' has no attribute 'transforms'
代码:maskrcnn-benchmark Python 3.6.13 |Anaconda, Inc Traceback (most recent call last): File "too ...