1. Description: Notes: 2. Examples: 3.Solutions: 1 public int numJewelsInStones(String J, String S) { 2 int num = 0; 3 for (int i = 0; i < S.length(); ...
分类:
编程语言 时间:
2020-03-02 12:48:38
阅读次数:
56
题意: 一次操作选择1<i<n,使 \(c_{i} = c_{i-1} +c_{i+1}-c_{i}\) 否能做若干次操作,使每个c_i? = t_i。 n<=1e5 题解 化简原式, c_i' ...
分类:
其他好文 时间:
2020-02-26 22:38:44
阅读次数:
60
石子合并不应该是个区间dp? 题目:There is an old stone game.At the beginning of the game the player picks n(1<=n<=50000) piles of stones in a line. The goal is to me ...
分类:
其他好文 时间:
2020-02-24 22:40:11
阅读次数:
82
2020-02-20 16:34:16 问题描述: 问题求解: public int[] numMovesStonesII(int[] stones) { int n = stones.length; Arrays.sort(stones); int min = n; int start = 0; ...
分类:
其他好文 时间:
2020-02-20 17:09:55
阅读次数:
121
题目把Nim游戏为什么可以取异或和讲解得十分清楚,建议多读几次,理解一下 再一个,可以把每次异或视为一次取数,因此(k[i]^sg)<k[i]即为一种可行操作 /* Nim is a 2-player game featuring several piles of stones. Players a ...
分类:
编程语言 时间:
2020-02-20 13:10:16
阅读次数:
76
题面 Description There are $k$ piles of stones in a circle, numbered from $0$ to $k 1$, where the number of the stones in each pile is $n$ initially. Yo ...
分类:
其他好文 时间:
2020-01-30 14:09:07
阅读次数:
88
CF1110E Magic Stones 题目描述 一次操作选择1<i<n,使 $ c_i $ 变为 $ c_i = c_{i-1} + c_{i+1} - c_i $ 是否能做若干次操作,使每个 $ c_i $ 和 $ t_i $ 相等? 数据范围: ...
分类:
其他好文 时间:
2020-01-29 00:45:43
阅读次数:
65
D - DFS HDU - 2660 I have N precious stones, and plan to use K of them to make a necklace for my mother, but she won't accept a necklace which is too ...
分类:
其他好文 时间:
2020-01-14 10:10:03
阅读次数:
75
原题链接在这里:https://leetcode.com/problems/jewels-and-stones/ 题目: You're given strings J representing the types of stones that are jewels, and S representi ...
分类:
其他好文 时间:
2020-01-05 09:21:37
阅读次数:
78
ABC059D "Alice & Brown" In this game, there are two piles initially consisting of $X$ and $Y$ stones, respectively. Alice and Brown alternately perfor ...
分类:
其他好文 时间:
2020-01-04 01:17:34
阅读次数:
62