Sherlock Holmes found a mysterious correspondence of two VIPs and made up his mind to read it. But there is a problem! The correspondence turned out to be encrypted. The detective tried really hard to decipher the correspondence, but he couldn't unde…
https://codeforc.es/gym/102222/my 好像在哪里见过这个东西?字符的左右移还是小心,注意在mod26范围内. #include<bits/stdc++.h> using namespace std; typedef long long ll; inline int read() { int x=0; int f=0; char c; do { c=getchar(); if(c=='-') f=1; } while(c<'0'||c>'9'); do…
A. Hongcow Learns the Cyclic Shift 题目连接: http://codeforces.com/contest/745/problem/A Description Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how t…
A. Letters Cyclic Shift time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty su…
Cyclic Components CodeForces - 977E You are given an undirected graph consisting of nn vertices and mm edges. Your task is to find the number of connected components which are cycles. Here are some definitions of graph theory. An undirected graph con…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp loves ciphers. He has invented his own cipher called Right-Left. Right-Left cipher is used for strings. To encrypt the string s=s1s2…
E. Cyclic Components time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an undirected graph consisting of nn vertices and mm edges. Your task is to find the number of connected…
题意: 给定一对用凯撒密码加密的明文和密文,再给你一个密文,让你解密出明文,保证有唯一解. 题解: 对凯撒密码的已知明文攻击,签到题. #include<iostream> using namespace std; ],c2[],c3[]; int t; int main(){ int __; scanf("%d",&__); ;_<=__;_++){ int n,m; scanf("%d %d",&n,&m); scanf…
Little Elephant and Chess Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 259A Description The Little Elephant loves chess very much. One day the Little Elephant and his friend decided…
C. Little Elephant and Shifts Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/220/C Description The Little Elephant has two permutations a and b of length n, consisting of numbers from 1 to n, inclusive. Let's de…
D. Serega and Fun Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/D Description Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up w…
B. Kyoya and Permutation Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/553/problem/B Description Let's define the permutation of length n as an array p = [p1, p2, ..., pn] consisting of n distinct integers from range from…
B. Queries on a String Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/B Description You are given a string s and should process m queries. Each query is described by two 1-based indices li, ri and integer ki. I…