当前位置:网站首页>[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;
}边栏推荐
- Use of gcc/g++
- Gin parameter validation
- 反射reflect
- 3-全局异常处理
- Introduction to log4j layout
- Logback log level introduction
- Using C language to skillfully realize the chess game -- Sanzi chess
- Introduction to logback appender
- MySQL 使用客户端以及SELECT 方式查看 BLOB 类型字段内容总结
- How to establish EDI connection with Scania in Scania?
猜你喜欢
随机推荐
【暑期每日一题】洛谷 P4413 [COCI2006-2007#2] R2
【暑期每日一题】洛谷 P6320 [COCI2006-2007#4] SIBICE
请问flink支持sqlServer数据库么?获取sqlServer数据库的变化
Variables and encryption in ansible
How to establish EDI connection with Scania in Scania?
Leetcode 209. subarray with the smallest length (2022.07.28)
Gin service exit
Scala 高阶(九):Scala中的模式匹配
Scala 高阶(十):Scala中的异常处理
电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?
CDC source can quit after reading MySQL snapshot split
3-全局异常处理
Remote invocation of microservices
log4qt内存泄露问题,heob内存检测工具的使用
thinkphp6 实现数据库备份
Some learning and understanding of vintage analysis
时钟树综合(一)
js第四天流程控制(if语句和switch语句)
Section 7 - compilation of programs (preprocessing operations) + links
jdbc入门









