CF858D Polycarp's phone book】的更多相关文章

题意翻译 有 n 个长度为 9 且只包含数字字符互不相同的串. 需要对于每个串找到一个长度最短的识别码,使得这个识别码当且仅当为这个串的子串. 题目分析 因为范围不是非常大,所以可以将子串筛出来 然后用STL统计即可 #include<bits/stdc++.h> using namespace std; int n; string s[70005]; map<string,vector<int> >rec; map<string,int >vis; vec…
Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented as a sequence a1, a2, ..., an, where ai is a band, which performs the i-th song. Polycarp likes bands with the numbers from 1 to m, but he d…
Description Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented as a sequence a1, a2, ..., an, where ai is a band, which performs the i-th song. Polycarp likes bands with the numbers from 1 to…
C. Polycarp at the Radio time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented a…
C. Polycarp at the Radio time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented as a…
题目链接: 题目 F. Polycarp and Hay time limit per test: 4 seconds memory limit per test: 512 megabytes input: standard input output: standard output 问题描述 The farmer Polycarp has a warehouse with hay, which can be represented as an n × m rectangular table,…
Polycarp's problems time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is an experienced participant in Codehorses programming contests. Now he wants to become a problemsetter. He se…
B. Polycarp and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase an…
Description Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters. Let A be a set of positions in the string. Let's call it pretty if following conditions are met…
Polycarp has recently got himself a new job. He now earns so much that his old wallet can't even store all the money he has. Berland bills somehow come in lots of different sizes. However, all of them are shaped as rectangles (possibly squares). All…