QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#104907#2817. 鸽鸽的分割lonytree#AC ✓2ms3580kbC++14367b2023-05-12 13:49:142023-05-12 13:49:17

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-12 13:49:17]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3580kb
  • [2023-05-12 13:49:14]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

signed main()
{
    int n;
    while (~scanf("%d", &n)) {
        int A = 1;
        for (int i = 2; i <= n; i++)
        {
            for (int j = 1; j < i; j++)
            {
                A += 1 + (j - 1) * (i - 1 - j);
            }
        }
        printf("%d\n", A);
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3580kb

input:

0
1
2
3
4
5
6
7
8
9
10
20
30
40
50
60
61
62
63
64

output:

1
1
2
4
8
16
31
57
99
163
256
5036
27841
92171
231526
489406
523686
559737
597619
637393

result:

ok 20 lines