当前位置:网站首页>【暑期每日一题】洛谷 P6336 [COCI2007-2008#2] BIJELE
【暑期每日一题】洛谷 P6336 [COCI2007-2008#2] BIJELE
2022-07-29 07:08:00 【AC_Dragon】
题目链接:P6336 [COCI2007-2008#2] BIJELE - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
题目背景
Mirko 在阁楼发现了一套残缺的棋子。
题目描述
对于一套正确的棋子,应该包含:
- 一个国王;
- 一个皇后;
- 两个车;
- 两个象;
- 两个马;
- 八个兵。
现在给出这套残缺的棋子中每种棋子分别有多少个,请你求出需要如何添加或删除棋子来凑出完整的棋盘。
输入格式
输入一行六个数,依次表示国王,皇后,车,象,马,兵的数量。这些数字都在 $0\sim 10$ 之间(包含端点)。
输出格式
输出一行六个数,依次表示国王,皇后,车,象,马,兵需要添加或删除的数量。用正数来表示添加,用负数来表示删除。
样例 #1
样例输入 #1
0 1 2 2 2 7样例输出 #1
1 0 0 0 0 1样例 #2
样例输入 #2
2 1 2 1 2 1样例输出 #2
-1 0 0 1 0 7提示
说明
题目译自 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) // 注意这里必须要加 &!!!
cin>>i;
cout<<1-a[0]<<" "<<1-a[1]<<" "<<2-a[2]<<" "<<2-a[3]<<" "<<2-a[4]<<" "<<8-a[5];
return 0;
}边栏推荐
- Ethernet interface introduction
- Description of rollingfileappender attribute in logback
- Explanation of suffix automata (SAM) + Luogu p3804 [template] suffix automata (SAM)
- Paper reading (62):pointer networks
- Logback log level introduction
- Introduction and introduction of logback
- My personal website doesn't allow access to wechat, so I did this
- 09 bloom filter
- JS day 4 process control (if statement and switch statement)
- mysql 单表最多能存多少数据?
猜你喜欢

MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)

【WPF】通过动态/静态资源实现语言切换

QT基础第二天(2)qt基础部件:按钮类,布局类,输出类,输入类,容器等个别举例

2-unified return class dto object

Kubernetes (V) -- deploy kubernetes dashboard

亚马逊云助手小程序来啦!

Latest 10 billion quantitative private placement list

A long article --- in-depth understanding of synchronized

JS chicken laying eggs and egg laying chickens. Who appeared earlier, object or function? Is function an instance of function?
Scala 高阶(九):Scala中的模式匹配
随机推荐
How does MySQL convert rows to columns?
[redis] redis development specifications and precautions
[OpenGL] use of shaders
Zabbix 其他基础监控项
我想问一下,我flink作业是以upsert-kafka的方式写入数据的,但是我在mysql里面去更
How much data can a single MySQL table store at most?
JS break and continue and return keywords
thinkphp6 实现数据库备份
MySQL - multi table query
对Vintage分析的一些学习理解
gcc/g++的使用
Problems encountered in vmware16 installing virtual machines
MySQL uses the client and select methods to view the summary of blob type fields
Scala 高阶(九):Scala中的模式匹配
MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
I, 28, a tester, was ruthlessly dismissed in October: I want to remind people who are still learning to test
WPF interface layout must know basis
Use vscode to configure Mysql to realize connection, query, and other functions
Operator3-设计一个operator
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)