#10034. 「一本通 2.1 例 2」图书管理

链接:Miku


一个map干过去


#include <map>
#include <cstring>
#include <cstdio>
#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
string s, now;
int n;
map<string, bool> m;
int main() {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> now;
        //    cout<<now;
        if (now == "add") {
            getline(cin, s);
            //        cout<<s;
            m[s] = 1;
        } else {
            getline(cin, s);
            if (m[s])
                cout << "yes" << endl;
            else
                cout << "no" << endl;
        }
    }
    return 0;
}

Ac

 

 
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇