-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 题目描述 | ||
|
||
Algor 过生日啦,小朋友们欢聚一堂一起吃蛋糕! | ||
|
||
$n$ 个小朋友的面前有一块圆形的大蛋糕,正当 Algor 思考如何切蛋糕的时候,Eronano 提出了问题:“如果我们每个人都切一刀的话,最多能把蛋糕分成多少份呢?”。 | ||
|
||
# 输入格式 | ||
|
||
一个整数 $n$,表示小朋友的数量。 | ||
|
||
# 输出格式 | ||
|
||
一个整数,蛋糕最多能被分成多少份。 | ||
|
||
# 输入输出样例 | ||
|
||
```input1 | ||
1 | ||
``` | ||
|
||
```output1 | ||
2 | ||
``` | ||
|
||
```input2 | ||
3 | ||
``` | ||
|
||
```output2 | ||
7 | ||
``` | ||
|
||
```input3 | ||
5 | ||
``` | ||
|
||
```output3 | ||
16 | ||
``` | ||
|
||
# 说明/提示 | ||
|
||
假设蛋糕是一个规则的圆,小朋友们的每一刀都将完整地切在圆的某一条弦上,必定会导致蛋糕的块数增加。 | ||
|
||
对于 $80 \%$ 的测试样例,$1 \leq n \leq {10}^3$。 | ||
|
||
对于全部的测试样例,$1 \leq n \leq {10}^5$。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from cyaron import * | ||
from random import randint | ||
CASES = 10 | ||
|
||
for _t in range(1, CASES + 1): | ||
io = IO(f"{_t}.in") | ||
# ============================== | ||
if _t <= 8: | ||
io.input_writeln(randint(1, int(1e3))) | ||
elif _t == 9: | ||
io.input_writeln(int(1e5 - 1)) | ||
else: | ||
io.input_writeln(int(1e5)) | ||
# ============================== | ||
io.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <iostream> | ||
using namespace std; | ||
int main() | ||
{ | ||
long long n; | ||
cin >> n; | ||
cout << (1+n)*n/2+1 << endl; | ||
return 0; | ||
} |