ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#205746 | #3697. 寄包柜 | hujunyi66 | 100 | 149ms | 46196kb | C++ | 737b | 2024-07-19 18:21:16 | 2024-07-19 20:11:07 |
answer
#include <bits/stdc++.h>
using namespace std;
inline int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
inline void write(int x)
{
if(x<0)
{
putchar('-');
x=-x;
}
if(x>9)
write(x/10);
putchar(x%10+'0');
}
int main()
{
ios::sync_with_stdio(false);
int n,q,f,x,y,K;
n=read();
q=read();
vector<vector<int> > a(n+1);
while(q--)
{
f=read();
if(f==1)
{
x=read();
y=read();
K=read();
if(a[x].size()<y+1) a[x].resize(y+1);
a[x][y]=K;
}else{
x=read();
y=read();
write(a[x][y]);
puts("");
}
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1216kb
input:
5 25 1 1 1 9 2 1 1 1 2 1 8 2 2 1 1 2 2 22 2 2 2 1 3 1 17 2 3 1 1 3 5 25 2 3 5 1 4 1 8 2 4 1 1 4 4 4 ...
output:
9 8 22 17 25 8 4 13 17
result:
ok 9 lines
Test #2:
score: 10
Accepted
time: 1ms
memory: 1212kb
input:
8 40 1 1 1 26 2 1 1 1 1 7 19 2 1 7 1 2 1 3 2 2 1 1 2 7 20 2 2 7 1 3 1 8 2 3 1 1 3 5 26 2 3 5 1 4 1 8...
output:
26 19 3 20 8 26 8 9 29 22 20 19 21 13 25
result:
ok 15 lines
Test #3:
score: 10
Accepted
time: 0ms
memory: 1244kb
input:
48 287 1 1 1 112 2 1 1 1 2 222 479 2 2 222 1 3 176 670 2 3 176 1 4 4 284 2 4 4 1 5 234 629 2 5 234 1...
output:
112 479 670 284 629 35 1004 1056 1182 1286 818 94 694 992 575 1065 1138 1384 427 890 836 418 354 109...
result:
ok 140 lines
Test #4:
score: 10
Accepted
time: 0ms
memory: 1244kb
input:
35 265 1 1 64 306 2 1 64 1 2 22 84 2 2 22 1 3 93 71 2 3 93 1 4 6 889 2 4 6 1 5 171 1287 2 5 171 1 6 ...
output:
306 84 71 889 1287 905 554 143 1317 758 245 901 982 836 1196 564 1124 1278 573 65 297 827 331 232 63...
result:
ok 128 lines
Test #5:
score: 10
Accepted
time: 3ms
memory: 1852kb
input:
2069 13246 1 1 1 491811704 2 1 1 1 2 1 820353522 2 2 1 1 3 1 113503763 2 3 1 1 4 1 839952310 2 4 1 1...
output:
491811704 820353522 113503763 839952310 250489408 866937826 500199222 245364833 787675685 614784879 ...
result:
ok 5611 lines
Test #6:
score: 10
Accepted
time: 6ms
memory: 2116kb
input:
4045 35698 1 1 1 989944810 2 1 1 1 2 1 67244076 2 2 1 1 3 1 852042287 2 3 1 1 4 1 406935203 2 4 1 1 ...
output:
989944810 67244076 852042287 406935203 673355925 330503638 988691416 828193385 748011399 192870460 1...
result:
ok 14875 lines
Test #7:
score: 10
Accepted
time: 40ms
memory: 46196kb
input:
49992 100000 1 49992 213019 369305581 1 49992 82913 937610985 1 49992 54458 243994912 1 49992 375500...
output:
369305581 937610985 243994912 293316445 526395482 404578557 55782589 871896098 924291035 900281570 1...
result:
ok 50000 lines
Test #8:
score: 10
Accepted
time: 35ms
memory: 45964kb
input:
44470 100000 1 44470 41063 154544609 1 44470 153489 4533790 1 44470 444972 330968014 1 44470 232548 ...
output:
154544609 4533790 330968014 627408682 243493091 502401986 742644106 273963138 228210647 767087485 31...
result:
ok 50000 lines
Test #9:
score: 10
Accepted
time: 35ms
memory: 18368kb
input:
100000 100000 1 99981 100000 317972331 2 99981 100000 1 99982 100000 484860197 2 99982 100000 1 9998...
output:
317972331 484860197 142600903 48294341 527525517 373829569 398643004 146545031 66593841 661093147 32...
result:
ok 47279 lines
Test #10:
score: 10
Accepted
time: 29ms
memory: 18216kb
input:
100000 100000 1 99981 100000 865100719 2 99981 100000 1 99982 100000 688647524 2 99982 100000 1 9998...
output:
865100719 688647524 786854382 249220004 46491000 398396755 365455410 15901827 902178040 461808588 79...
result:
ok 47256 lines