当前位置:网站首页>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

边栏推荐
- Redis-主从复制
- leetcode: 251. Expanding 2D Vectors
- 用于X射线聚焦的复合折射透镜
- leetcode:241. 为运算表达式设计优先级
- 从-99打造Sentinel高可用集群限流中间件
- I love Tanabata hahaha
- [Problem solving] QT update component appears "To continue this operation, at least one valid and enabled repository is required"
- leetcode: 255 Verify preorder traversal sequence binary search tree
- Makefile syntax and usage notes
- 动态数组底层是如何实现的
猜你喜欢

QT笔记——Q_INVOKABLE了解

Technology sharing | Description of the electronic fence function in the integrated dispatching system

CloudCompare&PCL 点云按网格划分(点云分幅)
ping的原理

蓝牙技术|上半年全国新增 130 万台充电桩,蓝牙充电桩将成为市场主流

ASA归因:如何评估关键词的投放价值

Hangzhou Electric School Competition (Counter Attack Index)

广告电商系统开发功能只订单处理

杭电校赛(逆袭指数)

JCMsuite Application: Oblique Plane Wave Propagation Transmission Through Aperture
随机推荐
本周讨论用户体验:Daedalus 的 Nemo 加入 Ambire,探索加密海洋
Android Sqlite3基本命令
蓝牙技术|上半年全国新增 130 万台充电桩,蓝牙充电桩将成为市场主流
C# 局部函数与事件
ASA归因:如何评估关键词的投放价值
推荐一个鸿蒙即时通讯软件《果聊》
【云原生 | 从零开始学Kubernetes】kubernetes之StatefulSet详解
Notes for xpath getting node with namespace
Qt的QItemDelegate使用
如何和程序员谈恋爱
聊聊与苹果审核员的爱恨情仇
AOSP内置APP特许权限白名单
Latex 去掉行号
[Opportunity Enlightenment-60]: "Soldiers, Stupid Ways"-1- Opening: "Death" and "Life" are the way of heaven
编译型与解释型编程语言的区别
Cisco - Small Network Topology (DNS, DHCP, Web Server, Wireless Router)
快解析结合友加畅捷U+
CloudCompare&PCL 点云按网格划分(点云分幅)
365天挑战LeetCode1000题——Day 049 非递增顺序的最小子序列 贪心
C语言写简单三子棋