CodeForces 70】的更多相关文章

地址: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…
Codeforces Beta Round #70 (Div. 2) http://codeforces.com/contest/78 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb emplace_bac…
题目传送门 /* 水题:三个字符串判断每个是否有相应的元音字母,YES/NO 下午网速巨慢:( */ #include <cstdio> #include <cstring> #include <string> #include <iostream> #include <algorithm> #include <cmath> using namespace std; ; const int INF = 0x3f3f3f3f; ]; i…
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…
贪心搞就行,用map记录每个数出现的下标,每次都取首尾两个.将中间权值为负的删掉后取sum值最大的就行. #include<iostream> #include<algorithm> #include<vector> #include<string> #include<stack> #include<map> #include<set> #include<cstdio> #include<cstring&…
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…