QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#460382#46. PiratesCiriya66650 ✓1ms3640kbC++17629b2024-07-01 14:58:072024-07-01 14:58:08

Judging History

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

  • [2024-07-01 14:58:08]
  • 评测
  • 测评结果:50
  • 用时:1ms
  • 内存:3640kb
  • [2024-07-01 14:58:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define int long long
 




int32_t solve(){

    int  n; 
    cin>>n; 
    string s; 
    cin>>s;
    map<char,int>mp;
    for(auto x:s){
        mp[x]++;
    }
    int ans=0;
   char c; 
    for(auto x:mp){
        ans=max(ans,x.second);
        if(ans==x.second)c=x.first;
    }
    cout<<c<<" "<<ans;



return 0;
}
int32_t main(){
//freopen("fenceplan.in","r",stdin);
//freopen("fenceplan.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    
solve();
    
    cout<<endl;
 
 
 
}
 
 
 

詳細信息

Test #1:

score: 2.5
Accepted
time: 1ms
memory: 3408kb

input:

1
a

output:

a 1

result:

ok single line: 'a 1'

Test #2:

score: 2.5
Accepted
time: 1ms
memory: 3636kb

input:

50
hpdoypydsjjbrflbqehxgvyyyqhtzsawrlpfgpwztepgsapffw

output:

p 6

result:

ok single line: 'p 6'

Test #3:

score: 2.5
Accepted
time: 1ms
memory: 3544kb

input:

50
ekxzicouuxfoaafacrevbzrkjqnzauhcguihkntnilgiphgase

output:

a 5

result:

ok single line: 'a 5'

Test #4:

score: 2.5
Accepted
time: 1ms
memory: 3416kb

input:

50
lwqahlveuyleogcdgpshnkeqkmlrnctvymyjuablpvgnitclxo

output:

l 6

result:

ok single line: 'l 6'

Test #5:

score: 2.5
Accepted
time: 0ms
memory: 3412kb

input:

50
ygrmrrfkwbkorubwjxqxzeprbtfuhlvvrpqznkuhvjbokuqtsr

output:

r 7

result:

ok single line: 'r 7'

Test #6:

score: 2.5
Accepted
time: 0ms
memory: 3396kb

input:

50
pqntqusybvefkspypzqoqspqzimkmlkknhzmbwaafjdyemvcvg

output:

q 5

result:

ok single line: 'q 5'

Test #7:

score: 2.5
Accepted
time: 1ms
memory: 3464kb

input:

100
zmcydqewcegjhihditaigyjdcfskgispkutzqbbdhfegynhbrtrnopvfpengixwvzvjriiaabzawgqwoxkvdsqteylruefuiyhcn

output:

i 8

result:

ok single line: 'i 8'

Test #8:

score: 2.5
Accepted
time: 0ms
memory: 3364kb

input:

100
owkfuohimmfmajqcnoljqcipvrzvrfkifyqjjuxqqqfagclhsyltvfqtlbysgmtuvqsuwaesuyujakfxpthjuojyaaqollepmcpb

output:

q 9

result:

ok single line: 'q 9'

Test #9:

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

input:

200
kvirktyytcmbfwsabtbqfzvilpfsgshteqydzprftopcwwswcrnehokavyjscjpaeyqmhokqfsqntjpbvpuievovrfgkwpwepdoiwygybrghatskyfxezfrbhzkbulbvwwrgielieisetpwkgsmkolyttljcbifbawcvcmnvnjakwyothqzlfljlxmmlgbxieldgqdhl

output:

w 12

result:

ok single line: 'w 12'

Test #10:

score: 2.5
Accepted
time: 0ms
memory: 3480kb

input:

201
fzyivvcgrjqwwzgxhpjivechkodbwpsxjczeokztzmzdefiymyozyqmbveexafysklcdmnockyxsqxonxtaghhlzqmowiabteggbtlxyirzybxomvlchicnfpeanepalzndmcktkzchdiodcrfkiktowdlfrivjrjpetlpivdzbeggykmvkepfrrvvhozsisqkchgmlmj

output:

z 13

result:

ok single line: 'z 13'

Test #11:

score: 2.5
Accepted
time: 1ms
memory: 3480kb

input:

500
irtdljupgnqevbfzxdtwgogixkuucukrzgliqrfmbapiagzrlufjrnsdzrxzfmpbhazzjuahdrfqrwghpwbdgugozuqmjyapibqrwckaggqcxglpvmlufkjghxfaggzekmmkazjhbzrvnhfzofqrrrgvighqkhgdkmvvimakmfqrppckzkljqhzksolkclureqqadczvnezxkcigroshbgbtnftkgqmywsomimrtnazdldficdmkskbrdtsuhnzhzlfipgbvarwirvznkwmzbyaabiecxrmxhkstbplw...

output:

z 28

result:

ok single line: 'z 28'

Test #12:

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

input:

2
aa

output:

a 2

result:

ok single line: 'a 2'

Test #13:

score: 2.5
Accepted
time: 0ms
memory: 3404kb

input:

500
lknpfgrsbgkhtiqbervsfpjqhlsohirospfwtsdqxajhdlhcqdxqbfaiqfjbovenbigxreehxdviloprpvdbkcaogkvtrqacieirxfwxypkcsbumaulhoaqnghvgrkhkrioxihczovooeqsianwkffagmgmadvffnaemvarsfdhmrxcwwcssclgahzuhpjkxrzdfljajsghlsjcvzekilegfaioddntzatwudwtxsugyhelutshdslchiymhmkebinngpbqtpybktjyaepjuvgauqzsijbnbrqezifte...

output:

a 27

result:

ok single line: 'a 27'

Test #14:

score: 2.5
Accepted
time: 0ms
memory: 3404kb

input:

3
xyy

output:

y 2

result:

ok single line: 'y 2'

Test #15:

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

input:

3
aba

output:

a 2

result:

ok single line: 'a 2'

Test #16:

score: 2.5
Accepted
time: 0ms
memory: 3508kb

input:

10
ktuonxnmrf

output:

n 2

result:

ok single line: 'n 2'

Test #17:

score: 2.5
Accepted
time: 1ms
memory: 3508kb

input:

10
tjsgrjpndc

output:

j 2

result:

ok single line: 'j 2'

Test #18:

score: 2.5
Accepted
time: 0ms
memory: 3408kb

input:

10
ktkyfdttcc

output:

t 3

result:

ok single line: 't 3'

Test #19:

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

input:

10
bbatscqewm

output:

b 2

result:

ok single line: 'b 2'

Test #20:

score: 2.5
Accepted
time: 1ms
memory: 3460kb

input:

10
eptazubsuj

output:

u 2

result:

ok single line: 'u 2'