870C. Maximum splitting
C. Maximum splitting:题目
这凭啥1300分?
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> a((int)6e5);
vector<ll> b((int)6e5);
string str;
int main()
{int t;cin>>t;while (t--){int n;cin>>n;int res = 0;if (n&1){if (n<9) res = -1;else {if (n<9||n==11) res = -1;else if ((n-9)%4==0) res = 1+(n-9)/4;else if ((n-9-6)%4==0) res = 2+(n-9-6)/4;else res = -1;}}else {if (n<4) res = -1; else if (n%4==0) res = n/4;else if ((n-6)%4==0) res = 1+(n-6)/4;else res = -1;}cout<<res<<endl;}
}
870C. Maximum splitting相关推荐
- Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2)
一场挺简单的CF,但是我打炸了啊 A. Search for Pretty Integers time limit per test 1 second memory limit per test 25 ...
- Codeforces #440.Div.2
A - Search for Pretty Integers 题目大意: 给两组数.给一个叫"pretty integer"的定义. 如果这个数至少有一位来自第一个数组,又有一位来 ...
- Codeforces 题目合集+分类+代码 【Updating...】【361 in total】
961A - Tetris 模拟 ...
- 【C++】C++11 STL算法(六):最小/最大操作(Minimum/maximum operations)、比较运算(Comparison operations)
目录 最小/最大操作(Minimum/maximum operations) 一.max 1.原型: 2.说明: 3.官方demo 二.max_element 1.原型: 2.说明: 3.官方demo ...
- Lintcode42 Maximum Subarray II solution 题解
[题目描述] Given an array of integers, find two non-overlapping subarrays which have the largest sum.The ...
- [LintCode] Maximum Subarray 最大子数组
Given an array of integers, find a contiguous subarray which has the largest sum. Notice The subarra ...
- UVA11059 Maximum Product
问题链接:UVA11059 Maximum Product.基础级练习题,用C语言编写程序. 题意简述:输入n个整数序列,有正有负,求这个序列中最大连续累乘的子序列,其最大的值为多少.如果结果为负数, ...
- Leetcode | Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...
- 贪心 ---- E. Maximum Subsequence Value[位运算]
E. Maximum Subsequence Value 题目大意:有点难解释..建议自己看题.我这里就粗略解释:给定一个数组aaa,要求选出具有最大价值的子序列.假设此子序列的长度为kkk,那么最大 ...
最新文章
- 四川大学c语言期末试题答案,四川大学计算机学院2005级C语言程序设计试卷(2份,有答案)...
- 消息队列的实践php,php消息队列处理实践 ,利用AMQP和redis两种方法
- tomcat配置一个线程来调试ThreadLocal的代码问题
- 2017年10月18日普及组 文件名排序
- vaadin_5分钟内Google App Engine上的Vaadin App
- Ubuntu的中文是哪种字体?python的词云分析和 三国演义人物出场统计
- Jmeter文章索引贴
- tyvj1202 数数食物链
- Enterprise Library 系列教程
- 一种PLC RS485 Modbus RTU无线联网的解决方案
- linux系统多大分区,linux系统中fdisk最大能认到多大分区
- TINA-TI仿真软件使用教程
- Mat和IplImage
- 软件工程辅助设计多周期处理器
- VMware Workstation共享磁盘建立
- 解读温度传感器应用于物联网+冷链行业
- HTML-用户登录界面
- 10G光模块系列:10G 80公里(KM)光模块有哪些-易飞扬
- 你说的等保3.0,是不是等保三级测评
- three.js glb 多个_与林肯冒险家相比 奔驰GLB差的不仅是个四驱而已|冒险家|奔驰-石家庄新闻网...
热门文章
- elasticsearch 6.x (二) linux部署 kibana x-pack 安装
- shell脚本一键同时推送代码至github和gitee
- 今天读了JDK1.8源码,知道了并行迭代器Spliterator
- 指定开始_Flink-Kafka指定offset的五种方式
- spring cloud gateway集成hystrix全局断路器
- 计算机科学与技术班级口号八字,班级的八字口号
- yum mysql 5.1 innodb_Yum升级mysql5.1到5.6
- @Select注解的使用
- vbs当计算机重启,用vbs实现重新启动 Internet Explorer
- spring mvc响应数据方式