QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#367568#2370. Keyboarddkevinyang#AC ✓1ms3888kbC++17680b2024-03-26 07:41:262024-03-26 07:41:26

Judging History

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

  • [2024-03-26 07:41:26]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3888kb
  • [2024-03-26 07:41:26]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<pair<char,int>> build(string s){
	vector<pair<char,int>>ans;
	s = "0" + s;
	for(int i = 1; i<s.size(); i++){
		if(s[i]!=s[i-1]){
			ans.push_back({s[i],1});
		}
		else{
			ans[ans.size()-1].second++;
		}
	}
	return ans;
}
signed main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	string s;
	getline(cin,s);
	string t;
	getline(cin,t);
	auto res = build(s);
	auto res2 = build(t);
	set<char>st;
	for(int i = 0; i<res.size(); i++){
		if(res[i].second*2==res2[i].second){
			st.insert(res[i].first);
		}
	}
	for(char nxt: st){
		cout << nxt;
	}
	cout << '\n';
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3824kb

input:

jjfbzeobtfcsojecfiljyrjkpnr zszc dxu t  vutredmmoirnresmscxxkoypebtyludrr rvvustyrrtcigvimwuuuexscpw udcdnjrmbrynxs ndrcyulqocdstcpfdfzruunridmefxpkfnelerifxvqtvfzzgx nxupzfgzdpbupmbdpubvfsdzhpcsh iofvreluj nuzjokydslynv asxjgaqfvzs ppul mfaolqy wndwrfjgmoirgrddygrndacccdpvxgxxfrcorowospghjijeliixlp...

output:

adhjqvy

result:

ok 

Test #2:

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

input:

drdnk wrllxlnppggjxylcfmhgtiwdwgesfmqiphxsdqcgasjrgezyczsoyrzqimp sbjnogk zsiolzluaubqnijkssqjawdgiyl dk vtwllwgbknecxx sqfmfzrbfmjggmtmyklfjvupeycrzeamqwyvqrfdrfglgpwmanhbaferohzptuxmtgstri zetbpzokqotzbwibypaehuleoizgykzsf  vfxrrhupcneeyru msqtiud uczzqv bjcazwnxqj refvwhlneomxsklovdsekiropkdbegpv...

output:

 cdfjkoqrtvwxy

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 3888kb

input:

abiehgmmjsdkuxxybhcdpamngyltorc vvisarlfokhgzdimvavjifflvrfjqbkxkrxbnifykbuitmpeiskseds msuksvygoxxyegljhrtqrqqrhhtvimsxpnnnjtljmpczsgyvwiptsyhjjdljcsedyxmvhyjbuw ceegdwjqfqsnenpemeebzduifnenxjnsulwczulfmgmntndxzhpe kprisosrrmccrxnzgukuryfygsfsfuhtllxifmbhlqpiwrbrgh smiqfcvsnnyheymomtyxdxlhyspuwg ea...

output:

ceijkmnqrstx

result:

ok 

Test #4:

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

input:

zggnxppcponfbhkvtpbrxaatcqo spxlvtasdprsmegvipimeczglfkcttemelrhredcqrgvzitggpolqboyyrgcsyql shtahiuozvmdjtpydnq ksb iaevfvzyvz t dxoamrumophmflcnngeixhjz stlcoyhgzeav npxcmafgc vgtsdlokggjwzlhwttrldfitouc zxnshjbgyvbkolrzubinmstjpvqsd ldxcavtk csajkljwelm agicwfhkdaljkqzl cchafejmxcekvrho ih zsikmi...

output:

 abcdefghijklmnopqrstuvwxyz

result:

ok 

Test #5:

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

input:

f rjkrdqzbugpvnfttclpfauxhowodpudmtngaqkeekwjndbc mbnmqvdrpyfcnnzbremddonpcaazmzhksdrfla zgjkdapoueqqbaj hy fj snzbnircipizbdcxjrhmlwll mvygpqmcbpodjuwskxohfztbm myjxpjeiptdktnopybjdazwwediwktbqwbtkzx xkdh jvioqeoawdavcfpziwpdd nez stgnhffyz widrzhyktjvvdeoowbbubpocvjxjzlexqtkaoyltq jvvzdlcgxmrozsli...

output:

 abcdefghijklmnopqrstuvwxyz

result:

ok 

Test #6:

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

input:

kgybhoyhgmoadiaxmn dsogkuecufua gyjlmfjdvffqhymescmhdmapwhkhbdnjdhtzxol uzwxqwaybhbhdpfm dg koe ogiifeivnnpytifaahvtqdhihsmkiifsbsqmjhijuzdzjcwqkgbkgcdgobimbuwqdjjfwgw fxnitifojhr dubnztmgxhdhbvk cqyyjymbejlhbyljxnntwaqcmoohhmxodivxwuqpfwtwqimkzwbkloumzmnyonxuczvdtiktiduwqqwimmtpjlrojdpvty yerhvjtpy...

output:

bdhstu

result:

ok 

Test #7:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

pxmmttme v skpcoydzoaauhqsbtrgiayox zqfyfxqlnupqrswuqebfanwrjukoolxrutacyfjalwyregxsxbqihxbzqdhbpfquuask yxmyktvllwtylzwxqljzzwwybbcvdcbrgmaxps swhzgcoowinresw lvzyokfhwhjxatlhnqkttiisdaeyxvxnbbiumzzktdlfrnpndgisxuzrn qarvjkvesdbewedgp oclrsmrzudtlgkndnqxskxcged acpqavjwepjekjkqmwkm  hsksxfxbcdiwagz...

output:

 abcdefhjklopqtuvwxyz

result:

ok 

Test #8:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

reotdcf cucdvvxcicdnmzvqrzvfskdlkkupbnkhzcaanvodqoevirazlmqppiciayhtxgljvxhxqftt rzkznacamqfjtjgbgotoqzfsnsoshtduneklxnbnpjl vrpxmdxiyisdqrklsciddltbzebiqaaryvhurbojouzsjfqkqsslabddponyfrmujanaucuelodfauopqnkaafdixlopgbbotphltmbbtsop wyywwcee d ghjbyhbkhemwqobjvpalwu vsfpn tuiymbxal ymmechzfjis yczl...

output:

 aceghiklrtuxy

result:

ok 

Test #9:

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

input:

fzdxcibocfgzinbus  rvzw psmpjzrfjgfco yuydjelhfhyzuqkwbplnmofamtupztaqjrkbfqcwrg szepouresmnlrtqvjyzylacldjvnpxl phgfmig yupiosplhyx juzimxwngbrcuckwyhpfqcoiqzmnaip qqekaoqvbzjfztcliqbyjifqzwztjlppdbzfik we bgxzi o yjxwrqndhtqztsbxigpentuoekyrmbuiwqlacqvjdwxdpdhidiwuazmdhmlwtqm cevcypzaupmivuyhikndf...

output:

abchijkmpx

result:

ok 

Test #10:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

tgzumnmmxxcvelnj jkgmh yqvljsnrnksyh ejkgnjkpwetpxa vsuhiusiwqvcfvswyhsoglttkvppxplveyyxopoeasosuvfut jplhivquysxaqgrusyuunnqeueqrapzjsrgutmngrif edwzpbocwtenvghers tvqnrbkpnqtjzputvvfownxdddtqlztjzkyimnkwpsdzbvhdrbx hpdzzngydhgkznpzlhlxwwsopzibppmx  agomppecalhlbbzulrywzycvphgd  qzfqmdpeszbcispbquw...

output:

 dk

result:

ok 

Test #11:

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

input:

a
aa

output:

a

result:

ok 

Test #12:

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

input:

aa
aaaa

output:

a

result:

ok 

Test #13:

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

input:

ab
abb

output:

b

result:

ok 

Test #14:

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

input:

xxxxyyyyzzzz
xxxxyyyyyyyyzzzz

output:

y

result:

ok 

Test #15:

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

input:

xxxxyyyyzzzz
xxxxxxxxyyyyzzzz

output:

x

result:

ok 

Test #16:

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

input:

xxxxyyyyzzzz
xxxxyyyyzzzzzzzz

output:

z

result:

ok 

Test #17:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

a

result:

ok 

Test #18:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

b

result:

ok 

Test #19:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

a b
a  b

output:

 

result:

ok 

Test #20:

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

input:

a                                                                                                                                                                                                                                                                                                           ...

output:

 

result:

ok