This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use some other programming language, consult its documentation. You may also refer to the guide on interactive problems: https://codeforces.com/blog/entry/45307.

The jury guessed some array aa consisting of 66 integers. There are 66 special numbers — 44, 88, 1515, 1616, 2323, 4242 — and each of these numbers occurs in aa exactly once (so, aa is some permutation of these numbers).

You don't know anything about their order, but you are allowed to ask up to 44 queries. In each query, you may choose two indices ii and jj (1≤i,j≤61≤i,j≤6, ii and jj are not necessarily distinct), and you will get the value of ai⋅ajai⋅aj in return.

Can you guess the array aa?

The array aa is fixed beforehand in each test, the interaction program doesn't try to adapt to your queries.

Interaction

Before submitting the answer, you may ask up to 44 queries. To ask a query, print one line in the following format: ?? ii jj, where ii and jjshould be two integers such that 1≤i,j≤61≤i,j≤6. The line should be ended with a line break character. After submitting a query, flush the output and read the answer to your query — one line containing one integer ai⋅ajai⋅aj. If you submit an incorrect query (or ask more than 44queries), the answer to it will be one string 0. After receiving such an answer, your program should terminate immediately — otherwise you may receive verdict "Runtime error", "Time limit exceeded" or some other verdict instead of "Wrong answer".

To give the answer, your program should print one line !! a1a1 a2a2 a3a3 a4a4 a5a5 a6a6 with a line break in the end. After that, it should flush the output and terminate gracefully.

Example
input

Copy
16
64
345
672
output

Copy
? 1 1
? 2 2
? 3 5
? 4 6
! 4 8 15 16 23 42
Note

If you want to submit a hack for this problem, your test should contain exactly six space-separated integers a1a1, a2a2, ..., a6a6. Each of 66 special numbers should occur exactly once in the test. The test should be ended with a line break character.

鸣谢https://blog.csdn.net/b_r_e_a_d/article/details/81784223

代码

#include <cstdio>
#include <cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;
int a[]={,,,,,},d[];
int main() {
for(int i=;i<=;i++)
{
printf("? %d %d\n",i,i+);
fflush(stdout);
cin>>d[i];
}
do
{
if(a[]*a[]==d[]&&a[]*a[]==d[]&&a[]*a[]==d[]&&a[]*a[]==d[])
break;
}while(next_permutation(a,a+));
printf("!"); for(int i=;i<;i++)
cout<<" "<<a[i]; fflush(stdout);
return ;
}

Educational Codeforces Round 65 (Rated for Div. 2)B. Lost Numbers(交互)的更多相关文章

  1. Educational Codeforces Round 65 (Rated for Div. 2) B. Lost Numbers

    链接:https://codeforces.com/contest/1167/problem/B 题意: This is an interactive problem. Remember to flu ...

  2. Educational Codeforces Round 65 (Rated for Div. 2)(ACD)B是交互题,不怎么会

    A. Telephone Number A telephone number is a sequence of exactly 11 digits, where the first digit is  ...

  3. Educational Codeforces Round 65 (Rated for Div. 2)题解

    Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include ...

  4. Educational Codeforces Round 65 (Rated for Div. 2) D. Bicolored RBS

    链接:https://codeforces.com/contest/1167/problem/D 题意: A string is called bracket sequence if it does ...

  5. Educational Codeforces Round 65 (Rated for Div. 2) C. News Distribution

    链接:https://codeforces.com/contest/1167/problem/C 题意: In some social network, there are nn users comm ...

  6. Educational Codeforces Round 65 (Rated for Div. 2) A. Telephone Number

    链接:https://codeforces.com/contest/1167/problem/A 题意: A telephone number is a sequence of exactly 11  ...

  7. [ Educational Codeforces Round 65 (Rated for Div. 2)][二分]

    https://codeforc.es/contest/1167/problem/E E. Range Deleting time limit per test 2 seconds memory li ...

  8. Educational Codeforces Round 65 (Rated for Div. 2)

    A:签到. #include<bits/stdc++.h> using namespace std; #define ll long long #define inf 1000000010 ...

  9. Educational Codeforces Round 65 (Rated for Div. 2) E. Range Deleting(思维+coding)

    传送门 参考资料: [1]:https://blog.csdn.net/weixin_43262291/article/details/90271693 题意: 给你一个包含 n 个数的序列 a,并且 ...

随机推荐

  1. .net core 3 web api jwt 一直 401

    最近在给客户开发 Azure DevOps Exension, 该扩展中某个功能需要调用使用 .NET Core 3 写的 Web Api. 在拜读了 Authenticating requests ...

  2. UWP通过机器学习加载ONNX进行表情识别

    首先我们先来说说这个ONNX ONNX是一种针对机器学习所设计的开放式的文件格式,用于存储训练好的模型.它使得不同的人工智能框架(如Pytorch, MXNet)可以采用相同格式存储模型数据并交互. ...

  3. NServiceBus 入门到精通(一)

    什么是NServiceBus?NServiceBus 是一个用于构建企业级 .NET系统的开源通讯框架.它在消息发布/订阅支持.工作流集成和高度可扩展性等方面表现优异,因此是很多分布式系统基础平台的理 ...

  4. Linux下的 Mysql 8.0 yum 安装 并修改密码

    1.MySQL版本: mysql> select @@version;+-----------+| @@version |+-----------+| 8.0.18 |+-----------+ ...

  5. redis两种持久化方式RDB和AOF

    目录 前言 1. Redis 数据库结构 2. RDB 持久化 2.1. RDB 的创建和载入 2.1.1. 手动触发保存 SAVE 命令 BGSAVE 命令 SAVE 和 BGSAVE 的比较 2. ...

  6. Html介绍,认识head标签

    <head></head>标签位于html文档的头部,主要是用来描述文档的各种属性和信息,包括文档的标题等,当然文档头部包含的数据都不会真正作为内容展示给访客的. 如下的一些标 ...

  7. 如何使用Acrok Video Converter Ultimate转换视频?

    Acrok Video Converter Ultimate是一个功能强大的程序,可以帮助您转换几乎任何类型的视频格式,例如MKV,AVI,WMV,MP4,MOV,MTS,MXF,DVD,蓝光等. 下 ...

  8. NIO学习笔记,从Linux IO演化模型到Netty—— Linux零拷贝

    这里只是感性地认识Linux零拷贝,不涉及具体细节. 1.Linux传统的数据拷贝 用户进程是不能直接访问文件系统的,要先切换到内核态,发起系统调用,DMA把磁盘中的数据写入内核空间,内核再把数据拷贝 ...

  9. jQuery---jQuery插件

    jQuery插件 使用插件的步骤 1. 引入jQuery文件 2. 引入插件(如果有用到css的话,需要引入css) 3. 使用插件 <!--1. 引入jquery的js文件--> < ...

  10. Page Object设计模式(二)——poium测试库

    一.简介 poium是一个基于Selenium/appium的Page Object测试库,最大的特点是简化了Page层元素的定义. 项目地址:https://github.com/SeldomQA/ ...