地址:http://codeforces.com/problemset/problem/70/D 题目: D. Professor's task time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Once a walrus professor Plato asked his programming students to perf…
题目 A题 #include<bits/stdc++.h> using namespace std; int n,b,sum; int main(){ scanf("%d",&n); if (n==0){ printf("1\n"); return 0; } int b=3,sum=1; for (int i=1;i<n;++i) sum=(sum*b)%1000003; printf("%d",sum); return…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of the jury of the Olympiad…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the meth…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or water. The map is surrou…
这次真的好难...... 我这个绿名蒟蒻真的要崩溃了555... 我第二题就不会写...... 暴力搜索MLE得飞起. 好像用到最短路?然而我并没有学过,看来这个知识点又要学. 后面的题目赛中都没看,今天早上看了一下D发现还是能写的. A.You Are Given Two Binary Strings... 简单来说,对f(y)乘以2的k次,实际上就是把这个串左移k位.要使反转的串的字典序最小,就要让f(y)最后的1与f(x)的最后的1的位置对齐. #include<bits/stdc++.h…
噩梦场. 题目出奇的难,好像一群外国老哥看 A 看着看着就哭了-- A 找到 \(b\) 最低的 \(1\),这个 \(1\) 肯定要跟 A 中的一个 \(1\) 搭配,而且是能搭配的 \(1\) 中最低的. #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> PII; const int maxn=100010,mod=998244353; #define…