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

边栏推荐
猜你喜欢
随机推荐
Sublime Text 好用的插件
C# BBcode 转 Markdown
leetcode: 241. Designing precedence for arithmetic expressions
F. Jinyu and its outer matrix (construction)
RS|哨兵二号(.SAFE格式)转tif格式
Next -21- 添加相册系列 - 1- 框架设置
Redis-主从复制
AOSP built-in APP franchise rights white list
G. Mountaineering Squad (violence & dfs)
How to fall in love with a programmer
Win10无法访问移动硬盘怎么解决
利用决策树找出最优特征组合
uni-app 从零开始-生命周期(二)
苏秋贵:揭秘绿联科技用5年时间从0做到6亿,如何一枝独秀?
Leetcode: 215 disorderly to find the first big k element in the array
leetcode:241. 为运算表达式设计优先级
我爱七夕哈哈哈
Cisco - Small Network Topology (DNS, DHCP, Web Server, Wireless Router)
Bluetooth Technology|In the first half of the year, 1.3 million charging piles were added nationwide, and Bluetooth charging piles will become the mainstream of the market
IP第十五天笔记









