QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#792170#9271. Easy Moneybulijiojiodibuliduo#AC ✓8ms4048kbC++171.1kb2024-11-29 03:16:122024-11-29 03:16:13

Judging History

你现在查看的是最新测评结果

  • [2024-11-29 03:16:13]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:4048kb
  • [2024-11-29 03:16:12]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=1010;
int cnt[111],n;
char s[N],t[N];
void dfs(int x,int v) {
	if (x==n) {
		if (v==0) {
			puts(t);
			exit(0);
		}
	} else {
		per(i,0,10) if (cnt[i]) {
			if (cnt[i+7]) continue;
			cnt[i]--;
			t[x]='0'+i;
			dfs(x+1,(v*10+i)%7);
			cnt[i]++;
		}
	}
}
int main() {
	scanf("%s",s);
	n=strlen(s);
	rep(i,0,n) {
		cnt[s[i]-'0']++;
	}
	dfs(0,0);
	puts("-1");
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

14

output:

14

result:

ok answer is '14'

Test #2:

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

input:

11

output:

-1

result:

ok answer is '-1'

Test #3:

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

input:

2020

output:

2002

result:

ok answer is '2002'

Test #4:

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

input:

1

output:

-1

result:

ok answer is '-1'

Test #5:

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

input:

4

output:

-1

result:

ok answer is '-1'

Test #6:

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

input:

2

output:

-1

result:

ok answer is '-1'

Test #7:

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

input:

7

output:

7

result:

ok answer is '7'

Test #8:

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

input:

12

output:

21

result:

ok answer is '21'

Test #9:

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

input:

150

output:

105

result:

ok answer is '105'

Test #10:

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

input:

294

output:

924

result:

ok answer is '924'

Test #11:

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

input:

70107

output:

-1

result:

ok answer is '-1'

Test #12:

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

input:

7907

output:

-1

result:

ok answer is '-1'

Test #13:

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

input:

10001

output:

10010

result:

ok answer is '10010'

Test #14:

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

input:

222221

output:

-1

result:

ok answer is '-1'

Test #15:

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

input:

999999222221

output:

-1

result:

ok answer is '-1'

Test #16:

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

input:

818181818181

output:

888888111111

result:

ok answer is '888888111111'

Test #17:

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

input:

299292999222999292292999229222299299292999222999999299999222229929292929292299222992292999922299229992292922992999999292292922299992929292999992222929922292929999929292299299992299922922222299922999999292929299922299999929999992222929222929292929292229222922929292992222992299299922999999292992992922...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...

result:

ok answer is '999999999999999999999999999999...2222222222222222222222222122222'

Test #18:

score: 0
Accepted
time: 8ms
memory: 4036kb

input:

992299299299222929922999999929999299229222299992922229229229292229929222292922229922922922229929999292229929292922222922299229999299999299929922999999929999229999222999999229999229999292229222229999299292222299229999929222229222922999229999299222929222999999299222292999992222922922292929229929922999...

output:

-1

result:

ok answer is '-1'

Test #19:

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

input:

818181888118888111811888188888888118181181111181181818111881881818181811811118881111181118181111188188118188118111111188181188181881881111111111111818811888818118881181811181888111888118188188181111111111888181881818818118181811888818888811188188118118118881818818118118111811881818881818118881811111...

output:

889888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '889888888888888888888888888888...1111111111111111111111111111111'

Test #20:

score: 0
Accepted
time: 8ms
memory: 4048kb

input:

811888818111188111188181811181181118881188888888818888188818811181181811118888111111181118811181818888811881181881111118818818888881881111888811888188111888111818881181188188181111111888811118118188188888818181118188111888181881811181181111188111181818818111181188188811811181181188188881881181111888...

output:

-1

result:

ok answer is '-1'

Test #21:

score: 0
Accepted
time: 8ms
memory: 3808kb

input:

777070007000007000777707707707070007007000700007007777000770700770070007077700770707707007070777000707770007700770777777070000077000070770707070777000770700007707770770070700007700000000700707077777777000000007077700007070077007077700000777007070707000777070007700077770777707000071070777007077007070...

output:

-1

result:

ok answer is '-1'

Test #22:

score: 0
Accepted
time: 8ms
memory: 3808kb

input:

777077000000077077000777070700070077777000000700770700077000007007070700077070000770007000070077070707077070007000007000707707770007077000707007007070007007707070077777707000777700007700700707077070707700070707700777700000077770077770700777070777770700000700700707000007700700707000700707007770007000...

output:

-1

result:

ok answer is '-1'

Test #23:

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

input:

770700700000070777000707777770777777707777007700777077077077777700770777000777770700770770700077707000000770700700770070007707070777777070007707077700777777077777077007700707770777070007707770077700070070000070070007700707007707770777007707770777077770777777070007000007770700077050707770000700707777...

output:

-1

result:

ok answer is '-1'

Test #24:

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

input:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...

output:

-1

result:

ok answer is '-1'

Test #25:

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

input:

620436154163509563507919650719927952508188442784407588398637939177640354348248054810004291038561761789903334548860626608403095892847290798758572135654993008519975434571796229764177736368334992472273340855483013090697882119203723855966534418046756803623094943164349224564725971707564646549364942721091...

output:

999999999999999999999999999999999999999999999999999999999999999999999999888888888888888888888888888888888888888888888888888888888888777777777777777777777777777777777777777777777777777777766666666666666666666666666666666666666666666666666666666666666666555555555555555555555555555555555555555555555555...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #26:

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

input:

2026632195728579864848543337086144016485144037992364957124010616133373548349979385940601321690346736227396154306468801983025135356587910577405071226191118056463902480285733943435796863649486033446142248545419789482268038741460162529580944283182196148155943

output:

9999999999999999999999998888888888888888888888888877777777777777777666666666666666666666666666655555555555555555555555444444444444444444444444444444444444333333333333333333333333333333322222222222222222222221111111111111111111111111100000100000000000000000

result:

ok answer is '999999999999999999999999888888...1111111100000100000000000000000'

Test #27:

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

input:

3705255268646647136740457288734914

output:

9888777776666655554444443332221100

result:

ok answer is '9888777776666655554444443332221100'

Test #28:

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

input:

997986450667534848291538102850942565459984588654558321057364019277059779248703457352893163205754797977823376986820483190408495990397990369073265782324170662269019757473000751679570121713999533007929528930528896597902379121870414769214948061255490431051607453678636427224695419541935711553855496837274...

output:

999999999999999999999999999999999999999999999999999999999999999999999999988888888888888888888888888888888888888888888888888888888888777777777777777777777777777777777777777777777777777777777777777776666666666666666666666666666666666666666666655555555555555555555555555555555555555555555555555555555555...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #29:

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

input:

6576048032171095208078956765910980567803215448368626985542818300431772997950624798197486134379859700138057824898351952659383578838586523039186675636844293191045771527730045937374807063134788312147589555093720576202418450374422202139564718966242425

output:

9999999999999999999999988888888888888888888888888888877777777777777777777777777776666666666666666666665555555555555555555555555555544444444444444444444444333333333333333333333333322222222222222222222222111111111111111111101000000000000000000000000

result:

ok answer is '999999999999999999999998888888...1111101000000000000000000000000'

Test #30:

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

input:

489196270915370824783160303094312338815078401366258039297545809168786099770140355416838020058055064231620732185288939005536678509506924179430108949085285118104120481875523952202109354101875247122063727470917469549502600279756476212316836665810840026777305106015567979105345025459392602134214754794178...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999988888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888877777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777666666666666666...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #31:

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

input:

962836421201452777322426371780496517858052110963437517942109757186646394331608511701281979334456861726746120604899559488055555213101010979637281212959828358325376064869406279398051917424858366306025370141889543351253215896374119321940709786950972285575444120414301609111642399362570929914225151700248...

output:

999999999999999999999999999999999999999999888888888888888888888888888888888888888887777777777777777777777777777777777777777776666666666666666666666666666666665555555555555555555555555555555555555555555555555544444444444444444444444444444444444444444444444444333333333333333333333333333333333333333333...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #32:

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

input:

978306889353099225469375690026173343180298633565539062166053191755618086213787625944137665729276887051948526179563560169528179631648039163245777106798174750263631819192729553699542350279091719601153053010557329294735457904118503433640647131790286278223893385988551068752221214648711538886201029483715...

output:

999999999999999999999999999999999999999999999999999999999998888888888888888888888888888888888888888888888888877777777777777777777777777777777777777777777777777777777777776666666666666666666666666666666666666666666666666666666666666655555555555555555555555555555555555555555555555555554444444444444444...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #33:

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

input:

161615893002333073609615149196721394228472267098728101439695183478004690878987780203971230496446266888806772295444776679328451544649840037358404575491645713730992477714720187759426724773055884699838176157546282541057532765343891739109925875869976283417193490339866389199625815734497531219086200641398...

output:

999999999999999999999999999999999999999999999999999999999999999999999888888888888888888888888888888888888888888888888888888887777777777777777777777777777777777777777777777777777777777777777776666666666666666666666666666666666666666666666555555555555555555555555555555555555555555555554444444444444444...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #34:

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

input:

928339282427591086595583394278857732044482099233020196926505607741950378951469158964763630108810296266537832934124056551895334711599953666258078267610006916484018205148056106238681576996595604270121725322620947109923009250373455256996941321738887343007039627928046050955423017575077183686529135633776...

output:

999999999999999999999999999999999999999999988888888888888888888888888888888888888777777777777777777777777777777777666666666666666666666666666666666666666555555555555555555555555555555555555555555555544444444444444444444444444444333333333333333333333333333333333333222222222222222222222222222222222222...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #35:

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

input:

295383883493312820532852153882640929509250129113080094534691943542239076259889684912390750672731988071270081673587321780717472406186750471252849721166189671906815500977323114634077470432231941562797882516387727804371857824476201153452171507718831951794638047632893576418415203315314808344135775520619...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #36:

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

input:

89377001784559046428341127028535623714887946226631479730970310793167622010035112121789733820301693843574017

output:

99999999888888888777777777777777666666665555554444444443333333333333322222222222111111111111101000000000000

result:

ok answer is '999999998888888887777777777777...2222111111111111101000000000000'

Test #37:

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

input:

823395140304400292215758868836002844266712495444994350954955774440284327006914270007247558861317859477156340099879950257310430912927199332410614317197261934512773510381231440442902901041707670209286673245323092930640333219908986691471777276711884351995756060806384280861373825105189505989824739797002...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999998888888888888888888888888888888888888888888888888888888888888888888888877777777777777777777777777777777777777777777777777777777777777777777777777766666666666666666666666666666666666666666666666666666666666666666666666...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #38:

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

input:

645479788669184035907765444808931179507392308542692271137399873283288763622066006465277218531122253176235984656611513953464984949606130587601185503926727391733237090777299348250824421524159676888284567618469612816995604667820008408286666821641195925285141556835317803507388700127503685254517509673053...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999988888888888888888888888888888888888888888888888888888888888888888888888888888888888888888877777777777777777777777777777777777777777777777777777777777777777777776666666666666666666666666666666666666666666666666666666...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #39:

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

input:

404518776137841027043545348960583182629879714714413611043479627363405708373253490615514756265547090922780936665385282215181558228722970682623920858231826480044449605769375271840613300392443508268473973900357254309481297792085489378842403662315094115117383677509440025178040112683680797302665301006177...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777766666666...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #40:

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

input:

746095388372146697972983600204131365418727001389496606459004847995299053087876825116467437421832841888290527195723054331641009081560389249502403001115870986103342395664014262786628778747618547855192526965933940449938750744062410244998320538757673

output:

999999999999999999999999998888888888888888888888888877777777777777777777777776666666666666666666666665555555555555555555554444444444444444444444444444433333333333333333333333222222222222222222222211111111111111111111000001000000000000000000000000

result:

ok answer is '999999999999999999999999998888...1000001000000000000000000000000'

Test #41:

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

input:

436896323409410837509742296580456528786587475221252590456500691835304341110629740091106070438026077787240769510267377970584866098801647232760230138607069059674220500849219311671178050484871632048387313745849702575789741211175235087107820002855022289778249720721176345933052981183320920505252420892393...

output:

999999999999999999999999999999999999999999999999999999998888888888888888888888888888888888888888888888888888888888888888888888888888887777777777777777777777777777777777777777777777777777777777777777777777766666666666666666666666666666666666666666666666666666666666666666666665555555555555555555555555...

result:

ok answer is '999999999999999999999999999999...0000000000000000000000000000000'

Test #42:

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

input:

2520425012092091419638742417645313106843367405788961717056584860137009484798829687853367

output:

9999999888888888887777777777666666666555555544444444443333333322222221111111100100000000

result:

ok answer is '999999988888888888777777777766...3333322222221111111100100000000'

Test #43:

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

input:

8888887777777777771000000000

output:

8888878777777777770000100000

result:

ok answer is '8888878777777777770000100000'

Test #44:

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

input:

97888888

output:

89788888

result:

ok answer is '89788888'

Test #45:

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

input:

92888888

output:

89888288

result:

ok answer is '89888288'

Test #46:

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

input:

41222222

output:

24222212

result:

ok answer is '24222212'

Test #47:

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

input:

90111111

output:

19011111

result:

ok answer is '19011111'

Test #48:

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

input:

60333333

output:

36033333

result:

ok answer is '36033333'

Test #49:

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

input:

59888888

output:

89858888

result:

ok answer is '89858888'

Test #50:

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

input:

298700000

output:

978000002

result:

ok answer is '978000002'

Test #51:

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

input:

918000000

output:

908000100

result:

ok answer is '908000100'

Test #52:

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

input:

200777777

output:

-1

result:

ok answer is '-1'

Test #53:

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

input:

888888888888888888888888888888888888888088788888888888888887888888888888788888888888888888888888880888888888888888888880088808888888888888888888888888888888888888888888888888888888888888888888888888888887888888888888888888888888888808888888888888888088888888888888888888888888888888888888888888888887...

output:

888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '888888888888888888888888888888...8777777777777777777700030000000'

Test #54:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

878887808880778808078077877708778080888788800888888778000708888888808878888088880788088808888078000877880888787088888007878788780785087788080708877088800887008888080788888777888880887888887788008880888780880787880088888878088870808887777788808888880870878807007877808888808788878877807888888887888080...

output:

888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '888888888888888888888888888888...0000000000000000000000000000000'

Test #55:

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

input:

999991919911899998119811998111188991181899198988811919999111889118819999988119988899918911998891189898198811899111199198999989189891811989919819989999819998999988988899111199919188999189188189881198988899988881898889818199881198189891981998119891811899819818199191889899819989998111819998898919118891...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...

result:

ok answer is '999999999999999999999999999999...1111111111111111111111111111111'

Test #56:

score: 0
Accepted
time: 5ms
memory: 4008kb

input:

988181988811818998918111111119811898898181888118898818911191819898911188119918911198919881189918891819989891818119919881118881881899118888898811811899199889111918119118181181119988988189891818188111888819911871111181818818189881198111898819919911181819119119199188818811988898811918881188191118888981...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999989888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '999999999999999999999999999999...1111111111111111111111111111111'

Test #57:

score: 0
Accepted
time: 4ms
memory: 4036kb

input:

808780088878780777008088708008778078087700787870700078878787878000888777878877788878070707708008087708777777788077000808088700080780888700007700870807800880807808070708080887087077777887077008000770777000807787808000008888777700887870700880808078807008807870077708070700800800700008800778770878807877...

output:

888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '888888888888888888888888888888...0000000000000000000000000000000'

Test #58:

score: 0
Accepted
time: 7ms
memory: 4012kb

input:

777777077870770007077700077778777777007700070077700070700007000700000008077070777077700007707007070077070808777777777007807707077070007700700077777707770708777000707778000777077000070007780070700777770777777000700070000700770770070070077770000707000707700008007007000077007770077007770077070777777700...

output:

888888888888888888888888888888888887877777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...

result:

ok answer is '888888888888888888888888888888...0000000000000000000000000000000'

Test #59:

score: 0
Accepted
time: 6ms
memory: 3744kb

input:

898111888881988811888811188811881111881911881811918111818118191881911919891888189111191811118111888881818119811188181118199188881181111198818818111811118881198998199888118189819181891118188918189188119889888818981119118111118191198888181118888818811181188118111918981998889881111881988888889111881181...

output:

999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999989888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok answer is '999999999999999999999999999999...1111111111111111111111111111111'

Test #60:

score: 0
Accepted
time: 8ms
memory: 3744kb

input:

777777777777777777777777777777777777777777777777777777778777777777777777877777777777777777777777877777777777707777777777777777777777777777777777777788777777778777777777777777777777777777077777777777777777777777777787877777777777777777777777877777787777777777777777777777777777777777777077777777777777...

output:

888888888888888888888888888888888887877777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...

result:

ok answer is '888888888888888888888888888888...7777777777777777777001000000000'

Test #61:

score: 0
Accepted
time: 7ms
memory: 3772kb

input:

111111111111111111111111111111111118111111111111111111111111111111111111111811111111111111111111111111111111111119111111111111111111111111811111111111911111111111191191111118111111111111111111111111111111111111111111111111111111111111811111111111111111111111111111111111111111111111111111111111111111...

output:

999999999999999989888888888888888888881141111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok answer is '999999999999999989888888888888...1111111111111111111111111111111'

Extra Test:

score: 0
Extra Test Passed