后若 找不到问题了,求佬解答

P3613 【深基15.例2】寄包柜

y1441206 @ 2023-11-23 09:25:14

#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int n , q ; cin >> n >> q;
    int op,i,j,k;
    vector<vector<int>> a(n+1),b(n+1); // 下标 
    while(q--){
        cin >> op;
        if(op == 1){
            cin >> i >> j >> k;
            a[i].push_back(k); // 存值 
            b[i].push_back(j); // 存下标 
        }else{
            cin >> i >> j;
            for(int t=0;t<b[i].size();t++){
                if(b[i][t] == j){
                    cout << a[i][t] << endl;
                    break;
                }
            }
        }
    }
    return 0;
}

by y1441206 @ 2023-11-23 09:39:40

好吧,是我题目看错了,sorry


|