A

#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define inf 1e9
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; get min
const double eps = 1.0e-8;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
//const int maxn = 3e5 + 10;
const int maxm = ;
const int turn[][] = {{, }, { -, }, {, }, {, -}};
//priority_queue<int, vector<int>, less<int>> que;
//next_permutation
ll mod = 3e7;
int num[];
int main()
{
int n;
cin >> n;
int cur;
for (int i = ; i <= n; i++)
{
cin >> cur;
num[cur] = ;
}
int anser = ;
for (int i = ; i <= ; i++)
{
if (num[i])
{
anser++;
}
}
cout << anser << endl;
return ; }

B

#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define inf 1e9
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; get min
const double eps = 1.0e-8;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
//const int maxn = 3e5 + 10;
const int maxm = ;
const int turn[][] = {{, }, { -, }, {, }, {, -}};
//priority_queue<int, vector<int>, less<int>> que;
//next_permutation
ll mod = 3e7;
ll p, y;
bool check(ll now)
{
for (int i = ; i * i <= now && i <= p; i++)
{
if (now % i == )
{
return ;
}
}
return ;
}
int main()
{
cin >> p >> y;
int flag = ;
for (int i = y; i >= p + ; i--)
{
if (check(i))
{
cout << i << endl;
flag = ;
break;
}
}
if (!flag)
{
cout << - << endl;
}
return ;
}

C

#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define inf 1e9
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; get min
const double eps = 1.0e-10;
const double EPS = 1.0e-4;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
const int turn[][] = {{, }, { -, }, {, }, {, -}};
//priority_queue<int, vector<int>, less<int>> que;
//next_permutation
int main()
{
double k, d, t;
cin >> k >> d >> t;
ll k1 = k;
ll d1 = d;
double ans = ;
if (k1 % d1 == )
{
printf("%.1f\n", t);
return ;
}
else
{
double bei = (long long)(k / d) + 1.0;
//printf("bei: %.1f\n", bei);
double xunhuan = bei * d;
//printf("xunhuan: %.1f\n", xunhuan);
double ximie = xunhuan - k;
//printf("ximie: %.1f\n", ximie);
double once = k + ximie / 2.0;
//printf("once: %.1f\n", once);
double bei2 = (long long)(t / once);
//printf("bei2: %.1f\n", bei2);
double remain = t - once * bei2;
//printf("remain: %.1f\n", remain);
ans += bei2 * xunhuan;
//printf("ans: %.1f\n",ans);
if (remain <= k)
{
ans += remain;
}
else
{
ans += k + (remain - k) * 2.0;
}
printf("%.1f\n", ans);
}
}

D

anser[i][j][0]表示偶数步能到达 [1]表示奇数部能到达

每个点最多访问两次

#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define inf 1e9
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; get min
const double eps = 1.0e-10;
const double EPS = 1.0e-4;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
//const int maxn = 3e5 + 10;
const int maxm = ;
const int turn[][] = {{, }, { -, }, {, }, {, -}};
//priority_queue<int, vector<int>, less<int>> que;
//next_permutation
ll mod = 3e7;
const int maxn = ;
int anser[][];
int visit[];
int flag = ;
int road[];
vector<int> pla[];
void dfs(int now, int x)
{
visit[now] = ;
anser[now][x % ] = ;
road[x] = now;
int to;
int len = pla[now].size();
if (len == && (x % == ))
{
cout << "Win" << endl;
for (int i = ; i <= x; i++)
{
cout << road[i] << " ";
}
exit();
}
else
{
for (int i = ; i < len; i++)
{
to = pla[now][i];
if (visit[to] == )
{
flag = ;
if (anser[to][(x + ) % ] == )
{
continue;
}
dfs(to, x + );
}
else
{
if (anser[to][(x + ) % ] == )
{
continue;
}
dfs(to, x + );
}
}
}
visit[now] = ;
}
int main()
{
for (int i = ; i <= ; i++)
{
for (int j = ; j <= ; j++)
{
anser[i][j] = -;
}
}
int n, m;
int num;
int to;
cin >> n >> m;
for (int i = ; i <= n; i++)
{
scanf("%d", &num);
for (int j = ; j <= num; j++)
{
scanf("%d", &to);
pla[i].pb(to);
}
}
int aim;
cin >> aim;
dfs(aim, );
if (flag)
{
cout << "Draw" << endl;
return ;
}
cout << "Lose" << endl;
}

CF 937的更多相关文章

  1. 【codeforces】【比赛题解】#937 CF Round #467 (Div. 2)

    没有参加,但是之后几天打了哦,第三场AK的CF比赛. CF大扫荡计划正在稳步进行. [A]Olympiad 题意: 给\(n\)个人颁奖,要满足: 至少有一个人拿奖. 如果得分为\(x\)的有奖,那么 ...

  2. 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 ...

  3. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  4. cf Round 613

    A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...

  5. ARC下OC对象和CF对象之间的桥接(bridge)

    在开发iOS应用程序时我们有时会用到Core Foundation对象简称CF,例如Core Graphics.Core Text,并且我们可能需要将CF对象和OC对象进行互相转化,我们知道,ARC环 ...

  6. [Recommendation System] 推荐系统之协同过滤(CF)算法详解和实现

    1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...

  7. CF memsql Start[c]UP 2.0 A

    CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 m ...

  8. CF memsql Start[c]UP 2.0 B

    CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 25 ...

  9. CF #376 (Div. 2) C. dfs

    1.CF #376 (Div. 2)    C. Socks       dfs 2.题意:给袜子上色,使n天左右脚袜子都同样颜色. 3.总结:一开始用链表存图,一直TLE test 6 (1)如果需 ...

随机推荐

  1. tomcat简单性能优化

    1.内存使用配置 2.最大连接数配置

  2. Vue 项目构建

    一.初始化项目 1.vue init webpack (fileName) 2.项目名称 3.项目描述 4.项目作者 5.是否依赖 .Vue 文件开发 第一个选项可以不依赖 .Vue 文件开发, 第二 ...

  3. Spring boot 自定义一个starter pom

    用过springboot的自动配置会觉得非常方便,我们完全可以自己写一个starter pom,这样不仅可以有自动配置功能,而且具有更通用的的耦合度低的配置, 新建一个starter的maven项目, ...

  4. java网络通信:伪异步I/O编程(PIO)

    缺点:避免了线程资源耗尽的问题,但是根本上来说,serversocket的accept方法和inputstream的输入流方法都是阻塞型方法. 服务端:加了一个线程池,实现线程复用.客户端不变 pub ...

  5. window.screenLeft&&window.screenTop&&window.screenX&&window.screenY

    http://blog.sina.com.cn/s/blog_14e2a237b0102w4i0.html window.screenLeft&&window.screenTop&am ...

  6. oracle data guard --理论知识回顾01

    之前搭建了rac到单实例的dg环境,最近又在windows下搭建了dg,这一篇关于dg的一些理论知识回顾 官方文档 https://docs.oracle.com/cd/E11882_01/nav/p ...

  7. 网络编程.iocp

    1.(20191212)查到的一些资料:java从 JDK7开始 引入AOI(即 NIO2).然后 实现 IOCP使用的是 AsynchronousChannelGroup.AsynchronousS ...

  8. DB.JDBC_jar_下载

    1.Download Microsoft JDBC Driver for SQL Server - SQL Server _ Microsoft Docs.html(https://docs.micr ...

  9. echars 柱状图 堆叠状态 --》二次封装

    <template> <!-- 柱状图 堆叠 1. 调用页面引入 import EcharsColumnStack from '@/components/echarsColumnSt ...

  10. 【转】MySQL查询缓存详解

    [转]MySQL查询缓存详解 转自:https://www.cnblogs.com/Alight/p/3981999.html 相关文章:http://www.zsythink.net/archive ...