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. Go 1.14 中 Cleanup 方法简介

    目录 一般的测试 使用 defer 清除依赖 使用 Cleanup 关于t.Parallel 总结 原文:What's New In Go 1.14: Test Cleanup 单元测试通常遵循某些步 ...

  2. java设计模式学习笔记——里氏替换原则

    oo中的继承性的思考和说明 1.继承包含这样一层含义:父类中凡是已经实现好的方法,实际上是在设定规范和契约,虽然它不强制要求所有的子类必须遵循这些七月,但是如果子类对这些已经实现的方法任意修改,就会对 ...

  3. 转载【React Native代码】手写验证码倒计时组件

    实例代码: import React, { Component , PropTypes} from 'react'; import { AppRegistry, StyleSheet, Text, V ...

  4. 【Android开发艺术探索】四大组件的工作过程

    个人博客 http://www.milovetingting.cn 四大组件的工作过程 四大组件:Activity.Service.BroadcastReceiver.ContentProvider ...

  5. Blazor client-side + webapi (.net core 3.1) 添加jwt验证流程(非host)第二步 添加Identity

    添加Identity数据上下文 安装nuget包:Microsoft.AspNetCore.Identity.EntityFrameworkCore 创建ApplicationDbContext类 创 ...

  6. Post方式 前后端分离开发postman工具首次使用心得及注意事项

    使用前:2009年以前,一直用asp(非asp.net)语言开发网站,网页调用数据等操作,是通过asp标签<%%>嵌入到HTML标签语言中.相隔八年后,听说最近都是MVC后又什么前后端分离 ...

  7. Elasticsearch配置集群环境

    环境选择:            1.方案一:准备三台机器   每一台机器一个节点            2.方案二:准备一台机器   启动三个节点,用端口号区分即可            3.ES启 ...

  8. 简单聊聊CSS中的3D技术之“立方体”

    简单聊聊CSS中的3D技术之“立方体” 大家好,我是今天的男一号,我叫小博主. 今天来聊一下我在前端“逆战班”学习中遇到的颇为有趣的3D知识.前端学习3周,见识稀疏,在下面的分享中如有不对的地方请大家 ...

  9. js获取时间及转化

    有关Javascript的本地时间获取,下面我直接用代码来进行举例吧 let time = new Date(); let month = time.getMonth()+1; //获取的月份0~11 ...

  10. Android实战项目——家庭记账本(三)

    今天完成的主要内容有: 1.主页面账单明细部分细节展示 2.对每个列表项,点击打开新的可编辑修改具体页面 3.实现了搜索页面的UI布局 4.优化了部分页面的UI,提升用户视觉和使用体验 实现效果如下: ...