牛客OI赛制测试赛1 题解
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char n[];int l;int num;
int main()
{
cin>>n;
int l=strlen(n);
num=n[l-]-'';
printf("%d",num%==?:-);
return ;
}
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long f[];
int main()
{
f[]=f[]=;
for(int i=;i<=;i++)
f[i+]=f[i]+f[i-],
printf("%lld ",f[i-]*f[i+]-f[i]*f[i]);
return ;
}
#include<cstdio>
#include<iostream>
using namespace std;
int a,b,c;
int main(){long long l=,r=int(1e9)<<:cin》a>>b;while(r-l>){c=(l+r)>>;if(c-b<a)l=c;else if(c-b>a)r=c;else return printf("%d\n",c);
} if(l!=r)return printf("%d\n",r);
}
#include<cstdio>
#include<algorithm>
using namespace std;
int a[];
int d[];
int main()
{
int n;
scanf("%d",&n);
for (int i=;i<=n;i++) scanf("%d",&a[i]);
if (n==)
{
printf("0\n");
return ;
}
d[]=a[];
int len=;
for (int i=;i<=n;i++)
{
if (a[i]>=d[len]) d[++len]=a[i];
else
{
int j=upper_bound(d+,d+len+,a[i])-d;
d[j]=a[i];
}
}
printf("%d\n",len);
return ;
}
牛客OI赛制测试赛1 题解的更多相关文章
- 【牛客OI赛制测试赛3】 毒瘤xor
牛客OI赛制测试赛3 毒瘤xor 传送门 题面,水表者自重 Solution 前缀和简单题(挖坑待补) 代码实现 #include<stdio.h> #define int long lo ...
- 牛客OI赛制测试赛2(0906)
牛客OI赛制测试赛2(0906) A :无序组数 题目描述 给出一个二元组(A,B) 求出无序二元组(a,b) 使得(a|A,b|B)的组数 无序意思就是(a,b)和(b,a) 算一组. 输入描述: ...
- 牛客OI赛制测试赛2
A题: https://www.nowcoder.com/acm/contest/185/A 链接:https://www.nowcoder.com/acm/contest/185/A来源:牛客网 题 ...
- 8.30 牛客OI赛制测试赛1 F题 子序列
题目描述 给出一个长度为n的序列,你需要计算出所有长度为k的子序列中,除最大最小数之外所有数的乘积相乘的结果 输入描述: 第一行一个整数T,表示数据组数.对于每组数据,第一行两个整数N,k,含义如题所 ...
- C数列下标 牛客OI赛制测试赛2
链接:https://www.nowcoder.com/acm/contest/185/C来源:牛客网 给出一个数列 A,求出一个数列B. 其中Bi 表示 数列A中 Ai 右边第一个比 Ai 大的 ...
- 牛客OI赛制测试赛2 D 星光晚餐
链接:https://www.nowcoder.com/acm/contest/185/D来源:牛客网 题目描述 Johnson和Nancy要在星光下吃晚餐.这是一件很浪漫的事情. 为了增加星光晚餐那 ...
- 牛客OI赛制测试赛2 C 数组下标
链接:https://www.nowcoder.com/acm/contest/185/C来源:牛客网 题目描述 给出一个数列 A,求出一个数列B. 其中Bi 表示 数列A中 Ai 右边第一个比 ...
- 牛客OI赛制测试赛2 A 无序组数
链接:https://www.nowcoder.com/acm/contest/185/A来源:牛客网 题目描述 给出一个二元组(A,B) 求出无序二元组(a,b) 使得(a|A,b|B)的组数 无序 ...
- Nowcoder | [题解-N189]牛客OI赛制测试赛3
这场说实话确实水(逃*1),表示差一点就AK了(逃*2),然而被卡两个特判的我\(ssfd\)...\(qwq\) 表示这是第一次发整场比赛的题解...还请各位大佬原谅我太蒻写的垃圾啊\(qwq\). ...
随机推荐
- tar使用
[tar使用] 1..tar.gz文件 压缩:tar -czvf dstFileName.tar.gz a.txt b.txt …… 解压:tar -xzvf fileName.tar.gz 2..t ...
- Python next() 函数
Python next() 函数 Python 内置函数 描述 next() 返回迭代器的下一个项目. 语法 next 语法: next(iterator[, default]) 参数说明: ite ...
- Python dict() 函数
Python dict() 函数 Python 内置函数 描述 dict() 函数用于创建一个字典. 语法 dict 语法: class dict(**kwarg) class dict(mappi ...
- ajax传递数组及后台接收
ajax传递的是{"items":arr},其中arr=[]; 在后台String[] items=req.getParameterValues("items" ...
- php 共享内存学习(APC扩展)
问题:希望可以在进程间共享变量,为共享数据提供快速访问 解决方案:使用APC扩展的数据存储功能 (cli模式下没有作用) //获取原来的值 $population = apc_fetch('popul ...
- golang apns升级到http2
记录一下golang中升级apns,使用http2替换http1.1的详细过程. apns使用http2的好处就不用再说了,网上一搜一堆信息.苹果的apns推送在2015年8月就支持了http2协议, ...
- Zookeeper 目录
Zookeeper 目录 Zookeeper 致力于提供一个高性能.高可用,且具有严格的顺序访问控制能力(主要是写操作的严格顺序性)的分布式协调服务.以下是我整理的笔记. 一.分布式理论基础 1.1 ...
- linq join一些忘记的操作
- Text Relatives II
[Text Relatives II] When your app determines that the user has requested the edit menu—which could b ...
- Redis数据结构(四)
存储list: list存储方式采用头和尾插入的方式,这样效率快,如果没有这个插入的数据,redis自己会创建这个数据,如果是中间插入的话,采用list方式效率就会很慢. ArrayList使用数组方 ...