2.2测试赛AC代码临时保存
//A
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
int x,y,t;
scanf("%d",&t);
while(t--)
{
scanf("%d %d",&x,&y);
long long int z = 6 * pow(2,x+2) * y;
long long int pt = z;
if(z%100 != 0)
{
pt = (z / 100 + 1) * 100;
}
if((x==3 && y>=70) || (x==4 && y>=40) || (x==5)) pt = 12000;
else if(x==6 || x==7) pt = 18000;
else if(x>=8 && x<=10) pt = 24000;
else if(x>=11 && x<=12) pt = 36000;
else if(x>=13) pt = 48000;
printf("%lld\n",pt);
}
return 0;
}
//B
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
using namespace std;
int num[100010],book[100010];
int main()
{
int n,cnt=0;
long long sum = 0;
scanf("%d",&n);
for(int i=0; i<n; i++) scanf("%d",&num[i]);
book[0] = 1;
for(int i=1; i<n; i++)
{
if(num[i]>num[i-1]) book[i] = book[i-1] + 1;
else book[i] = 1;
}
for(int i=n-2; i>=0; i--)
{
if(num[i]>num[i+1] && book[i]<=book[i+1]) book[i] = book[i+1] + 1;
}
for(int i=0; i<n; i++) sum += book[i];
printf("%lld\n",sum);
return 0;
}
//J
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
using namespace std;
bool InYuan(int r,int a,int b,int x,int y)
{
return ((x-a)*(x-a) + (y-b)*(y-b) <= r*r);
}
bool InJu(int x1,int x2,int y1,int y2,int x,int y)
{
return (x<=x2 && x>=x1 && y>=y1 && y<=y2);
}
int main()
{
int w,h,xc,yc,r,x1,y1,x2,y2;
scanf("%d %d %d %d %d %d %d %d %d",&w,&h,&xc,&yc,&r,&x1,&y1,&x2,&y2);
if(x1 == x2)
{
int l = abs(y1 - y2);
if(y2 > y1) x2 += l;
else if(y1 > y2) x1 -= l;
}
else if(y1 == y2)
{
int l = abs(x1 - x2);
if(x2 > x1) y1 -= l;
else if(x1 > x2) y2 += l;
}
if(x1 > x2) swap(x1,x2);
if(y1 > y2) swap(y1,y2);
for(int i=0; i<w; i++)
{
for(int j=0; j<h; j++)
{
if(InYuan(r,xc,yc,i,j) || InJu(x1,x2,y1,y2,i,j))
{
printf("/");
}
else
{
printf("\\");
}
}
printf("\n");
}
return 0;
}
2.2测试赛AC代码临时保存的更多相关文章
- 2.4测试赛AC代码临时保存
//H #include<cstdio> #include<cstdlib> #include<cstring> #include<stack> usi ...
- VJ数论专题AC代码临时保存
//A #include<bits/stdc++.h> using namespace std; bool vis[1000010]; void Get_Prime() { int n = ...
- 【南阳OJ分类之语言入门】80题题目+AC代码汇总
小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...
- python爬虫学习(7) —— 爬取你的AC代码
上一篇文章中,我们介绍了python爬虫利器--requests,并且拿HDU做了小测试. 这篇文章,我们来爬取一下自己AC的代码. 1 确定ac代码对应的页面 如下图所示,我们一般情况可以通过该顺序 ...
- 2018.12.21 浪在ACM 集训队第十次测试赛
浪在ACM 集训队第十次测试赛 A Diverse Substring B Vasya and Books C Birthday D LCM A 传送门 题解 B 传送门 题解: 这道题,就比较简单 ...
- nowcoder(牛客网)OI测试赛3 解题报告
昨天因为胡搞了一会儿社团的事情,所以错过(逃过)了nowcoder的测试赛..... 以上,听说还是普及组难度qwq,而且还有很多大佬AK(然而我这么蒻肯定还是觉得有点难度的吧qwq) 不过我还是日常 ...
- 牛客OI赛制测试赛2(0906)
牛客OI赛制测试赛2(0906) A :无序组数 题目描述 给出一个二元组(A,B) 求出无序二元组(a,b) 使得(a|A,b|B)的组数 无序意思就是(a,b)和(b,a) 算一组. 输入描述: ...
- 2018.12.14 浪在ACM 集训队第九次测试赛
浪在ACM 集训队第九次测试赛 B Battleship E Masha and two friends B 传送门 题意: 战船上有占地n*n的房间cells[][],只由当cells[i][j]= ...
- HDU2449 Gauss Elimination 高斯消元 高精度 (C++ AC代码)
原文链接https://www.cnblogs.com/zhouzhendong/p/HDU2449.html 题目传送门 - HDU2449 题意 高精度高斯消元. 输入 $n$ 个 $n$ 元方程 ...
随机推荐
- [Contract] Solidity 变量类型的默认值
变量的默认值一般都代表 “零值”. 比如 bool 就是 false,uint.int 就是 0,string 就是空字符串. 其它组合的参考 Solidity 判断 mapping 值的存在 Ref ...
- #《Essential C++》读书笔记# 第六章 以template进行编程
练习题答案 练习6.1 试改写以下类,使它成为一个class template: class example { public: example(double min, double max); ex ...
- 1.Android网络编程-HTML介绍
1.HTML介绍 超文本标记语言(HyperText Markup Language,简称:HTML)是一种用于创建网页的标准标记语言. 在Eclipse下则可以使用自带的浏览器浏览html: 2.H ...
- 利用ARP欺骗进行MITM(中间人攻击)
ARP欺骗主要骑着信息收集得作用,比如可以利用欺骗获取对方流量,从流量分析你认为重要得信息 0X01 了解ARP Arp协议 ARP(Address Resolution Protocol,地址解析 ...
- OHEM论文笔记
目录 引言 Fast R-CNN设计思路 一.动机 二.现有方案hard negative mining 及其窘境 hard negative mining实现 窘境 设计思路 OHEM步骤: 反向传 ...
- spring security之web应用安全
一.什么是web应用安全,为了安全我们要做哪些事情? 保护web资源不受侵害(资源:用户信息.用户财产.web数据信息等)对访问者的认证.授权,指定的用户才可以访问资源访问者的信息及操作得到保护(xs ...
- Java中Thread方法启动线程
public class ThreadTest extends Thread { private int count = 10; @Override public void run() { //重写 ...
- Spring-微服务
项目框架 功能模块介绍 Eureka:https://baike.baidu.com/item/Eureka/22402835?fr=aladdin Ribbon:https://www.jiansh ...
- matlab初探寻
matlab <iframe src="//player.bilibili.com/player.html?aid=74994893&cid=128293306&pag ...
- win10 系统到期的解决方案
本人是 win10 教育版,今天多次提醒 windows 要到期了(烦银).所以网上找到了解决方法,记录一下. 废话:win10 与之前的 windows 版本一样,有家庭版.专业版.企业版等各个版本 ...