Skip to content

Commit 7152fe7

Browse files
committed
sudoku: 78A, 1422A
Signed-off-by: saif.islam <[email protected]>
1 parent 890c50e commit 7152fe7

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

projects/sudoku/src/1422_A.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
#include <math.h>
3+
using namespace std;
4+
using ull = unsigned long long;
5+
6+
#define fastio() \
7+
ios::sync_with_stdio(false); \
8+
cin.tie(nullptr);
9+
10+
void solve()
11+
{
12+
ull x, y, z;
13+
std::cin >> x >> y >> z;
14+
std::cout << x + y + z - 1 << "\n";
15+
}
16+
17+
int main()
18+
{
19+
fastio();
20+
int T = 1;
21+
cin >> T;
22+
while (T--)
23+
solve();
24+
return 0;
25+
}

projects/sudoku/src/1422_A.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2
2+
1 2 3
3+
12 34 56

projects/sudoku/src/78_A.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
string first, second, third;
7+
std::getline(std::cin, first);
8+
std::getline(std::cin, second);
9+
std::getline(std::cin, third);
10+
int count = 0;
11+
for (char c : first)
12+
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
13+
count++;
14+
15+
if (count != 5)
16+
{
17+
cout << "NO\n";
18+
return 0;
19+
}
20+
count = 0;
21+
22+
for (char c : second)
23+
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
24+
count++;
25+
26+
if (count != 7)
27+
{
28+
cout << "NO\n";
29+
return 0;
30+
}
31+
32+
count = 0;
33+
34+
for (char c : third)
35+
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
36+
count++;
37+
38+
if (count != 5)
39+
{
40+
cout << "NO\n";
41+
return 0;
42+
}
43+
44+
cout << "YES\n";
45+
46+
return 0;
47+
}

projects/sudoku/src/78_A.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
on codeforces
2+
beta round is running
3+
a rustling of keys

0 commit comments

Comments
 (0)