CF 16C. Monitor
水题依旧无法1Y。
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std ;
#define LL __int64
LL gcd(LL a,LL b)
{
return b == ?a:gcd(b,a%b);
} int main()
{
LL a,b,x,y,t;
LL str,end,mid;
scanf("%I64d%I64d%I64d%I64d",&a,&b,&x,&y);
t = gcd(x,y);
x = x/t;
y = y/t;
if(x > a||y > b)
{
printf("0 0\n");
return ;
}
str = ;
end = a/x;
while(str < end)
{
mid = (str+end + )/;
if(mid*x > a||mid*y > b)
end = mid - ;
else
str = mid;
}
printf("%I64d %I64d\n",end*x,end*y);
return ;
}
CF 16C. Monitor的更多相关文章
- cf D. Broken Monitor
http://codeforces.com/contest/370/problem/D 题意:输入一张图,上面只有两个字符'w'和‘.’ ,如果可以用一个正方形把所有的‘w’围起来,所有的‘w’都在正 ...
- 11g新特性:Health Monitor Checks
一.什么是Health Monitor ChecksHealth Monitor Checks能够发现文件损坏,物理.逻辑块损坏,undo.redo损坏,数据字典损坏等等.Health Monitor ...
- Codeforces 846D Monitor(简单二分+二维BIT)
D. Monitor time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou ...
- C#各种同步方法 lock, Monitor,Mutex, Semaphore, Interlocked, ReaderWriterLock,AutoResetEvent, ManualResetEvent
看下组织结构: System.Object System.MarshalByRefObject System.Threading.WaitHandle System.Threading.Mutex S ...
- API Monitor简介(API监控工具)
API Monitor是一个免费软件,可以让你监视和控制应用程序和服务,取得了API调用. 它是一个强大的工具,看到的应用程序和服务是如何工作的,或跟踪,你在自己的应用程序的问题. 64位支持 API ...
- 创建 Monitor 并测试 - 每天5分钟玩转 OpenStack(124)
前面我们创建了 Pool,VIP 并添加了 Member.今天将创建 Monitor,然后测试 LBaaS 是否能够正常工作. 创建 Monitor LBaaS 可以创建 monitor,用于监控 P ...
- ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'
凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...
- Guava monitor
Guava的com.google.util.concurrent类库提供了相对于jdk java.util.concurrent包更加方便实用的并发类,Monitor类就是其中一个.Monitor类在 ...
- DAC Usage3:Monitor Data-tier Applications
If you deploy a DAC to a managed instance of the Database Engine, information about the deployed DAC ...
随机推荐
- svn删除所有.svn文件
svn 删除所有的 .svn文件 find . -name .svn -type d -exec rm -fr {} \;
- Extjs ComboBox 动态选中第一项
有时候我们希望通过Store加载过来的数据,ComboBoxItem能够选择第一条数据作为默认数据,我们可以这么操作: var storeinfo = Ext.create('Ext.data.Sto ...
- sort函数用法
原文链接:http://blog.csdn.net/csust_acm/article/details/7326418 sort函数的用法 做ACM题的时候,排序是一种经常要用到的操作.如果每次都自己 ...
- [LeetCode] Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and ...
- c++ 的 坑真多之头文件
我发现类在做参数时,是可以不引用头文件,即不用#include"xxx.h"的,比如下面这样是没有问题的 #pragma once #include <string> ...
- 关于WCF的一些注意事项
1.服务代理,建立通道的方法,要注意及时关掉代理,因为服务设置有一个服务的最大连接数,超过这个连接数,则后面的连接将会等待,一直到超时,报错!! 2.在已有配置的基础上,利用代码更改终结点,如果重设了 ...
- I/O复用模型之select学习
linux下的I/O模型可以分为5种: 1.阻塞式I/O模型 2.非阻塞式I/O模型 3.I/O复用模型 4.信号驱动I/O模型 5.异步I/O模型 简单解释: 阻塞和非阻塞:就是说需要做一件事的时候 ...
- SQL2000/2005字符串拆分为列表通用函数
------------------------------------------------------------------ -- Author : htl258(Tony) -- Dat ...
- PB之入门-itemchanged(long row,dwobject dwo,string data)
每天的总结都是必须,好记性不如烂笔头,好吧,一星期没做笔记了,最近忙上PB了,哎东学学西学学,最可怕的就是最后都半斤八两,吐槽一下关于PB的资源为何如此之少,今天记录的是关于itemchanged事件 ...
- Liferay 6.2 改造系列之十七:当Portlet无权限时,不显示错误信息
在/portal-master/portal-impl/src/portal.properties文件中,有如下配置: # # Set this to true if users are shown ...