ural 1070. Local Time
1070. Local Time
Memory limit: 64 MB
Input
Output
Sample
input | output |
---|---|
23.42 00.39 |
4 |
Problem Source: Ural State Univerisity Personal Contest Online February'2001 Students Session
/**
Create By yzx - stupidboy
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef double DB;
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair inline int Getint()
{
int Ret = ;
char Ch = ' ';
bool Flag = ;
while(!(Ch >= '' && Ch <= ''))
{
if(Ch == '-') Flag ^= ;
Ch = getchar();
}
while(Ch >= '' && Ch <= '')
{
Ret = Ret * + Ch - '';
Ch = getchar();
}
return Flag ? -Ret : Ret;
} const int DAY = * , MAXFLIGHT = * , MAXDELTA = * ;
int b1, e1, b2, e2; inline int GetTime()
{
int x = Getint();
int y = Getint();
return x * + y;
} inline void Input()
{
b1 = GetTime();
e1 = GetTime();
b2 = GetTime();
e2 = GetTime();
} inline void Solve()
{
int ans = -INF;
for(int flight = ; flight <= MAXFLIGHT; flight++)
{
for(int delay = -MAXDELTA; delay <= MAXDELTA; delay++)
{
int x = b1;
x = x + flight - delay;
x = ((x % DAY) + DAY) % DAY;
if(x != e1) continue; x = b2;
x = x + delay;
int left = x + flight - , right = x + flight + ;
left = ((left % DAY) + DAY) % DAY;
right = ((right % DAY) + DAY) % DAY;
if(!(left <= e2 && e2 <= right)) continue; ans = delay;
break;
}
if(ans != -INF) break;
} printf("%.0lf\n", abs(ans) / 60.0);
} int main()
{
freopen("a.in", "r", stdin);
Input();
Solve();
return ;
}
ural 1070. Local Time的更多相关文章
- 深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow
深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow 最近在公司做深度学习相关的学习和实验,原来一直 ...
- ural 1252. Sorting the Tombstones
1252. Sorting the Tombstones Time limit: 1.0 secondMemory limit: 64 MB There is time to throw stones ...
- ural 1073. Square Country
1073. Square Country Time limit: 1.0 secondMemory limit: 64 MB There live square people in a square ...
- URAL 1779 F - The Great Team 构造
F - The Great TeamTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest ...
- bzoj 1814 Ural 1519 Formula 1 插头DP
1814: Ural 1519 Formula 1 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 942 Solved: 356[Submit][Sta ...
- URAL 1252 ——Sorting the Tombstones——————【gcd的应用】
Sorting the Tombstones Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I ...
- Ural State University Internal Contest October'2000 Junior Session
POJ 上的一套水题,哈哈~~~,最后一题很恶心,不想写了~~~ Rope Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7 ...
- URAL 1099 Work scheduling 一般图的最大匹配 带花树算法(模板)
R - Work scheduling Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u ...
- OVS local network 连通性分析 - 每天5分钟玩转 OpenStack(132)
前面已经创建了两个 OVS local network,今天详细分析它们之间的连通性. launch 新的 instance "cirros-vm3",网络选择 second_lo ...
随机推荐
- UITableView的scrollToRowAtIndexPath:atScrollPosition:animated的崩溃
UITableView的scrollToRowAtIndexPath:atScrollPosition:animated的崩溃 [摘要:reason: '-[UITableView _conten ...
- Android下拉刷新效果实现
本文主要包括以下内容 自定义实现pulltorefreshView 使用google官方SwipeRefreshLayout 下拉刷新大致原理 判断当前是否在最上面而且是向下滑的,如果是的话,则加载数 ...
- Java中length,length(),size()区别
length属性:用于获取数组长度. eg: int ar[] = new int{1,2,3} /** * 数组用length属性取得长度 */ int lenAr = ar.length;//此处 ...
- Android View -- setTranslationX
通过此方法使View位置发生偏移,达到margin的作用却又不改变View的getLeft()的值. 恢复方法是setTranslationX(0),而不是上一次偏移量的相反数. 不过,通过getLo ...
- DOM – 7.动态创建DOM + 8.innerText innerHTML value
7.动态创建DOM 8.innerText innerHTML value 7+8 练习:案例:点击按钮动态增加网站列表,分两列,第一列为网站的名字,第二列为带网站超链接的网站名.增加三行常见网站 ...
- 基于Bootstrap简单实用的tags标签插件
http://www.htmleaf.com/jQuery/ jQuery之家 自由分享jQuery.html5和css3的插件库 基于Bootstrap简单实用的tags标签插件
- 无废话Android之内容观察者ContentObserver、获取和保存系统的联系人信息、网络图片查看器、网络html查看器、使用异步框架Android-Async-Http(4)
1.内容观察者ContentObserver 如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调 ...
- Android请求服务器的两种方式--post, get的区别
android中用get和post方式向服务器提交请求_疯狂之桥_新浪博客http://blog.sina.com.cn/s/blog_a46817ff01017yxt.html Android提交数 ...
- 用C获得当前系统时间(转)
#include <stdio.h> #include <time.h> void main () { time_t rawtime; struct tm * timeinfo ...
- 在windows系统的文件右键菜单中增加“命令提示符”
本实用小工具能够在windows系统的文件右键菜单中增加“命令提示符”,方便快速进入制定文件的命令提示窗口,避免逐层输入或复制文件夹路径,极其实用. 工具下载地址如下:360云盘(访问密码:5b71) ...