当前位置: 首页 > wzjs >正文

网络的基本概念seo网络推广软件

网络的基本概念,seo网络推广软件,谁有人和兽做的网站?,淘宝网站页面设计题目链接:https://codeforces.com/gym/105924 题目背景: 给出一个时间区间和当前时间,在时间区间内选择一个时间使得该时间与当前时间的时针夹角与分针夹角之和最小。 思路: 暴力枚举区间内的所有时间,计算与当前时间…
题目链接:https://codeforces.com/gym/105924
题目背景:

        给出一个时间区间和当前时间,在时间区间内选择一个时间使得该时间与当前时间的时针夹角与分针夹角之和最小。

思路:

       暴力枚举区间内的所有时间,计算与当前时间夹角的度数即可。

        注:由于时针上的一分钟为0.5度,需要取浮点数,可以将一圈定义为720度,这样一分钟就为1度。

数据范围:

        T <= 1e4。

时间复杂度:

        O(720T)

ac代码: 
#include <bits/stdc++.h>#define ioscc ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define me(a, x) memset(a, x, sizeof a)
#define all(a) a.begin(), a.end()
#define sz(a) ((int)(a).size())
#define pb(a) push_back(a)
using namespace std;typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<bool> vb;const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int MAX = (1ll << 31) - 1;
const int MIN = 1 << 31;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) noexcept
{for (int i = 0; i < sz(a) - 10; i++)std::cout << a[i] << ' ';return os;
}template <class T>
istream &operator>>(istream &in, vector<T> &a) noexcept
{for (int i = 0; i < sz(a) - 10; i++)std::cin >> a[i];return in;
}/* ----------------- 有乘就强转,前缀和开ll ----------------- */void solve()
{int x0, y0, x1, y1, x2, y2;cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2;auto cost = [&](int a, int b) -> int{return min(abs(a - b), 720 - abs(a - b));};ll minn = MAX;ll ans1 = MIN, ans2 = MIN;int dh0 = x0 * 60 + y0;int dm0 = y0 * 12;int l = x1 * 60 + y1;int r = x2 * 60 + y2;for (int i = l; i <= r; ++i){int h = i / 60;int m = i % 60;int dh1 = h * 60 + m;int dm1 = m * 12;ll cnt = cost(dh0, dh1) + cost(dm0, dm1);if (cnt < minn || (cnt == minn && (h < ans1 || (h == ans1 && m < ans2)))){minn = cnt;ans1 = h;ans2 = m;}}cout << ans1 << ' ' << ans2 << endl;
}int main()
{ioscc;int T;cin >> T;while (T--)solve();return 0;
}

http://www.dtcms.com/wzjs/189939.html

相关文章:

  • 投资理财培训网站建设b站推广软件
  • 找生意项目seo关键词优化排名软件
  • gustos wordpress主题seo优化排名是什么
  • 免费自己做网站吗网站做外链平台有哪些
  • 互联网营销优势seo免费外链工具
  • 用织梦做的网站怎样看seo教学平台
  • 惠州做棋牌网站建设找哪家效益快本周热点新闻事件
  • 网站建设费应怎样做会计分录四川省人民政府官网
  • 辽宁省住房和城乡建设厅证件查询系统优化大师
  • 网站建设毕业设计引言怎么写广州 竞价托管
  • 建设礼品网站的策划书湖北seo网站推广
  • 企业网站是怎么建站的重庆森林经典台词
  • 自己做网站 怎么赚钱太原seo外包服务
  • 网站后台查找软件新网站应该怎么做seo
  • oa网站建设推广中文域名的网站
  • 温州招聘网seo一个关键词多少钱
  • 专门做孩子早教的网站seo怎么学在哪里学
  • 九江专业的企业网站建设公司百度推广计划
  • 高新快速建设网站找哪家自媒体平台有哪些
  • 怎么用手机建网站百度认证官网
  • 做网站去哪里找广告主云计算培训
  • 不需要网站备案的空间关键词排名方法
  • 内蒙古做网站公司sem优化
  • 做流程图网站今日头条网页版入口
  • 移动端显卡seo排名优化联系13火星软件
  • 三门县住房和城乡建设规划局网站全球搜索引擎排名
  • 网站怎么做可留言功能襄阳seo
  • 用dreamweaver做网站怎么切块社群运营
  • 南宁网站快速优百度电话客服
  • 做网站要多少钱新乡今日头条淄博新闻