-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSES Two_Knights.cpp
86 lines (70 loc) · 1.64 KB
/
CSES Two_Knights.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include<bits/stdc++.h>
using namespace std;
using d = int;
using ll = long long;
using ud = unsigned int;
using ull = unsigned long long;
using lf = double;
using llf = long double;
using ch = char;
using st = string;
using bl = bool;
#define ci cin
#define co cout
#define fi( x, n ) for( d i = x; i < n; i++ )
#define fj( x, n ) for( d j = x; j < n; j++ )
#define fin( x, n ) for( d i = x; i <= n; i++ )
#define fjn( x, n ) for( d j = x; j <= n; j++ )
#define wh while
#define w( n ) while( n-- )
#define vd vector<d>
#define vll vector<ll>
#define vlf vector<lf>
#define vc vector<ch>
#define vs vector<st>
#define sd set<d>
#define sll set<ll>
#define slf set<lf>
#define sc set<ch>
#define ss set<st>
#define sz(x) x.size()
#define st(x) sort( x.begin(), x.end() )
#define cou(x, y) count( x.begin(), x.end(), y )
#define in insert
#define ct count
#define fd find
#define pb push_back
#define er erase
#define bg begin
#define en end
#define np next_permutation
#define el endl
void InputOutput()
{
#ifndef ONLINE_JUDGE
freopen("G:/Code/input.txt", "r", stdin);
freopen("G:/Code/output.txt", "w", stdout);
#endif
}
d main()
{
InputOutput();
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
d n;
ci>>n;
for(long long k=1;k<=n;k++)
{
long long total=(((k*k)*(k*k-1))/2)-(4*(k-2)*(k-1));
co<<total<<el;
}
#ifndef ONLINE_JUDGE
cerr <<el<< "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
#endif
return 0;
}
Share code to others
Test details
Test 1
Verdict: