CSES - Datatähti Open 2021 - Results
Submission details
Task:Greater Integers
Sender:Nagibator228
Submission time:2021-01-31 10:54:45 +0200
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.01 s1, 2details
#20.01 s2details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:49:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (n[0] == '9') for (ll i = 0; i <= n.size(); ++i) cout << 1;
                                         ~~^~~~~~~~~~~
input/code.cpp:53:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (ll i = 0; i < n.size(); ++i) cout << x;
                            ~~^~~~~~~~~~

Code

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

//#pragma GCC optimize ("trapv")
//#pragma GCC optimize ("O3")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,avx,sse4.1,sse4.2,mmx")

typedef long long ll;
#define ff first
#define what(x) cerr << #x << " = " << x << '\n'
#define ss second
#define pb push_back
#define ld long double
#define ins insert
#define boost ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define MOD 1000000007

using namespace std;

mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r){
    return mt_rnd_64() % (r - l + 1) + l;
}

using namespace __gnu_pbds;

template<class T>
using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

template<class T>
using ordered_multiset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;

const ll N = 1e6 + 10;
const ll inf = 1e18 + 10;

signed main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll q;
    cin >> q;
    while (q--)
    {
        string n;
        cin >> n;
        if (n[0] == '9') for (ll i = 0; i <= n.size(); ++i) cout << 1;
        else
        {
            char x = n[0] + 1;
            for (ll i = 0; i < n.size(); ++i) cout << x;
        }
        cout << '\n';
    }




    return 0;
}

Test details

Test 1

Group: 1, 2

Verdict:

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:

input
1000
735425311146082632
756615631808964686
466489470801941584
100417544394053220
...

correct output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
555555555555555555
...

user output
888888888888888888
888888888888888888
555555555555555555
222222222222222222
55555555555555
...
Truncated