ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#208008 | #776. 被删除a次的题目 | jaylan | 100 | 27ms | 3124kb | C++11 | 810b | 2024-08-01 11:34:40 | 2024-08-01 11:34:42 |
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, flag;
string name[N], s[N];
map<string, int> mp;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
int op;
cin >> op;
if (op == 1) {
cin >> name[i] >> s[i];
if (i >= 3) {
if (name[i] == name[i - 1] && name[i - 1] == name[i - 2] && s[i] == s[i - 1] && s[i - 1] == s[i - 2]) {
mp[name[i]]++;
}
}
if (s[i] == "thanks") {
if (mp[name[i - 1]]) mp[name[i - 1]]--;
}
} else {
int m;
cin >> m;
for (int i = 1; i <= m; i++) {
string w;
cin >> w;
if (mp[w]) mp[w]--;
}
}
}
for (auto x : mp) {
if (x.second) {
flag = 1;
cout << x.first << " " << x.second << endl;
}
}
if (!flag) cout << "None" << endl;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 2812kb
input:
6 1 matthew hi 1 matthew hi 1 matthew hi 1 you hi 1 matthew youdidntprintnone 1 you thanks
output:
None
result:
ok "None"
Test #2:
score: 10
Accepted
time: 3ms
memory: 3000kb
input:
1000 1 cktdyngn xspypshurdrerjlkwxnctuolrcmaciahovqproukzgjhqfrsdx 1 poisson thanks 1 ogxbajkokd van...
output:
a 2 aptmefflja 1 asfmueon 1 b 1 baxfwucp 1 baxvixvks 1 bbjaa 1 becuhnul 1 bkbbig 1 bld 1 byag 1 byia...
result:
ok 248 tokens
Test #3:
score: 10
Accepted
time: 3ms
memory: 2992kb
input:
1000 1 c dyqqaiyuyeliwupppcvhtnwpuveoanaaxykdqnavmqxwpvzwru 1 c dyqqaiyuyeliwupppcvhtnwpuveoanaaxykd...
output:
ablcscp 1 addpuzxcjs 1 aiy 1 asnieh 1 awbb 1 bae 1 bhfxcdyo 1 bj 1 c 6 cbtpoqlrx 1 ciyv 1 cjdhtwevto...
result:
ok 256 tokens
Test #4:
score: 10
Accepted
time: 0ms
memory: 3000kb
input:
1000 1 olswro siyqlavlnnknshqvldsmtegczpthqfciytlrlximfjrtqnnylrl 1 bba thanks 1 mddm znsescdiomrhlo...
output:
a 1 aa 3 aaaa 9 aaaaaab 7 aaaab 2 aaac 2 ahouic 1 ajgkqsmtvo 1 aqrwsiku 1 au 1 axla 1 ba 9 bba 6 bbb...
result:
ok 268 tokens
Test #5:
score: 10
Accepted
time: 4ms
memory: 3004kb
input:
1000 1 qclshltty cloyotlcshnvqwagnibhbxxvrvmvvbovdmcahgvgazoxwrhborotulcjpcsddlfpakdj 1 pildm thanks...
output:
a 7 aa 5 aaa 1 aaaa 2 aaaaa 8 ab 3 afltkjgl 1 afpq 1 agpawtpzn 1 b 1 bmuxx 4 bwluskeu 1 bynltxl 1 cd...
result:
ok 274 tokens
Test #6:
score: 10
Accepted
time: 3ms
memory: 3104kb
input:
1000 2 10 svucl orzovok ownt pg ts jgesl eokfcnfd qisgh pallolh tkjlve 1 lfrzsos qliopbyobhhrp 1 pig...
output:
bfmzetuyc 1 bq 1 cat 5 cknibjiw 1 clibityafq 1 dmixq 1 dog 6 dpbsbuhnly 1 duusqwby 1 dvsaqb 1 ehbstx...
result:
ok 226 tokens
Test #7:
score: 10
Accepted
time: 4ms
memory: 3116kb
input:
1000 1 gjhg qcmcdzizgrgoszfolkhywndkhxyoubelflhbinzkdbkearyujohzcpzontzbwnzezjkcxvvspxcsbiurwwgwpnta...
output:
ahvhp 1 amvyvke 1 aug 1 axki 1 bbp 1 bfwankb 1 bhlvbk 2 boe 1 cgp 1 chat 1 chien 4 cmepxjorbo 1 cqgo...
result:
ok 214 tokens
Test #8:
score: 10
Accepted
time: 3ms
memory: 3120kb
input:
1000 1 jrtdffp emwblffpvlzifzgqskcwjumwwxdphswniflivopkmbfsrkqdnesfcnhwgjzzb 1 jrtdffp emwblffpvlzif...
output:
atjdhcb 1 bhqiamesa 1 bwmmwf 1 bxg 1 bylbsseix 1 ccsezrvnds 1 dfbcpxosm 1 dgxuzxz 1 dsrojf 1 dwm 1 e...
result:
ok 184 tokens
Test #9:
score: 10
Accepted
time: 5ms
memory: 3124kb
input:
1000 2 10 akdhlldyie qplrvig tr ukut xthhsh aa ljgwep kivyhk nrgfiniqo tl 2 10 flvvcbx aaaa vpezzq y...
output:
aaaaaab 1 aaac 2 amm 1 aolj 1 axetnjd 1 axnbys 1 bba 1 bbb 1 bbc 2 bdvrvzsy 1 bl 1 bte 1 bugkxqyit 1...
result:
ok 188 tokens
Test #10:
score: 10
Accepted
time: 2ms
memory: 3116kb
input:
1000 1 vhxpkhhct hwjrrfipjtcfrqxhelhjjgfkyyjnnihqdshacuqamytxlhjqwtpqgkdqbfpotdjgdvkojfozk 2 10 fdww...
output:
adcvqc 1 axawaw 1 bdqmgwggv 1 bjegkrq 1 bkhdldfmk 1 bvkjnpph 1 bwjhrwfwqp 1 cckunaxzll 1 cjxlptkag 1...
result:
ok 200 tokens
Extra Test:
score: 0
Extra Test Passed