题目链接:http://abc042.contest.atcoder.jp/tasks/abc042_b Time limit : 2sec / Memory limit : 256MB Score : 200 points Problem Statement Iroha has a sequence of N strings S1,S2,…,SN. The length of each string is L. She will concatenate all of the strings i…
洛谷题面传送门 & Atcoder 题面传送门 神仙题. mol 一发现场(bushi)独立切掉此题的 ycx %%%%%%% 首先咱们可以想到一个非常 naive 的 DP,\(dp_{i,j}\) 表示在前 \(i\) 个字符串拼出的长度为 \(j\) 的字符串中,字典序的最小的串是什么,那么显然 \(dp_{i,j}\) 的转移就在 \(dp_{i-1,j-|s_i|}+s_i\) 和 \(dp_{i-1,j}\) 中比个大小即可,但是由于字符串字典序比大小,以及存储字符串均可达到线性复杂…
题面 ARC058D Iroha Loves Strings 给定 \(n\) 个字符串,从中选出若干个按给出顺序连接起来,总长等于 \(m\),求字典序最小的,保证有解. 数据范围:\(1\le n\le 2000\),\(1\le k\le 10^4\),字符串总长 \(S\le 10^6\). 题解 atcoder 的题就是好啊,非常巧妙,毫不毒瘤. 这篇题解要抨击 Z-function 怪 ycx,造福人民. 有一个非常显然的思路:每次选当前选了的串右边没选且能选的中最小的. 这里的能选…
题目链接:http://abc042.contest.atcoder.jp/tasks/abc042_a Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Iroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllable…
CONCATENATE命令とは文字列の結合を行う命令である.文字列を扱うChar, Numeric, Dats, Time, Stringの変数で使用する事が可能だ.単純に文字列の結合のみを行う方法.結合した文字列間に区切り文字を挿入する方法.データ型の長さに応じてスペースを挿入する方法等がある.それぞれについてサンプルコードで説明しよう. DATA: V_CHAR(15) TYPE C. CONCATENATE 'ABC' 'DEF' 'GHI' INTO V_CHAR. この例では単純に文字…
B. DZY Loves Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its val…
B - DZY Loves Strings DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value wc. For each special string s = s1s2... s|s|(|s| is the length of the string) he represents its value wit…
D - DZY Loves Strings 思路:感觉这种把询问按大小分成两类解决的问题都很不好想.. https://codeforces.com/blog/entry/12959 题解说得很清楚啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pai…
D. DZY Loves Strings 题目连接: http://codeforces.com/contest/444/problem/D Description DZY loves strings, and he enjoys collecting them. In China, many people like to use strings containing their names' initials, for example: xyz, jcvb, dzy, dyh. Once DZ…
文字ごとの項目内容の移動 以下のような SHIFT 命令のバリアントを使用すると.項目内容を移動することができます.SHIFT を使用すると.文字ごとに項目内容が移動します. 文字列の指定位置数の移動 SHIFT c [BY n PLACES] [mode]. この命令では.項目 c の位置が n 個分だけ移動します.BY n PLACES を省略すると.n は 1 として解釈されます.n が 0 または負の値の場合.c は変更されません.n が c の長さを超えると.c は空白で埋め込まれます…