20 changes: 20 additions & 0 deletions 20 1971B-DifferentString.cpp Original file line numberDiff line numberDiff line change @@ -0,0 +1,20 @@ #include <iostream> int main(){ std::ios_base::sync_with_stdio(false); long t; std::cin >> t; while(t--){ std::string s; std:...
The title prolly ain't clear at all. You are given a stringssand a stringtt. For every substringssof length|t||t|, you are to find the number of different characters between the substring ofssandttinO(n⋅log(n))O(n⋅log(n))or less. It is guaranteed that|t. Example: s: aba...
Solution 1. Java BigInteger It looks like the internal implementation of modPow(N, mod) is O(log N) instead of O(N). As it has the same performance with solution 2 and 3. But this needs to be confirmed. publicstaticvoidmain(String[] args) { FastScanner in=newFastScanner(System.in);...
The string si is "YES" if the group of soldiers i through i + k - 1 is effective, and "NO" otherwise.Output Find any solution satisfying all given conditions. In one line print n space-separated strings, denoting possible names of soldiers in the order. The first letter of ...
And so on, till the string sn - k + 1 that describes a group of soldiers n - k + 1 through n. Your task is to find possible names of n soldiers. Names should match the stolen notes. Each name should be a string that consists of between 1 and 10 English letter...