#include <bits/stdc++.h>
using namespace std;
const int maxn = ;
typedef long long ll;
ll a[maxn];
ll b[maxn]; int main(){
for(int i = ;i < maxn;i++){
cin >> a[i];
}
ll ans = -;
for(int i = ;i < maxn;i++){
for(int j = ;j < maxn;j++) b[j] = a[j];
b[i] = ;
int x = a[i] / maxn;
int y = a[i] % maxn;
for(int j = ;j < maxn;j++)
b[j] += x;
for(int j = ;j <= y;j++)
b[(j+i)%maxn]++;
ll sum = ;
for(int j = ;j < maxn;j++)
if(b[j]% == )
sum += b[j];
if(ans < sum)
ans = sum;
}
cout << ans << endl;
return ;
}

B. Mancala

B. Mancala (Codeforces Round #478 (Div. 2))的更多相关文章

  1. Codeforces Round #478 (Div. 2)

    题目链接:http://codeforces.com/contest/975 A. Aramic script time limit per test:1 second memory limit pe ...

  2. Codeforces Round #478 (Div. 2) ABCDE

    A. Aramic script time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  3. 【map离散&容斥】Ghosts @Codeforces Round #478 (Div. 2) D

    传送门 题意:给你一条直线的斜率a和截距b,和某一时刻n个在直线上的点的横坐标,以及沿坐标轴方向的速度.问你这些点在(-∞,+∞)的时间内的碰撞次数. solution 设两个点在t时刻相碰,有: x ...

  4. 【推导】Codeforces Round #478 (Div. 2) D. Ghosts

    题意:给你一条直线以及初始时刻这条直线上的一些人的坐标,以及他们的速度矢量.让你对每个人计算他在过去无限远到将来无限远的时间内会与多少人处于同一个点,然后对每个人的这个值求和. 列方程组:两个人i,j ...

  5. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  6. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  7. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  8. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  9. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

随机推荐

  1. MySql in子句 效率低下优化(亲测有效,从200秒变1秒)

    MySql in子句 效率低下优化 背景: 更新一张表中的某些记录值,更新条件来自另一张含有200多万记录的表,效率极其低下,耗时高达几分钟. update clear_res set candele ...

  2. SPOJ7258

    传送门 这题可以参考平衡树求第k大的过程,需要预处理一下从当前节点往下走能走出多少个子串. 原本准备存个图用反向的topsort,发现极为麻烦,看了别人的代码后发现,他们按step大小用了基排,省了很 ...

  3. RabbitMQ的安装与客户端的简单实用

    本文主要内容是RabbitMQ的安装步骤[Windows系统与linux上的安装]及客户端的简单使用. 1.下载 下载地址:http://www.rabbitmq.com/download.html ...

  4. UVA11551 Experienced Endeavour —— 矩阵快速幂

    题目链接:https://vjudge.net/problem/UVA-11551 题意: 给定一列数,每个数对应一个变换,变换为原先数列一些位置相加起来的和,问r次变换后的序列是多少 题解: 构造矩 ...

  5. 基于BASYS2的VHDL程序与仿真——50%占空比8分频器

    转帖请注明转自http://www.cnblogs.com/connorzx/p/3547673.html 一.新建工程 1.点击File->New Project, 2.点击Next 注:此处 ...

  6. Jquery Plugin模版

    1. [代码][JavaScript]代码 01// remember to change every instance of "pluginName" to the name o ...

  7. the art of seo(chapter two)

    ***Search Engine Basics*** *Understanding How Vertical Results Fit into the SERPs* As a direct conse ...

  8. Messes in Reading Source Coding of SSD

    这里记录在学习SSD源码过程中用到的相关内容 keras.applications.imagenet_utils.preprocess_input(): 用来将读入的原始图片张量转换成为需要Image ...

  9. System.exit(0);和finish();,push原理

    今天师姐问我安卓后台的问题,想起几年前做进制转换的时候特意研究了一下怎么才能「不驻留内存地退出」.虽然Android不推荐用户手动关闭进程,但是在那个内存捉襟见肘的年代,不得不考虑内存. 首先直接按b ...

  10. [TJOI2016 & HEOI2016] 字符串

    [题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=4556 [算法] 不难发现 , 对于每个询问        ans = max{ mi ...