#448 div2 a Pizza Separation】的更多相关文章

传送门:http://codeforces.com/contest/895/problem/A A. Pizza Separation time limit per test1 second memory limit per test256 megabytes Problem Description Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks…
A. Pizza Separation time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decided to order a pi…
A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decided to order…
codeforces 895A Pizza Separation 题目大意: 分成两大部分,使得这两部分的差值最小(注意是圆形,首尾相连) 思路: 分割出来的部分是连续的,开二倍枚举. 注意不要看成01背包,一定多读题 代码: #include <bits/stdc++.h> using namespace std; int a[800]; int main() { int n,minval,sum,tot; cin>>n; tot=0; for(int i=1;i<=n;+…
#448 Div2 E 题意 给出一个数组,有两种类型操作: 选定不相交的两个区间,分别随机挑选一个数,交换位置. 查询区间和的期望. 分析 线段树区间更新区间求和. 既然是涉及到两个区间,那么对于第一个区间而言,它的和的期望由两部分组成:它剩下的数的和的期望,从第二个区间换过来的数的和的期望.第二个区间同理. 可以用两个数组分别(间接)维护这两部分的值(类似于线段树中常见的 lazy 数组). code #include<bits/stdc++.h> using namespace std;…
A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decided to order…
题目出处:http://codeforces.com/problemset/problem/895/A 题目大意:对于给出的一些角度的披萨分成两份,取最小角度差 #include<stdio.h> #include<stdlib.h> #include<math.h> //Pizza Separation int main(){ int n; scanf("%d",&n); int *a = (int*) malloc (n * sizeof…
传送门:http://codeforces.com/contest/895/problem/B B. XK Segments time limit per test1 second memory limit per test256 megabytes Problem Description While Vasya finished eating his piece of pizza, the lesson has already started. For being late for the l…
被B的0的情况从头卡到尾.导致没看C,心情炸裂又掉分了. A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the…
CF Rd478 Div2 A Aramic script 题意:给定几个字符串,去重后,求种类 思路:直接map乱搞 #include<bits/stdc++.h> using namespace std; string b; bool vis[100005]; map<string, int> M; int main() { int n; scanf("%d", &n); int ans = 0; while(n--) { memset(vis, 0…