20分求助,只能AC第三个点,其他都是wa too short

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

for循环的i和输入的冲突了
by Mitchellyi @ 2024-02-26 21:10:56


https://www.luogu.com.cn/paste/xt6e9ycb
by Mitchellyi @ 2024-02-26 21:11:35


```cpp #include<bits/stdc++.h> using namespace std; int n,q; int read(){ int x=0; int f=1; char c=getchar(); while(!isdigit(c)){ if(c=='-'){ f=-1; } c=getchar(); } while(isdigit(c)){ x=x*10+(c&15); c=getchar(); } return x*f; } map<long long,long long>a[100001]; int main(){ n=read(); q=read(); while(q--){ int x; x=read(); if(x==1){ int i,j,k; i=read(); j=read(); k=read(); a[i][j]=k; }else{ int i,j; i=read(); j=read(); printf("%d\n",a[i][j]); } } return 0; } ```
by Wzl111 @ 2024-03-18 20:47:13


O(q)的复杂度
by Wzl111 @ 2024-03-18 20:48:33


|