ural 2063. Black and White
2063. Black and White
Memory limit: 64 MB
Input
Output
Sample
input | output |
---|---|
2 |
? 1 2 |
Notes
Problem Source: Ural Regional School Programming Contest 2015
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std; int n; int main()
{
ios::sync_with_stdio();
srand(time());
int m;
cin >> m;
for(int n = ; n <= m + ; n++)
{
for(int i = ; i <= n; i++)
for(int j = ; j < i; j++)
cout << "? " << j << ' ' << i << "\n";
int x = rand() % (n - ) + ;
cout << "! " << x << ' ' << x + << "\n";
cout.flush();
}
return ;
}
ural 2063. Black and White的更多相关文章
- ural 1243. Divorce of the Seven Dwarfs
1243. Divorce of the Seven Dwarfs Time limit: 1.0 secondMemory limit: 64 MB After the Snow White wit ...
- ural 1221. Malevich Strikes Back!
1221. Malevich Strikes Back! Time limit: 1.0 secondMemory limit: 64 MB After the greatest success of ...
- URAL 1297 Palindrome 后缀数组
D - Palindrome Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Subm ...
- URAL 1297 最长回文子串(后缀数组)
1297. Palindrome Time limit: 1.0 secondMemory limit: 64 MB The “U.S. Robots” HQ has just received a ...
- URAL - 1243 - Divorce of the Seven Dwarfs (大数取模)
1243. Divorce of the Seven Dwarfs Time limit: 1.0 second Memory limit: 64 MB After the Snow White wi ...
- Ural 1225. Flags 斐波那契DP
1225. Flags Time limit: 1.0 secondMemory limit: 64 MB On the Day of the Flag of Russia a shop-owner ...
- imshow() displays a white image for a grey image
Matlab expects images of type double to be in the 0..1 range and images that are uint8 in the 0..255 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
随机推荐
- ALT+数字直接取得字符的原理
字符 字节码 utf-8编码 机器二进制码 之间的联系 byte数组与二进制码关系参考文献 例如:字符“我” byte字节码是 [-26, -120, -111] 绝对值源码 [00011010, 0 ...
- 红外解码编码学习----verilog
在设计中运用红外遥控器可以很好的解决按键缺少的问题,还可以方便的控制产品. 红外发射部分: 红外发射管: 判断红外发射管的好坏 : 电路原理图: 接收部分: 传输的NEC协议: 本实验电路: veri ...
- eclipse使用tips-Toggle Mark Occurrences 颜色更改
Toggle Mark Occurrences这个功能非常好用,能把选中的方法/变量在本类中全部出现的地方高亮显示,是一个非常实用的功能.但是默认颜色是灰色,非常毁眼.可以通过下面的设置更改为自己喜欢 ...
- Codeforces Round #363 Fix a Tree(树 拓扑排序)
先做拓扑排序,再bfs处理 #include<cstdio> #include<iostream> #include<cstdlib> #include<cs ...
- 莫队算法 2038: [2009国家集训队]小Z的袜子(hose)
链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2038 2038: [2009国家集训队]小Z的袜子(hose) Time Limit: 20 ...
- maven File encoding has not been set
原pom.xml配置文件: <?xml version="1.0" encoding="UTF-8"?> <project xmlns=&qu ...
- 跨平台C的IDE
1.JetBrains的新跨平台C++ IDE,CLion已经开始EAP了,不过这货是收费的 http://confluence.jetbrains.com/display/CLION/Early+A ...
- Centos6.5里安装Hbase(伪分布式)
首先我们到官方网站下载Hbase,而我使用的版本是hbase-0.94.27.tar.gz 解压下来: tar zxvf hbase-.tar.gz 寻找java安装路径 [root@localhos ...
- 随机生成字符串-php-js
js <script language="javascript"> function randomString(len) { len = len || 32; var ...
- WCF学习笔记之消息交换模式
在WCF通信中,有三种消息交换模式,OneWay(单向模式), Request/Reponse(请求回复模式), Duplex(双工通信模式)这三种通信方式.下面对这三种消息交换模式进行讲解. 1. ...