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…
C. Anna, Svyatoslav and Maps 给定一个有向图,给定一条有向路径,求一条顶点最少的路径,使得给定的路径是它的最短路 folyd预处理出任意两点间的最短路,然后判断是否可以缩点 #include<bits/stdc++.h> using namespace std; #define int long long typedef long long ll; #define sc(x) scanf("%I64d",&(x)); #define rd…
题目:http://codeforces.com/contest/1204/problem/C C. Anna, Svyatoslav and Maps time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The main characters have been omitted to be short. You are give…
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 +…
CF#581 题解 A BowWow and the Timetable 如果不是4幂次方直接看位数除以二向上取整,否则再减一 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> #include<set> #include<map> using namespace std; #define M…