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 ...
随机推荐
- SQL存储过程大全
--增加 create proc usp_insertToText ), ), @usitPrice decimal as begin insert into TEST1 output inserte ...
- finla变量,方法和类
1.finla变量关键字可用于变量声明,一旦该变量被设定,就不可以再改变该变量的值,通常,有final定义的变量为常量 final关键字定义的变量必须在声明时对其进行赋值定义,final除了可以修饰基 ...
- windows 远程桌面命令 mstsc
win+R------>mstsc: 弹出: 目标机必开远程
- MVC – 8.Razor 布局
8.1.@RenderBody() 8.2.多个"占位符":@RenderSection() 8.3.js合并 @Scripts.Render("~/bundles/js ...
- Delphi的TThread中的FreeOnTerminate成员
类 Create 了就要 Free; 但 TThread(的子类) 有特殊性, 很多时候我们不能确定新建的线程什么时候执行完(也就是什么时候该释放); 如果线程执行完毕自己知道释放就好了, 所以 ...
- 讲解JS的promise,这篇是专业认真的!
http://www.zhangxinxu.com/wordpress/2014/02/es6-javascript-promise-%E6%84%9F%E6%80%A7%E8%AE%A4%E7%9F ...
- .Net Ioc Unity
Unity 的接口IUnityContainer public interface IUnityContainer : IDisposable IUnityContainer RegisterType ...
- 解决phpcms V9 推荐位无法排序
/phpcms/modules/content/content.php 454行 /** * 排序 */public function listorder() { if(isset($_GET['do ...
- python生成RSS(PyRSS2Gen)
既然能够用python解析rss,那么也顺带研究下生成rss. 其实很简单,只是生成一个比较特殊点的xml文档而已. 这里我使用了PyRss2Gen,用法很简单,看代码就知道了,如下: import ...
- C语言中main函数的参数
转自:http://blog.csdn.net/cnctloveyu/article/details/3905720 我们经常用的main函数都是不带参数的.因此main 后的括号都是空括号.实际上, ...