当前位置:网站首页>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
边栏推荐
- Zheng Qing freshmen school competition and middle-aged engineering selection competition
- F. Jinyu and its outer matrix (construction)
- [Opportunity Enlightenment-60]: "Soldiers, Stupid Ways"-1- Opening: "Death" and "Life" are the way of heaven
- License server system does not support this version of this feature
- 1403. 非递增顺序的最小子序列
- JCMsuite应用:倾斜平面波传播透过光阑的传输
- Why does the decimal point appear when I press the space bar in word 2003?
- leetcode:250. 统计同值子树
- 本周讨论用户体验:Daedalus 的 Nemo 加入 Ambire,探索加密海洋
- Google plug-in. Download contents file is automatically deleted after solution
猜你喜欢
随机推荐
直播系统开发——直播间架构的设计及难点分析
Zheng Qing freshmen school competition and middle-aged engineering selection competition
[Problem solving] QT update component appears "To continue this operation, at least one valid and enabled repository is required"
leetcode: 250. Count subtrees of equal value
快速整明白Redis中的字典到底是个啥
365天挑战LeetCode1000题——Day 049 非递增顺序的最小子序列 贪心
Redis 高可用
第十六章 源代码文件 REST API 教程(一)
FRED Application: Capillary Electrophoresis System
Next -19- 开启fancybox查看图片大图
leetcode:254. 因子的组合
小程序|炎炎夏日、清爽一夏、头像大换装
Qt的QItemDelegate使用
C# BBcode 转 Markdown
属于程序猿的浪漫
Latex 去掉行号
【剑指offer33】二叉搜索树的后序遍历序列
Go 语言快速入门指南: 变量和常量
Next -20- 使用自定义样式 (custom style)
X射线掠入射聚焦反射镜