当前位置:网站首页>2022 Hangzhou Electric Multi-School 4
2022 Hangzhou Electric Multi-School 4
2022-08-04 15:06:00 【ojzha_gcx】
最终结果
T1004 Link with Equilateral Triangle
To be honest, take a look at the meaning of the question on the field, and after two or three minutes, a pair of teams have passed the question and directly guessed that the answer must be yesNo了,然后AC了.
题意:
有一个边长为n的大等边三角形.This large triangle consists of n2个边长为1的小等边三角形组成.
Each vertex of the small triangle will be filled with the following constraints:
·The numbers filled in should be0、1或2.
·The left side of the large triangle should not be filled0.The right side of the large triangle should not be filled1.The base of the large triangle should not be filled2.
·For each side length is 1的小三角形,The sum of the three vertices should not be3的倍数.
please benWhether the triangle can be filled when the edge is formed,使其满足上述所有条件?
official certificate:对于一个合法的解,Should satisfy that there is no concurrent inclusion0,1,2的三角形,Next we prove that such a triangle must exist.Bottom left corner must be1,Bottom right corner must be0,Bottom edge cannot contain2,Then there must be an odd number of bars on the bottom edge1-0的边,These sides all belong to a small triangle.考虑其他的0-1边,Since it is not on the two hypotenuses,其他的0-1The sides must belong to two triangles.因此“each triangle
形内0-1边的数量”The sum must be odd.但是,假设不存在0-1-2的三角形,Then all triangles must contain0条或2条的0-1边,产生了矛盾.因此一定存在0-1-2的三角形.
#include<bits/stdc++.h>
#define LL long long
#define MIN 0xc0c0c0c0c0c0c0c0
#define PII pair<LL,LL>
#define x first
#define y second
using namespace std;
int n;
void solve()
{
cin>>n;
for(int i=1;i<=n;i++)
{
printf("No\n");
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
solve();
return 0;
}
T1006 BIT Subway
题意:Reading to understand is the calculation to buy the same ticket,According to the official charging rules and according to the protagonistyyThe billing rules need to spend money.
idea:My approach in the field is to simulate each situation according to the meaning of the question,So I wrote a bunchif,Very time consuming and easy to get around.
code:
#include<bits/stdc++.h>
#define LL long long
#define MIN 0xc0c0c0c0c0c0c0c0
#define PII pair<LL,LL>
#define x first
#define y second
using namespace std;
LL n;
double ans1,ans2;
double a[101010];
void solve()
{
ans1 = ans2 = 0;
scanf("%lld",&n);
for(int i=1;i<=n;i++)
{
scanf("%lf",&a[i]);
// cout<<a[i]<<endl;
if( ans2>=200 )
{
ans2 += a[i]*0.5;
}
else if( ans2>=100 )
{
ans2 += a[i]*0.8;
}
else ans2 += a[i];
if( ans1>=200 )
{
ans1 += a[i]*0.5;
}
else if( ans1>=100 )
{
if( ans1+a[i]*0.8>200 )
{
ans1 = ans1 + (200-ans1) + ( a[i] - (200-ans1)/0.8 )*0.5;
}
else
{
ans1 = ans1 + a[i]*0.8;
}
}
else
{
if( 100/0.8 + (100-ans1) < a[i] )
{
ans1 = ans1 + ( 100-ans1 ) + 100 + ( a[i]-(100-ans1)-(100/0.8) )*0.5;
}
else if( (100-ans1)<a[i] ) //ans1+a[i]>100
{
ans1 = ans1 + (100-ans1) + ( a[i]-(100-ans1) )*0.8;
}
else
{
ans1 = ans1 + a[i];
}
}
}
printf("%.3lf %.3lf\n",ans1,ans2);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
int t;
cin>>t;
while( t-- )
solve();
return 0;
}
The truth, however, is that the official billing rules are simple,主人公YYThe rule of it will be found to be a piecewise function of the original total fare
T1007 Climb Stairs
边栏推荐
- 一看就会的Chromedriver(谷歌浏览器驱动)安装教程
- 数据链路层-------以太网协议
- 苏秋贵:揭秘绿联科技用5年时间从0做到6亿,如何一枝独秀?
- 【剑指offer59】队列的最大值
- Makefile syntax and usage notes
- FRED Application: Capillary Electrophoresis System
- 蓝牙技术|上半年全国新增 130 万台充电桩,蓝牙充电桩将成为市场主流
- Redis-主从复制
- 快速整明白Redis中的字典到底是个啥
- [Problem solving] QT update component appears "To continue this operation, at least one valid and enabled repository is required"
猜你喜欢
《分布式云最佳实践》分论坛,8月11日深圳见
ASA归因:如何评估关键词的投放价值
I/O stream summary
1403. Minimum Subsequence in Non-Increasing Order
xampp安装包含的组件有(php,perl,apche,mysql)
leetcode: 250. Count subtrees of equal value
leetcode:253. 至少需要多少间会议室
【云原生 | 从零开始学Kubernetes】kubernetes之StatefulSet详解
【北亚数据恢复】IBM System Storage存储lvm信息丢失数据恢复方案
浅谈一下跨端技术方案
随机推荐
FRED Application: Capillary Electrophoresis System
浅谈一下跨端技术方案
1403. Minimum Subsequence in Non-Increasing Order
F. Jinyu and its outer matrix (construction)
[Beiya data recovery] IBM System Storage storage lvm information lost data recovery solution
leetcode: 253. How many meeting rooms are required at least
Next -21- 添加相册系列 - 1- 框架设置
第十六章 源代码文件 REST API 教程(一)
小程序|炎炎夏日、清爽一夏、头像大换装
Hangzhou electric the competition team arrangement (ACM)
AOSP内置APP特许权限白名单
ASA归因:如何评估关键词的投放价值
杭电校赛(逆袭指数)
JCMsuite应用:倾斜平面波传播透过光阑的传输
leetcode: 259. Smaller sum of three numbers
什么,你告诉我?作用域也分种类?
leetcode:253. 至少需要多少间会议室
C# 谁改了我的代码
Redis-主从复制
【Today in History】August 4: First female Turing Award winner; NVIDIA acquires MediaQ; first Cybersecurity Challenge completed