<<Sets-STL>> _HakerRank_C++_STL

#include <cmath>#include <cstdio>#include <vector>#include <iostream>#include <set>#include <algorithm>using namespace std;int main() {    /* Enter your code here. Read input from STDIN. Print output to STDOUT */     int q = 0, x = 0, y = 0;    cin >> q ;        set<int> s ;    set<int> it ;    for(int i = 0 ; i < q ; i++)    {        cin >> x >> y ;        switch (x)        {            case 1 :                 s.insert(y);                break;            case 2 :                s.erase(y);                break;            case 3 :                if(s.find(y) != s.end()) cout << "Yes\n" ;                else cout << "No\n" ;                break;        }    }            return 0;}

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章