以下所有AC题解程序来自“仙客传奇”团队。

A. Exotic … Ancient City

题解链接:
2018 EC-Final 部分题解 (A,J)
ABCDEFGIJKL CodeForces Gym 102056 简要题解

B. Mysterious … Host

题解链接:
ABCDEFGIJKL CodeForces Gym 102056 简要题解

C. Heretical … Möbius

题解链接:
【中国剩余定理】【技巧】codeforces102056C Heretical … Möbius
Gym - 102056C(2018EC final) - CRT
ABCDEFGIJKL CodeForces Gym 102056 简要题解

D. Deja vu of … Go Players

AC的C++语言程序:

#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define IO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
int n,m;
main()
{IO;int T;cin>>T;while(T--){cin>>n>>m;for(int i=1,x;i<=n;i++){cin>>x;}for(int i=1,x;i<=m;i++){cin>>x;}if(n>m) cout<<"No"<<endl;else cout<<"Yes"<<endl;}
}

E. Immortal … Universe

题解链接:
ABCDEFGIJKL CodeForces Gym 102056 简要题解

F. Interstellar … Fantasy

AC的C++语言程序:

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;const double pi = acos(-1);
double os, ot, st, os2, ot2, st2;
double r1, r2, ans1, ans2, ans3;
typedef struct node {double x, y, z;
} node;
double sqr(double x) { return x * x;}
double calR(double a2, double b2, double c2) { return (acos((a2 + b2 - c2) / (2 * sqrt(a2 * b2))));}
double dis2(node a, node b) { return sqr(a.x - b.x) + sqr(a.y - b.y) + sqr(a.z - b.z); } int main() {int t;scanf("%d", &t);while (t--) {node oo;double R;node s, t;scanf("%lf%lf%lf%lf", &oo.x, &oo.y, &oo.z, &R);scanf("%lf%lf%lf%lf%lf%lf", &s.x, &s.y, &s.z, &t.x, &t.y, &t.z);os2 = dis2(oo, s); ot2 = dis2(oo, t); st2 = dis2(s, t);if(st2 == 0) {printf("%.8lf\n", 0.0);continue;}os = sqrt(os2); ot = sqrt(ot2); st = sqrt(st2);if(calR(ot2, st2, os2) >= pi / 2 || calR(os2, st2, ot2) >= pi/2) {printf("%.8lf\n", st);continue;}double R_sot = calR(ot2,os2,st2);double h = os * ot * sin(R_sot) / st;if(h >= R) {printf("%.8lf\n", st);continue;}r1 = acos(R / os);r2 = acos(R / ot);ans1 = sqrt(os2 - R * R);ans2 = sqrt(ot2 - R * R);ans3 = R * (R_sot - r1 - r2);printf("%.8lf\n",ans1 + ans2 + ans3);}
}

G. Omnipotent … Garland

题解链接:
ABCDEFGIJKL CodeForces Gym 102056 简要题解

H. Saintly … Coins

I. Misunderstood … Missing

AC的C++语言程序:

#include <cstdio>
#include <cstring>
#include <algorithm>using namespace std;
typedef long long ll;
const int MAXN = 101;
int n;
ll dp[2][MAXN][MAXN*MAXN+1];
ll a[MAXN], b[MAXN], c[MAXN];
int main() {int T;scanf("%d", &T);while(T--) {scanf("%lld", &n);for(int i = 1; i <= n; i++)scanf("%lld%lld%lld", &a[i], &b[i], &c[i]);memset(dp, 0, sizeof(dp));dp[n & 1][1][n] = a[n];for(int i = n - 1; i >= 1; i--) {for(int j = 1; j <= n - i; j++) {int u = (i + i + j) * (j - 1) / 2 + n, v = (n + n - j + 1) * j / 2;for(int k = u; k <= v; k++) {dp[i & 1][j + 1][k + i] = max(dp[i & 1][j + 1][k + i], dp[(i + 1) & 1][j][k] + a[i]);dp[i & 1][j][k] = max(dp[i & 1][j][k], dp[(i + 1) & 1][j][k] + (k - j * i) * b[i]);dp[i & 1][j][k] = max(dp[i & 1][j][k], dp[(i + 1) & 1][j][k] + j * c[i]);}}}ll ans = 0;for(int j = 1; j <= n; j++)for(int k = 1; k <= MAXN * MAXN + 1; k++) ans = max(ans, dp[1][j][k]);printf("%lld\n", ans);}
}

J. Philosophical … Balance

题解链接:
2018 EC-Final 部分题解 (A,J)
ABCDEFGIJKL CodeForces Gym 102056 简要题解

K. Desperate … Fire Survive

题解链接:
ABCDEFGIJKL CodeForces Gym 102056 简要题解

L. Eventual … Journey

AC的C++语言程序:

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
const int MAXN = 100000;
using namespace std;
int lr[MAXN + 5], num[MAXN + 5];
int n, m, nl, nr, nl1, nr1;
int main() {cin >> n >> m;nl = nr = 0;for (int i = 1; i <= n; i++){cin >> lr[i];if (lr[i]) nl++;else nr++;}for (int i = 1; i <= m; i++){int u, v;cin >> u >> v;if (lr[u] != lr[v]) {if (num[u]==0) {if (lr[u] == 1) nl1++;else nr1++;}if (num[v]==0){if (lr[v] == 1) nl1++;else nr1++;}num[u]++;num[v]++;}}for (int i = 1; i <=n;i++){int ans = 0;if (lr[i] == 1){if (num[i] == 0) ans += nl - 1 + nr1 * 2 + (nr - nr1 ) * 3;else ans += num[i] + (nl - 1) + 2 * (nr - num[i]);} else{if (num[i] == 0) ans += nr - 1 + nl1 * 2 + (nl - nl1) * 3;else ans += num[i] + (nr - 1) + 2 * (nl - num[i]);}if (i != n) cout << ans << " ";else cout << ans << endl;}return 0;
}

题解链接:
ABCDEFGIJKL CodeForces Gym 102056 简要题解

2018-2019 ACM-ICPC, Asia East Continent Finals题解相关推荐

  1. 2018-2019 ACM-ICPC, Asia East Continent Finals

    2018-2019 ACM-ICPC, Asia East Continent Finals 在此附上吉老师的视频题解 Problem C:Heretical - Möbius 思路:根据莫比乌斯系数 ...

  2. 【2020 ICPC Asia East Continent Final】赛前训练

    这里写自定义目录标题 [2020 ICPC Asia East Continent Final]赛前训练 A - Namomo Subsequence 输入: 输出: 样例: 解析: 代码: F - ...

  3. 2015 ACM/ICPC Asia Regional Shenyang Online题解

    以下所有AC题解程序来自"仙客传奇"团队. AC题数:7/13 ABCFGJL A. Traversal AC的C++语言程序: #include <bits/stdc++. ...

  4. 2016 ACM / ICPC Asia dalian Regional Contest 题解(11 / 11)【每日亿题2021 / 2 / 17】

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A .(2017 ACM ICPC dalian H)To begin or not to be ...

  5. 2020 ICPC Asia East Continent Final_K.Allin

    题面: 题意: 打牌题,意思是说给你五张牌h1,h2,c1,c2,c3:除此之外本题还要考虑未给出的四张牌c4,c5,以及p1,p2. p1,p2是对面已知有的牌,h1,h2是我手上已知有的牌. c1 ...

  6. 2020 ICPC Asia East Continent Final D. City Brain(最短路+三分)

    传送门 题意: 给出nnn​​ 个点,mmm条边的无向带权图,初始边权都为111,一共有kkk 次操作机会,每次操作可以选择一条边使其边权+1+1+1, 通过一条边的时间为 1/1/1/边权 ,求mi ...

  7. 2018-2019 ACM-ICPC, Asia East Continent Finals D.F.I.L(VP)

    专业打假赛 VP情况略,不会的题单独补了 D.Deja vu of - Go Players 题目分析 签到题,直接判断n,mn,mn,m大小关系即可. Code #include <bits/ ...

  8. 2017 ACM ICPC Asia Shenyang Regional Contest 题解(10 / 13)【每日亿题2 / 16】

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A.(2017 ICPC shenyang I)Little Boxes B.(2017 ICP ...

  9. 2015 ACM/ICPC Asia Regional Changchun Online题解

    以下所有AC题解程序来自"仙客传奇"团队. AC题数:7/13 ABEGHJL A. Alisha's Party AC的C++语言程序: #pragma warning(disa ...

最新文章

  1. 软件测试技术篇:UI自动化到底是难是易?
  2. 【跃迁之路】【707天】程序员高效学习方法论探索系列(实验阶段464-2019.1.28)...
  3. bd9.1 MySQL 常见问题
  4. 学会使用Chromium中的LOG
  5. python代码案例详解-Python编程:案例详解输出函数print
  6. Leave List-Processing 新解
  7. idea 中使用 jetty 插件
  8. linux克隆出现mac地址错误
  9. SAP Commerce(原Hybris)的订单处理框架和SAP CRM One Order框架
  10. Spark SQL(九)之基于用户的推荐公式
  11. 用Java测试多线程代码
  12. dubbo protocol port 消费者端_Dubbo源码:搞定URL,就走完了进度条的一半
  13. 宏定义与预处理、函数和函数库
  14. 微信发ascii_微信公众平台开发(107) 分享到朋友圈和发送给好友
  15. python3 三级菜单-基础版
  16. 拓端tecdat|R语言圆填充( Circle packing)算法圆堆图圆形空间填充算法可视化
  17. android手机更改手机密码,重要提醒:手机这个密码一定要改!
  18. 服务器上flash不显示动画,解决Firefox上网看不了Flash网页的问题
  19. Nginx 配置多个SSL域名指向不同端口
  20. x20手机科学计算机,360手机N4 跑分遭泄露 Helio X20名不虚传

热门文章

  1. BerryNet: Deep Learning Gateway on Raspberry Pi
  2. Arcgis Javascript那些事儿(五)--arcgis server发布自定义比例尺地图
  3. ArcGIS制图表达Representation-制图表达介绍
  4. 技巧篇-图层叠加之美(一)
  5. C#实现Ping命令
  6. roadrunner监控linux服务器,Jenkins添加TPS与服务器监控变化曲线图
  7. SparkSQL Catalog的作用和访问Hive元数据信息
  8. 把RDD简单的转换成DataFrames
  9. linux下mysql启动失败问题解决(CentOS7)
  10. dnf上海2服务器维护,DNF上海2出现大面积盗号并迅速蔓延请注意