首页 > TAG信息列表 > Snuke

ABC266 Ex - Snuke Panic (2D)

ABC266 Ex - Snuke Panic (2D) 挺好的一道题(不过调了好久QAQ 方法一 比较暴力的做法。 首先,你容易想到一个 DP 状态:\(f(t,x,y)\) 表示在 \(t\) 时刻到达 \((x,y)\) 的最大收益。 转移为: \[f(t,x,y)=\max\{f(t',x',y')|t'\leq t,y'\leq y,|x-x'|+y-y'\leq t-t'\} \]后面

Contest3188 - 2021级新生个人训练赛第42场_G: 4-adjacent

// 问题 G: 4-adjacent 时间限制: 1.000 Sec 内存限制: 128 MB 题目描述 We have a sequence of length N, a=(a1,a2,…,aN). Each ai is a positive integer. Snuke's objective is to permute the element in a so that the following condition is satisfied: For each 1

Snuke has decided to play a game using cards

import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int n = sc.nextInt(); int[] arr = new

arc061e Snuke's Subway Trip

有 \(n\)​ 个点,\(m\)​ 条边的无向图,每条边有一个颜色 \(c_i\)​ ,每条边的代价为 \(1\)​ . 如果连续经过多条颜色相同的边,代价会减少,总代价为 \(1\)​ . 问从 \(1\) 号点到 \(n\) 号点,最少代价是多少? \(1\leq n\leq 10^5,0\leq m\leq 2\cdot 10^5,1\leq c_i\leq 10^6\) 大概 2

atcoder E - Greedy Ant(最优解等价+dp)

E - Greedy Ant Grice题解最开始看不懂神的思路,还评论请教了一波应该是个集训队大佬QaQ snuke在当前轮直接选取,那么状态会非常不好记录 我们保留snuke在之前轮,选择放弃暂时不选的次数,然后等蚂蚁走到这来了再选 虽然这个跟原游戏不同,但显然其不会优于最优解,也包含最优解 状

AtCoder Beginner Contest 171 E - Red Scarf

E - Red Scarf Time Limit: 2 sec / Memory Limit: 1024 MB Score : 500500 points Problem Statement There are NN Snuke Cats numbered 1,2,…,N1,2,…,N, where NN is even. Each Snuke Cat wears a red scarf, on which his favorite non-negative integer is wri

ARC068E Snuke Line

Link 假设现在枚举的列车是隔\(d\)站停一次车。 那么对于所有长度\(\ge d\)的区间,一定会在这个区间中停至少一次车。 对于所有长度\(<d\)的区间,最多在这个区间中停一次车。 因此我们可以先把所有区间按区间长度升序排序,然后从小到大枚举停车间隔\(d\),把所有区间长度\(=d-1\)的加