目前先放几道题面,等晚上做完实验补

Update:A ~ D,更新剩余的题面(题面复制会有链接水印,懒得一一去除、直接截图)

A、签到

真·签到题

输出祝贺祖国成立70周年!即可

B、欧涛的烦恼

思路:

简单累加,然后注意取整即可

// Author : RioTian
// Time : 20/11/02
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll _, n;
void solve() {
cin >> n;
int a;
long long sum = 0;
for (int i = 0; i < n; i++) {
cin >> a;
sum += a;
}
cout << (sum + n - 1) / n << endl;
}
int main() {
// freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> _;
while (_--) solve();
}

C、欧涛最短路

思路:

跑一遍迪杰斯特拉最短路就可以的样子,不知道为什么没什么人过

// Author : RioTian
// Time : 20/11/02
#include <bits/stdc++.h>
#define ll long long
#define N 608
using namespace std;
const double INF = 0x4242424242424242;
int vis[N];
int path[N];
double dis[N];
double mp[N][N];
double cord[N][3];
double ans;
void dijkstra(int n) {
for (int i = 0; i < n; ++i) dis[i] = mp[0][i];
dis[0] = 0;
vis[0] = 1;
double mmin = dis[606];
int pos = -1;
for (int i = 0; i < n; ++i) {
mmin = dis[606];
pos = -1;
for (int j = 0; j < n; ++j) {
if (!vis[j] && dis[j] < mmin) {
pos = j;
mmin = dis[j];
}
}
if (pos == -1) break;
vis[pos] = 1;
for (int j = 0; j < n; ++j) {
if (!vis[j] && dis[j] > dis[pos] + mp[pos][j]) {
dis[j] = dis[pos] + mp[pos][j];
path[j] = pos;
}
}
}
ans = dis[n - 1];
}
int main() {
int n;
double m;
while (cin >> n >> m) {
memset(mp, 0x42, sizeof mp);
memset(dis, 0x42, sizeof dis);
memset(path, -1, sizeof path);
memset(vis, 0, sizeof vis);
cin >> cord[0][0] >> cord[0][1] >> cord[0][2];
cin >> cord[n + 1][0] >> cord[n + 1][1] >> cord[n + 1][2];
for (int i = 1; i <= n; ++i)
scanf("%lf %lf %lf", &cord[i][0], &cord[i][1], &cord[i][2]);
for (int i = 0; i <= n + 1; ++i) {
for (int j = i + 1; j <= n + 1; ++j) {
double x =
(1.0 * cord[i][0] - cord[j][0]) * (cord[i][0] - cord[j][0]);
double y =
(1.0 * cord[i][1] - cord[j][1]) * (cord[i][1] - cord[j][1]);
double z =
(1.0 * cord[i][2] - cord[j][2]) * (cord[i][2] - cord[j][2]);
double len = sqrt(x + y + z);
if (len <= m) mp[i][j] = mp[j][i] = len;
}
}
dijkstra(n + 2);
if (ans < dis[606]) {
printf("%.3f\n", ans);
stack<int> st;
while (!st.empty()) st.pop();
for (int i = path[n + 1]; i != -1; i = path[i]) st.push(i);
cout << "Start ";
while (!st.empty()) {
cout << st.top() << " ";
st.pop();
}
cout << "End\n";
} else
cout << -1 << endl;
}
}

D、 甜甜圈

// Author : RioTian
// Time : 20/11/02
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
// freopen("in.txt","r",stdin);
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
string s;
int n;
cin >> n;
while (n--) {
cin >> s;
int res = 0;
for (int i = 0; i < s.length(); ++i) {
if (s[i] == '0' || s[i] == '4' || s[i] == '6' || s[i] == '9') res++;
else if (s[i] == '8') res += 2;
}
cout << res << endl;
}
}

E、欧涛爬树

F、欧涛B

G、数据结构

H、谁在说谎

// Author : RioTian
// Time : 20/11/08
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
int n, dp[N], v[N];
struct node {
int l, r;
} nd[N], lst_nd[N];
bool cmp(node a, node b) {
if (a.r != b.r) return a.r < b.r;
return a.l < b.l;
}
int main() {
// freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int l, r, tol = 0, tot = 0;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> l >> r;
if (l + r >= n) continue;
nd[++tol].l = l + 1;
nd[tol].r = n - r;
}
sort(nd + 1, nd + 1 + tol, cmp);
for (int i = 1; i <= tol; ++i) {
if (nd[i].l != nd[i - 1].l || nd[i].r != nd[i - 1].r)
lst_nd[++tot].l = nd[i].l, lst_nd[tot].r = nd[i].r;
v[tot] = min(v[tot] + 1, nd[i].r - nd[i].l + 1);
}
for (int i = 1, j = 1; i <= n; i++) {
dp[i] = dp[i - 1];
while (j <= tot && lst_nd[j].r == i) {
dp[i] = max(dp[i], dp[lst_nd[j].l - 1] + v[j]);
j++;
}
}
cout << n - dp[n] << endl;
}

I、不要666

J、组合技

K、这个勇者明明超强却过分慎重

玩梗好评

基本递推,打表找规律

const int mod = 666666;
ll n, m;
int main() {
//freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int a = 4, b = 233, ans[100000] = {0}, c = 0;
for (int i = 1; i <= 2523; ++i) {
c = ((a * 3 % mod) + (b * 4 % mod)) % mod;
a = b, b = c;
ans[i] = c;
}
while (cin >> n >> m) {
if (n == 1)
cout << m - 4 << endl;
else if (n == 2)
cout << m - 233 << endl;
else
cout << m - ans[(n - 2) % 2520] << endl;
}
}

华东交通大学2019年ACM 双基 程序设计竞赛 个人题解(A - K)的更多相关文章

  1. 华东交通大学2018年ACM“双基”程序设计竞赛部分题解

    链接:https://ac.nowcoder.com/acm/contest/221/C来源:牛客网 C-公式题(2) 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其 ...

  2. 华东交通大学2018年ACM“双基”程序设计竞赛 C. 公式题 (2) (矩阵快速幂)

    题目链接:公式题 (2) 比赛链接:华东交通大学2018年ACM"双基"程序设计竞赛 题目描述 令f(n)=2f(n-1)+3f(n-2)+n,f(1)=1,f(2)=2 令g(n ...

  3. 华东交通大学2016年ACM“双基”程序设计竞赛 1007

    Problem Description ACM小学妹在今天的暑假训练结束后,想看球赛放松一下.当他打开电脑时查询到联盟今天直播N场球赛,每场球赛的起止时间(S1,E1),(S2,E2),...,(SN ...

  4. 华东交通大学2016年ACM“双基”程序设计竞赛 1001

    Problem Description 输入一个非负的int型整数,是奇数的话输出"ECJTU",是偶数则输出"ACM". Input 多组数据,每组数据输入一 ...

  5. 华东交通大学2016年ACM“双基”程序设计竞赛 1008

    Problem Description halfyarn找你写个简单的题?好哒!给你n个整数,现在要求你选择两个位置的数,例如选择第pos_a个数a,和第pos_b个数b,给定ans=min(a,b) ...

  6. 华东交通大学2016年ACM“双基”程序设计竞赛 1005

    Problem Description 最近侯ry感觉自己在数学方面的造诣不忍直视:他发现他的学习速率呈一个指数函数递增,疯狂的陷入学习的泥潭,无法自拔:他的队友发现了他的学习速率y=e^(b*lna ...

  7. 华东交通大学2016年ACM“双基”程序设计竞赛 1004

    Problem Description LB是个十分喜欢钻研的人,对什么事都要搞明白.有一天他看到一个公式,((a-b)*c+d*e)/f=k.他想如果给定K的值,一共有多少种不同整数的组合(a,b, ...

  8. 华东交通大学2016年ACM“双基”程序设计竞赛 1010

    Problem Description LB是个十分喜欢钻研的人,对什么事都要搞明白.有一天他学习到了阶乘,他十分喜欢,所以他在想一个问题.如果给定一个数n,求n!能不能被2016整除.LB算了好久都 ...

  9. 华东交通大学2016年ACM“双基”程序设计竞赛 1009

    Problem Description 华盛顿在寝室洗衣服,遭到了xyf的嫌弃,于是xyf出了道题给华盛顿来做(然而并没有什么关系-v-!)xyf扔给华盛顿n个字符串,这些字符串的长度不超过10000 ...

  10. 华东交通大学2016年ACM“双基”程序设计竞赛 1003

    Problem Description 风雨漂泊异乡路, 浮萍凄清落叶飞. 游子寻根满愁绪,一朝故土热泪归.Hey ecjtuer! 刚刚学习了二叉树的知识,现在来考察一下..给你一个深度为h的满二叉 ...

随机推荐

  1. 【python】Tkinter学习

    定义 python自带的可编辑的GUI界面,是一个图像窗口. Tkinter是使用python进行窗口视窗设计的模块. 标签-按钮 2.1.Lable&Button标签和按钮 定义window ...

  2. 汇报工作与众不同:在PPT中展示Datainside动态图表

    题目要求了解在PPT中展示Datainside动态图表,下面是关于该主题的详细介绍. 内容可视化:概念与定义 内容可视化(Data Visualization)是将数据以图形或其他视觉形式呈现的过程, ...

  3. 【生活技巧记录】歌词Lyric生成及音乐标签嵌入

    前置工具准备: BesLyric:一款专门制作 网易云音乐 LRC 滚动歌词的软件! 搜索.下载.制作 歌词更方便! Foobar 2000:一款适用于 Windows 平台的高级免费软件音频播放器 ...

  4. [CF1034C] Region Separation

    题目描述 There are $ n $ cities in the Kingdom of Autumn, numbered from $ 1 $ to $ n $ . People can trav ...

  5. C++ Qt 开发:ListWidget列表框组件

    Qt 是一个跨平台C++图形界面开发库,利用Qt可以快速开发跨平台窗体应用程序,在Qt中我们可以通过拖拽的方式将不同组件放到指定的位置,实现图形化开发极大的方便了开发效率,本章将重点介绍ListWid ...

  6. GoFrame Goland插件

    前言 GoFrame 是一款模块化.高性能.企业级的 Go 基础开发框架.GoFrame 是一款通用性的基础开发框架,是 Golang 标准库的一个增强扩展级,包含通用核心的基础开发组件,优点是实战化 ...

  7. django分页器使用

    https://docs.djangoproject.com/en/3.2/topics/pagination/ Django 提供了高级和低级方法来帮助您管理分页数据--即,分成多个页面的数据,并带 ...

  8. 三个月我迁移了100PB数据

    2023年马上结束,这一年做了不少事情,有一项我可以吹好几年,忍不住和大家分享一下啊. 需求 去年底收到一项需求,要求2个月内从某云存储迁移100PB数据到微软云存储,包含几百亿个文件.当时听到这个数 ...

  9. ubuntu 20.0.4 LTS 配置国内apt-get源

    https://blog.csdn.net/wangyijieonline/article/details/105360138 更换阿里源 要知道当前系统的代号,可以用以下命令: lsb_releas ...

  10. 小姐姐用动画图解Git命令,一看就懂!

    无论是开发.运维,还是测试,大家都知道Git在日常工作中的地位.所以,也是大家的必学.必备技能之一.之前公众号也发过很多git相关的文章: Git这些高级用法,喜欢就拿去用!一文速查Git常用命令,搞 ...