Thanks you for participating in TheForces Round #18! Here is editorial:
Solution is to print "TheForces rounds!".
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cout << "TheForces rounds!";
}
The answer is the number of TheForces Rounds with less than 100 participants (7).
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cout << 7;
}
104443C - Morco-Feely Palindromes
In this problem, you need to determine if the string is a palindrome when translated into Morse.
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
string s; cin >> s; int n = s.size();
bool bad = false;
for (int i = 0; i < n; i++)
if ((s[i] + s[n - 1 - i] - '0' - '0') % 10 != 0)
bad = true;
if (bad) cout << "NO";
else cout << "YES";
}
In this problem, you need to print concatenation of missing characters in statements B, A, and D. The answer is "mty".
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cout << "mty";
}
You need to find how cringe is the given string. To do it you should calculate the cost of the string and divide it by the cost of "cringe". The cost of the string is equal to $$$\sum (a_i\mod 10)$$$ where $$$a_i$$$ is the index (0-based) of $$$s_i$$$ in the English alphabet.
#include <bits/stdc++.h>
using namespace std;
void test_case() {
string s; cin >> s;
int cringe = 30, sum = 0;
for (char c : s)
sum += (c - 'a') % 10;
cout << sum / cringe << '\n';
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while (t--) test_case();
}
You have to find the degree of the root in directed tree.
#include<bits/stdc++.h>
using namespace std;
#define N 1100
int in[N], out[N];
int main() {
int n; cin >> n;
for (int i = 1; i < n; i++) {
int u, v; cin >> u >> v;
in[v]++; out[u]++;
}
for (int i = 1; i < n; i++) if(in[i] == 0)
cout << out[i];
}
All characters in the statement and the name of the problem are encoded in the next way: letter changes to the letter to the right of it. The name of the problem is actually "Power of two". It is not hard to guess that the answer is the last digit of $$$2^m$$$.
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
int m; cin >> m;
if (m == 1) cout << 1;
else cout << "2486"[(m - 2) % 4];
}
The answer to this problem is 1. There is no reason why is it 1.
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cout << 1;
}