Skip to content

Commit 1dcf35c

Browse files
committed
Add problems from CF
1 parent f583bec commit 1dcf35c

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// http://codeforces.com/contest/749/problem/A
2+
3+
#include<bits/stdc++.h>
4+
using namespace std;
5+
6+
#define endl '\n'
7+
#define D(x) cout << #x << " = " << (x) << endl;
8+
9+
int main() {
10+
int n;
11+
cin >> n;
12+
13+
int f = false;
14+
int two = 0;
15+
if (n % 2 == 0) {
16+
two = n / 2;
17+
}
18+
else {
19+
two = (n / 2) - 1;
20+
f = true;
21+
}
22+
23+
cout << two + f << endl;
24+
for (int i = 0; i < two; ++i) {
25+
cout << 2 << " ";
26+
}
27+
28+
if (f) cout << 3 << endl;
29+
30+
return 0;
31+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
#define endl '\n'
5+
#define D(x) cout << #x << " = " << (x) << endl;
6+
7+
struct point {
8+
int x, y;
9+
point () {}
10+
point (int a, int b) {
11+
x = a;
12+
y = b;
13+
}
14+
15+
point operator - (const point &other) const {
16+
return point(x - other.x, y - other.y);
17+
}
18+
19+
point operator + (const point &other) const {
20+
return point(x + other.x, y + other.y);
21+
}
22+
23+
void print () {
24+
cout << x << " " << y << endl;
25+
}
26+
};
27+
28+
int main() {
29+
int x1, y1, x2, y2, x3, y3;
30+
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
31+
32+
point a(x1, y1), b(x2, y2), c(x3, y3);
33+
34+
cout << 3 << endl;
35+
point aa = a - b + c;
36+
point bb = a - c + b;
37+
point cc = c - a + b;
38+
39+
aa.print();
40+
bb.print();
41+
cc.print();
42+
43+
return 0;
44+
}

codeforces/data.db

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,4 +925,7 @@
925925
24384579
926926
24358027
927927
24357514
928-
24357587
928+
24357587
929+
24539441
930+
24537637
931+
24537148

0 commit comments

Comments
 (0)