当前位置:网站首页>[summer daily question] Luogu p6336 [coci2007-2008 2] bijele
[summer daily question] Luogu p6336 [coci2007-2008 2] bijele
2022-07-29 07:28:00 【AC_ Dragon】
Topic link :P6336 [COCI2007-2008#2] BIJELE - Luogu | New ecology of computer science education (luogu.com.cn)
Background
Mirko A set of incomplete chess pieces was found in the attic .
Title Description
For the right set of chess pieces , It should contain :
- A king ;
- A queen ;
- Two cars ;
- Two elephants ;
- Two horses ;
- Eight soldiers .
Now, how many pieces are there in this set of incomplete pieces , Please figure out how to add or delete pieces to make a complete chessboard .
Input format
Enter six numbers in a row , It means the king in turn , Queen , vehicle , like , Horse , The number of soldiers . These figures are in $0\sim 10$ Between ( Include endpoints ).
Output format
Output six numbers in a row , It means the king in turn , Queen , vehicle , like , Horse , The number of soldiers to add or delete . Use positive numbers to add , Use negative numbers to indicate deletion .
Examples #1
The sample input #1
0 1 2 2 2 7Sample output #1
1 0 0 0 0 1Examples #2
The sample input #2
2 1 2 1 2 1Sample output #2
-1 0 0 1 0 7Tips
explain
The title is translated from COCI2007-2008 CONTEST #2 T1 BIJELE.
AC code:
#include<iostream>
#include<algorithm>
using namespace std;
// 1 1 2 2 2 8
int main()
{
int a[6];
for(auto &i:a) // Note that it must be added here &!!!
cin>>i;
cout<<1-a[0]<<" "<<1-a[1]<<" "<<2-a[2]<<" "<<2-a[3]<<" "<<2-a[4]<<" "<<8-a[5];
return 0;
}边栏推荐
猜你喜欢

1 - background project construction

QT topic: basic components (button class, layout class, output class, input class, container class)

彻底搞懂kubernetes调度框架与插件

QT专题:基础部件(按钮类,布局类,输出类,输入类,容器类)

Latest 10 billion quantitative private placement list

QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples

js中break与continue和return关键字

Interface test actual project 03: execute test cases

Paper reading (62):pointer networks

Ethernet interface introduction
随机推荐
Round avatar of user list and follow small blocks
【MYSQL】-【子查询】
How to use GS_ Expansion expansion node
【暑期每日一题】洛谷 P1601 A+B Problem(高精)
PAT甲级 1154 顶点着色
SEGGER 的硬件异常 分析
LevelFilter简介说明
log4qt内存泄露问题,heob内存检测工具的使用
20-40k | mecarmand 3D vision algorithm / software / Product Manager Recruitment
Introduction to logback filter
电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?
Description of rollingfileappender attribute in logback
0 8 动态规划(Dynamic Programming)
MySQL如何把行转换为列?
Kubernetes (V) -- deploy kubernetes dashboard
Levelfilter introduction
halcon的安装以及在vs2017中测试,vs2017中dll的配置
How much data can a single MySQL table store at most?
What is the function of fileappender in logback?
[OpenGL] use of shaders