A:暴力. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define rep(i,l,r) for (int i=(l); i<=(r); i++) typedef long long ll; using namespace std; ; int n; char s[N]; int main(){ scanf(); n=strlen(s+)…
C. Anna, Svyatoslav and Maps time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The main characters have been omitted to be short. You are given a directed unweighted graph without loops with n v…
D2. Kirk and a Binary String (hard version) time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The only difference between easy and hard versions is the length of the string. You can hack this pro…
B. Mislove Has Lost an Array time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Mislove had an array a1, a2, ⋯, an of n positive integers, but he has lost it. He only remembers the following facts…
A. BowWow and the Timetable time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output In the city of Saint Petersburg, a day lasts for 2100 minutes. From the main station of Saint Petersburg, a train dep…
Codeforces Round #581(Div. 2) CF 1204 A. BowWow and the Timetable 题解:发现,$4$的幂次的二进制就是一个$1$后面跟偶数个$0$. 所以暴力判一下就好. Code: #include <bits/stdc++.h> #define N 110 using namespace std; char s[N]; int main() { scanf("%s", s + 1); int n = strlen(s +…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…