結果

問題 No.714 回転寿司屋のシミュレート
ユーザー tatyamtatyam
提出日時 2018-07-13 22:52:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 1,243 bytes
コンパイル時間 2,227 ms
コンパイル使用メモリ 199,244 KB
最終ジャッジ日時 2025-01-06 11:59:44
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define INF (ll)1e18
struct aaa{aaa(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(10);};}aaaaaaa;
inline void in() {}
template <class Head, class... Tail>
inline void in(Head&& head,Tail&&... tail){
    cin>>head;
    in(move(tail)...);
}
template <class T>
inline void out(T t) {
    cout<<t<<'\n';
}
template <class Head, class... Tail>
inline void out(Head head,Tail... tail){
    cout<<head<<' ';
    out(move(tail)...);
}

int main(){
    array<vector<string>, 21> sushi;
    int n;
    cin>>n;
    int type,sheet,m;
    string s;
    rep(i,0,n){
        in(type);
        if(!type){
            in(sheet,m);
            rep(j,0,m){
                in(s);
                sushi[sheet].push_back(s);
            }
        }
        else if(type==1){
            in(s);
            rep(j,1,21)rep(k,0,sushi[j].size())if(sushi[j][k]==s){
                sushi[j].erase(sushi[j].begin()+k);
                out(j);
                goto brek;
            }
            out(-1);
        brek:;
        }
        else{
            in(sheet);
            sushi[sheet].clear();
        }
    }
}





















0