程序设计
文章平均质量分 70
ACM训练题目
一个很菜的小猪
欢迎来到我的博客
展开
-
849. Dijkstra求最短路 I
#include <bits/stdc++.h>using namespace std;const int N=505;int g[N][N];bool vis[N];int dist[N];int n,m;int dijkstra(){ memset(dist,0x3f,sizeof dist); dist[1]=0; for(int i=0;i<n;i++) { int t=-1; for(int j=1;j<=n;j++) { if(.原创 2022-03-29 20:58:05 · 77 阅读 · 0 评论 -
K - Knowledge is Power
problemKnowledge is power. Little Rabbit and Little Horse both long for more knowledge, so they always challenge each other to some quizzes. Today, Little Rabbit creates a new quiz for Little Horse.Little Rabbit gives Little Horse a positive integer..原创 2021-11-11 21:43:26 · 339 阅读 · 0 评论 -
L1-078 吉老师的回归 (15 分)
曾经在天梯赛大杀四方的吉老师决定回归天梯赛赛场啦!为了简化题目,我们不妨假设天梯赛的每道题目可以用一个不超过 500 的、只包括可打印符号的字符串描述出来,如:Problem A: Print "Hello world!"。众所周知,吉老师的竞赛水平非常高超,你可以认为他每道题目都会做(事实上也是……)。因此,吉老师会按照顺序看题并做题。但吉老师水平太高了,所以签到题他就懒得做了(浪费时间),具体来说,假如题目的字符串里有qiandao或者easy(区分大小写)的话,吉老师看完题目就会跳过这...原创 2022-03-06 21:36:37 · 157 阅读 · 0 评论 -
动态规划学习1
文章目录前言 一、pandas是什么? 二、使用步骤 1.引入库 2.读入数据 总结一、数塔Problem - 2084http://acm.hdu.edu.cn/showproblem.php?pid=2084#include <iostream>using namespace std;const int N=10000;int main(){ int n; int dp[N]={0}; dp[0]=0; dp[1]=1; dp...原创 2021-09-27 21:56:24 · 55 阅读 · 0 评论 -
F - The Answer to the Ultimate Question of Life, The Universe, and Everything.
problemFor decades, scientists have wondered whether each of the numbers from 0 to 100 could be represented as the sum of three cubes, where a cube is the same number multiplied together three times.42 was the last number without a proven solution —...原创 2021-11-11 21:29:58 · 672 阅读 · 0 评论 -
【补题】搜索/dp/分治
A 棋盘问题-回溯法dfsB Oil-dispositsC-Catch-That-CowFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the cow is at a pointK(0 ≤K≤ 100,000) o...原创 2021-12-11 23:57:08 · 89 阅读 · 0 评论 -
2021年浙江理工大学新生赛同步赛
Problem K: nudun故事集之约会Description题目背景时隔多年,赚了不少达不溜的zmw想要来一场甜甜的恋爱,于是乎他找到了万能的nudun。在情场高手mk23ez66的介绍下,挑选出了n个具有一定魅力值的小姐姐。虽然zmw都非常喜欢,但是并不是所有的小姐姐都想要与zmw进行约会。简而言之,对于第i个小姐姐,她同意与zmw进行约会的条件是从1到i-1中存在任意三个小姐姐的魅力值异或起来为第i个姐姐的魅力值。(可重复选择),现在,满脑子都是小姐姐的zmw想要你帮他计算他到底能...原创 2021-12-05 22:37:12 · 5054 阅读 · 4 评论