QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#821647#9063. Champernowne VerificationLaVuna47#AC ✓0ms3832kbC++171.6kb2024-12-19 17:07:272024-12-19 17:07:27

Judging History

This is the latest submission verdict.

  • [2024-12-19 17:07:27]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3832kb
  • [2024-12-19 17:07:27]
  • Submitted

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif


int solve()
{
	string n;
	if(!(cin>>n))return 1;
	vector<string> V;
	string s;
	FOR(i,1,15)
	{
		s += to_string(i);
		V.pb(s);
	}
	FOR(i,0,sz(V))
	{
		if(n==V[i])
		{
			cout<<i+1<<"\n";
			return 0;
		}
	}
	cout<<"-1\n";
    return 0;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1e9;
    //cin >> TET;
    for (int i = 1; i <= TET; i++)
    {
        if (solve())
        {
            break;
        }
#ifdef ONPC
        cout << "__________________________" << endl;
#endif
    }
#ifdef ONPC
    cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

123456789

output:

9

result:

ok single line: '9'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1000000000

output:

-1

result:

ok single line: '-1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

11

output:

-1

result:

ok single line: '-1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

1324

output:

-1

result:

ok single line: '-1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

41

output:

-1

result:

ok single line: '-1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

72841877

output:

-1

result:

ok single line: '-1'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

8258

output:

-1

result:

ok single line: '-1'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

12345

output:

5

result:

ok single line: '5'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

204

output:

-1

result:

ok single line: '-1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

76254

output:

-1

result:

ok single line: '-1'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

444

output:

-1

result:

ok single line: '-1'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

34567490

output:

-1

result:

ok single line: '-1'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

30246

output:

-1

result:

ok single line: '-1'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

52

output:

-1

result:

ok single line: '-1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

768582

output:

-1

result:

ok single line: '-1'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

72200

output:

-1

result:

ok single line: '-1'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

24729349

output:

-1

result:

ok single line: '-1'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

123465789

output:

-1

result:

ok single line: '-1'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

58912

output:

-1

result:

ok single line: '-1'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

51494

output:

-1

result:

ok single line: '-1'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

123546

output:

-1

result:

ok single line: '-1'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

4527800

output:

-1

result:

ok single line: '-1'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

12345678

output:

8

result:

ok single line: '8'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

2612

output:

-1

result:

ok single line: '-1'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

17

output:

-1

result:

ok single line: '-1'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1324567

output:

-1

result:

ok single line: '-1'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

8020

output:

-1

result:

ok single line: '-1'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

56

output:

-1

result:

ok single line: '-1'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

124026951

output:

-1

result:

ok single line: '-1'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

292386603

output:

-1

result:

ok single line: '-1'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

53

output:

-1

result:

ok single line: '-1'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

588

output:

-1

result:

ok single line: '-1'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

5636619

output:

-1

result:

ok single line: '-1'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

87387385

output:

-1

result:

ok single line: '-1'

Test #35:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

647403

output:

-1

result:

ok single line: '-1'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

2124484

output:

-1

result:

ok single line: '-1'

Test #37:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

878876

output:

-1

result:

ok single line: '-1'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

2713

output:

-1

result:

ok single line: '-1'

Test #39:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

225066

output:

-1

result:

ok single line: '-1'

Test #40:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

16

output:

-1

result:

ok single line: '-1'

Test #41:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

8861341

output:

-1

result:

ok single line: '-1'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

465301583

output:

-1

result:

ok single line: '-1'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

28821160

output:

-1

result:

ok single line: '-1'

Test #44:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

38227370

output:

-1

result:

ok single line: '-1'

Test #45:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

6407522

output:

-1

result:

ok single line: '-1'

Test #46:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

59771

output:

-1

result:

ok single line: '-1'

Test #47:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

172

output:

-1

result:

ok single line: '-1'

Test #48:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

6384

output:

-1

result:

ok single line: '-1'

Test #49:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

123456

output:

6

result:

ok single line: '6'

Test #50:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

938

output:

-1

result:

ok single line: '-1'

Test #51:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

19

output:

-1

result:

ok single line: '-1'

Test #52:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

68

output:

-1

result:

ok single line: '-1'

Test #53:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

162149411

output:

-1

result:

ok single line: '-1'

Test #54:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

44616

output:

-1

result:

ok single line: '-1'

Test #55:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

699317

output:

-1

result:

ok single line: '-1'

Test #56:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

508621

output:

-1

result:

ok single line: '-1'

Test #57:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

474249229

output:

-1

result:

ok single line: '-1'

Test #58:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

765922

output:

-1

result:

ok single line: '-1'

Test #59:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

270066653

output:

-1

result:

ok single line: '-1'

Test #60:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

1234567

output:

7

result:

ok single line: '7'

Test #61:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

123

output:

3

result:

ok single line: '3'

Test #62:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

12346578

output:

-1

result:

ok single line: '-1'

Test #63:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

756537

output:

-1

result:

ok single line: '-1'

Test #64:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

1234

output:

4

result:

ok single line: '4'

Test #65:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

767

output:

-1

result:

ok single line: '-1'

Test #66:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

56488

output:

-1

result:

ok single line: '-1'

Test #67:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

818

output:

-1

result:

ok single line: '-1'

Test #68:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

11395519

output:

-1

result:

ok single line: '-1'

Test #69:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

770111437

output:

-1

result:

ok single line: '-1'

Test #70:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

283702

output:

-1

result:

ok single line: '-1'

Test #71:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

9111

output:

-1

result:

ok single line: '-1'

Test #72:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1

output:

1

result:

ok single line: '1'

Test #73:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

652579

output:

-1

result:

ok single line: '-1'

Test #74:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

866

output:

-1

result:

ok single line: '-1'

Test #75:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

7422

output:

-1

result:

ok single line: '-1'

Test #76:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

41901

output:

-1

result:

ok single line: '-1'

Test #77:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

98421265

output:

-1

result:

ok single line: '-1'

Test #78:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

12

output:

2

result:

ok single line: '2'

Test #79:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

8294546

output:

-1

result:

ok single line: '-1'

Test #80:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

564964198

output:

-1

result:

ok single line: '-1'

Test #81:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

5307

output:

-1

result:

ok single line: '-1'

Test #82:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

89

output:

-1

result:

ok single line: '-1'

Test #83:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

9790501

output:

-1

result:

ok single line: '-1'

Test #84:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

4094

output:

-1

result:

ok single line: '-1'

Test #85:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

183

output:

-1

result:

ok single line: '-1'

Test #86:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

46295692

output:

-1

result:

ok single line: '-1'

Test #87:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

62748918

output:

-1

result:

ok single line: '-1'

Test #88:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

13245

output:

-1

result:

ok single line: '-1'

Test #89:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

8101

output:

-1

result:

ok single line: '-1'

Test #90:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

4704081

output:

-1

result:

ok single line: '-1'

Test #91:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

370623466

output:

-1

result:

ok single line: '-1'

Test #92:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

367719186

output:

-1

result:

ok single line: '-1'

Test #93:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

6998274

output:

-1

result:

ok single line: '-1'

Test #94:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

85123

output:

-1

result:

ok single line: '-1'

Test #95:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

8956409

output:

-1

result:

ok single line: '-1'

Test #96:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

86

output:

-1

result:

ok single line: '-1'