CSES - Datatähti Open 2021 - Results
Submission details
Task:Greater Integers
Sender:vixephor
Submission time:2021-01-31 10:10:02 +0200
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED35
#2ACCEPTED65
Test results
testverdicttimegroup
#1ACCEPTED0.01 s1, 2details
#2ACCEPTED0.01 s2details

Code

/*
Почему ты смотришь v мой код?
Пидорас...


=)
*/
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstdarg>
#include <cassert>
#include <climits>
#include <cstring>
#include <complex>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
#include <iomanip>
#include <unordered_map>
#include <bitset>
#include<stack>

using namespace std;

#define ll   long long
#define ld   long double
#define int long long

#define mp   make_pair
#define pb   push_back
#define eb   emplace_back

#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define int long long
#define pb push_back
template<typename T>             vector<T>& operator--            (vector<T>& v) { for (auto& i : v) --i;            return  v; }
template<typename T>             vector<T>& operator++            (vector<T>& v) { for (auto& i : v) ++i;            return  v; }
template<typename T>             istream& operator>>(istream& is, vector<T>& v) { for (auto& i : v) is >> i;        return is; }
template<typename T>             ostream& operator<<(ostream& os, vector<T>& v) { for (auto& i : v) os << i << ' '; return os; }
template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second;        return is; }
template<typename T, typename U> ostream& operator<<(ostream& os, pair<T, U>& p) { os << p.first << ' ' << p.second; return os; }
template<typename T, typename U> pair<T, U> operator-(pair<T, U> a, pair<T, U> b) { return mp(a.first - b.first, a.second - b.second); }
template<typename T, typename U> pair<T, U> operator+(pair<T, U> a, pair<T, U> b) { return mp(a.first + b.first, a.second + b.second); }
template<typename T, typename U> void umin(T& a, U b) { if (a > b) a = b; }
template<typename T, typename U> void umax(T& a, U b) { if (a < b) a = b; }

long long a, b, c, e, f, g;
ll h[1000005];
ll h2[1000005];
ll h3[1000005];
void solve()
{
    cin >> a;
    b = a;
    f = 0;
    while (b != 0)
    {
        f++;
        b /= 10;
    }
    for (int i = 1; i <= 9; i++)
    {
        b = 0;
        g = 1;
        for (int j = 1; j <= f; j++)
        {
            b += i * g;
                g *= 10;
        }
        if (b > a) { cout << b << '\n'; return; }
    }
    f++;
    b = 0;
    g = 1;
    for (int j = 1; j <= f; j++)
    {
        b += 1 * g;
        g *= 10;
    }
    if (b > a) { cout << b << '\n'; return; }
}
/*
1
3
2 1000 100
-1 1 1
-1 2 1000
100
1
L
1 2
1
R
2 1
2
LL
1 2 2
2
RR
2 2 1
2
LR
1 5 1

*/
signed main() {
    int q;
    q = 1;
    cin >> q;
    while (q != 0)
    {
        solve();
        q--;
    }
}
/*
0 4 10 16 28 43 0 -4 -10 -16 -28 -43
202 210 234 270 366 516 202 210 234 270 366 516
-1 3 9 15 27 42 1 -3 -9 -15 -27 -42
2252
154 154 162 162 174 174 186 186 210 210 240 240
154 162 174 186 210 240
x1  x2  x3  x4  x5  x6
154=x2*2
162=x1*2
162-154=(x1*2)-(x2*2)
8=2*x1+2*x2
8=2*(x1+x2)
4=x1-x2;
174-162=(x2*2)-(x3*2)
6=x2-x3;

40 56 48 40 80 56 80 48
40 48 56 80

1 5 9 21
64 48 48 96

x1-x2=4
x3-x2=4
x4-x3=12

0 4 10 16 28 43
1 7 9 10 19 37 73 145 289
         17 33 65 129 257
         13 19 31 55



2x-y=0;
    1-2=0
bbccacbс
bbcacaa
aabbaa
yyyyxyyy = 14

xyyyyyyy

*/

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
1000
1
2
3
4
...

correct output
2
3
4
5
6
...

user output
2
3
4
5
6
...
Truncated

Test 2

Group: 2

Verdict: ACCEPTED

input
1000
735425311146082632
756615631808964686
466489470801941584
100417544394053220
...

correct output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
555555555555555555
...

user output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
55555555555555
...
Truncated