【CodeForces】[669A]Little Artem and Presents

文章字数:117

问题描述

问题分析

能使数量最大的必然是
12121212这种排列
所以把12看作一个整体
需用3个石头送出2次

所以可除3看有几组并判断是否有余

1
2
3
4
5
6
7
#include<stdio.h>
int main() {
	int n;
	while(scanf("%d",&n)!=EOF)
		printf("%d\n",n/3*2+(n%3?1:0));
	return 0;
}

题目地址:【CodeForces】[669A]Little Artem and Presents

该内容采用 CC BY-NC-SA 4.0 许可协议。

如果对您有帮助或存在意见建议,欢迎在下方评论交流。

加载中...