QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#863591#9736. Kind of Bingo2018ljw#AC ✓12ms9344kbC++14534b2025-01-19 19:36:462025-01-19 19:36:47

Judging History

你现在查看的是最新测评结果

  • [2025-01-19 19:36:47]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:9344kb
  • [2025-01-19 19:36:46]
  • 提交

answer

#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
int n,m,k;
vector<int>g[100001];
void solve(){
	int i,j;
	scanf("%d%d%d",&n,&m,&k);
	for(i=1;i<=n;i++)g[i].resize(0);
	for(i=1;i<=n*m;i++){
		int w,x,y;
		scanf("%d",&w);
		x=(w-1)/m+1;
		y=w-x*m;
		g[x].push_back(i);
	}
	if(k>=m){
		printf("%d\n",m);
		return;
	}
	int res=1e9;
	for(i=1;i<=n;i++)res=min(res,max(m,g[i][m-k-1]));
	printf("%d\n",res);
}
int main(){
	int t;
	scanf("%d",&t);
	while(t--)solve();
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 6144kb

input:

3
3 5 2
1 4 13 6 8 11 14 2 7 10 3 15 9 5 12
2 3 0
1 6 4 3 5 2
2 3 1000000000
1 2 3 4 5 6

output:

7
5
3

result:

ok 3 number(s): "7 5 3"

Test #2:

score: 0
Accepted
time: 5ms
memory: 6164kb

input:

10000
1 9 7
8 9 1 5 3 7 4 6 2
1 8 2
7 5 1 6 4 2 3 8
1 1 0
1
1 8 3
5 7 8 3 2 1 4 6
1 10 948645336
3 10 1 6 2 8 9 5 7 4
1 1 0
1
1 10 7
5 3 10 8 1 7 4 9 6 2
1 9 6
4 8 5 7 2 6 3 1 9
1 7 1
3 5 1 6 2 7 4
1 6 6
5 3 1 2 4 6
1 1 1
1
1 2 0
1 2
1 1 1
1
1 6 3
5 6 2 4 3 1
1 5 673454194
2 3 1 4 5
1 4 1
1 4 2 3
1 ...

output:

9
8
1
8
10
1
10
9
7
6
1
2
1
6
5
4
1
7
3
3
6
8
9
10
5
6
2
10
4
2
5
7
10
1
4
1
3
9
1
2
4
3
10
5
5
2
5
6
9
5
10
1
7
5
2
2
7
1
2
9
8
9
1
6
6
2
2
1
2
6
4
6
1
2
6
4
2
3
4
7
3
4
1
6
3
5
10
7
4
1
10
3
4
2
6
10
1
8
4
9
9
10
4
6
3
3
6
2
2
6
6
10
7
7
1
3
2
7
9
3
4
4
5
6
3
7
5
6
5
5
8
2
6
6
9
7
7
10
8
1
1
10
7
...

result:

ok 10000 numbers

Test #3:

score: 0
Accepted
time: 1ms
memory: 6144kb

input:

1000
6 9 7
38 29 47 30 9 34 4 33 6 15 35 13 41 14 25 37 8 43 52 16 23 39 32 21 36 28 27 17 20 50 11 12 10 5 42 46 45 3 2 1 49 19 40 18 22 53 24 26 54 51 44 31 7 48
9 10 0
16 68 8 22 9 49 87 24 3 81 23 75 31 84 40 62 63 83 29 71 39 56 69 7 66 79 26 42 64 27 17 54 18 65 21 10 82 25 36 1 12 57 41 37 47...

output:

9
76
6
3
4
5
34
9
3
4
2
24
1
9
11
30
9
2
2
8
5
69
7
7
7
2
12
42
21
8
5
1
7
4
8
9
48
3
4
1
4
5
4
7
3
9
7
1
10
15
3
7
25
8
1
7
4
1
1
7
10
5
8
15
7
8
3
20
9
27
23
9
8
3
9
7
1
1
1
6
16
5
9
1
2
3
3
17
35
3
31
5
1
18
10
5
1
2
1
35
4
4
3
10
12
2
2
3
7
10
7
7
44
6
13
4
6
23
47
7
22
10
7
23
7
2
7
8
46
7
9
1
...

result:

ok 1000 numbers

Test #4:

score: 0
Accepted
time: 6ms
memory: 6272kb

input:

10
95 96 140424908
5498 6378 2916 4539 8803 3415 4563 4328 1173 7196 1631 8768 4510 1149 5261 1243 9023 4557 9005 3261 6239 4575 3386 7990 8679 8296 205 7807 8115 1802 1226 7774 5646 363 6461 7941 3470 5282 5621 5223 5492 7931 5821 5182 4388 3489 2681 6481 8871 2112 2630 733 2579 5741 1157 5556 6944...

output:

96
97
4570
1166
585
2327
893
89
5395
3171

result:

ok 10 numbers

Test #5:

score: 0
Accepted
time: 5ms
memory: 6400kb

input:

1
1 100000 50000
50735 33590 8670 95305 15643 46124 46825 30396 43426 34338 25755 40318 20155 23825 54910 95081 43646 93083 89153 93056 66677 70986 20967 73894 58116 87202 55261 19069 68782 79512 68744 16648 10038 45316 28100 22845 91291 85929 50817 37608 24935 32949 3173 8506 17477 90158 49110 7393...

output:

100000

result:

ok 1 number(s): "100000"

Test #6:

score: 0
Accepted
time: 4ms
memory: 6272kb

input:

1
2 50000 10000
99395 38827 46503 21511 80654 44941 94835 85732 12756 99227 29262 89683 27147 51454 92147 52372 66446 45221 63290 5514 32463 19306 91908 78125 34345 37356 8873 18063 41335 22427 61202 36545 9687 90263 64732 91469 23887 89327 13507 14088 67610 68970 39355 79387 24686 44139 41710 28085...

output:

79940

result:

ok 1 number(s): "79940"

Test #7:

score: 0
Accepted
time: 7ms
memory: 6656kb

input:

1
10 10000 1000
7841 86148 35458 22053 72597 99955 66349 84430 13043 68103 50209 12941 29493 50205 68003 37387 19345 30042 88593 95421 85892 8176 64998 83812 64897 912 78966 51597 79612 35547 45504 92981 55903 54384 39524 70719 27882 23983 8478 91178 11709 33200 76036 99034 85575 50663 22612 62437 3...

output:

89637

result:

ok 1 number(s): "89637"

Test #8:

score: 0
Accepted
time: 6ms
memory: 6384kb

input:

1
100 1000 100
79514 31836 98006 66865 91658 11319 83663 44332 91597 86333 59662 47403 21514 40328 58367 27170 42943 36169 78438 6434 99511 64881 18574 74072 34877 58898 17335 67237 82479 2561 30015 84884 36641 30355 62680 20120 6606 35328 93524 36869 32590 66124 5543 48840 47093 43584 83778 40201 7...

output:

87546

result:

ok 1 number(s): "87546"

Test #9:

score: 0
Accepted
time: 7ms
memory: 6912kb

input:

1
316 316 20
50379 4273 79924 69076 22163 18129 4652 41333 34378 92415 75437 11838 89914 18079 15463 43828 27187 64638 52368 65514 14222 576 55468 9095 91827 98298 46509 41708 88632 72017 29994 73817 78812 33371 23835 32549 76291 2361 65209 59502 51374 97277 31561 38137 49463 98279 2910 42477 2178 7...

output:

87823

result:

ok 1 number(s): "87823"

Test #10:

score: 0
Accepted
time: 7ms
memory: 6668kb

input:

1
1000 100 10
28219 36888 7060 88192 67345 8034 80465 69104 69828 65821 2379 4546 50742 44741 49155 19246 82313 10065 20443 24843 58536 74667 86276 10742 86582 84761 88633 49487 76085 26409 57664 66506 35257 58687 72087 54239 34046 10487 33411 41508 59565 55243 18457 3756 68701 47813 8197 10767 6190...

output:

76758

result:

ok 1 number(s): "76758"

Test #11:

score: 0
Accepted
time: 11ms
memory: 7168kb

input:

1
10000 10 2
63649 14562 779 31060 84730 3390 1402 70955 27426 79066 4156 82101 95994 42943 67415 9064 24177 88533 78946 40125 47217 68506 98024 89760 73146 71691 99738 24048 47688 82209 48668 79705 79917 27610 93536 82477 57841 1489 93362 52547 57545 93218 2251 20688 29636 88100 94802 20862 43091 6...

output:

22087

result:

ok 1 number(s): "22087"

Test #12:

score: 0
Accepted
time: 9ms
memory: 7680kb

input:

1
50000 2 1
73762 12124 29167 93932 27022 2261 98803 12289 28686 35629 6478 52631 50403 99767 73864 44612 71726 23092 50842 16335 2826 42247 28898 50690 55343 14055 17481 93427 58724 62628 93041 25561 38703 88920 6409 69902 4451 33782 42523 60018 51816 26451 228 62568 50789 4886 59807 52694 31135 58...

output:

2

result:

ok 1 number(s): "2"

Test #13:

score: 0
Accepted
time: 12ms
memory: 9344kb

input:

1
100000 1 0
47746 9112 49327 145 41482 40565 38394 27153 14733 61278 93184 54590 79706 40614 62572 35720 521 45061 42716 62906 93088 30544 31984 70643 57485 50078 98609 39793 84781 37550 94424 64614 85388 97773 16810 41861 28035 61274 29756 78534 96771 18831 84715 60118 69489 92929 52968 38622 9075...

output:

1

result:

ok 1 number(s): "1"

Extra Test:

score: 0
Extra Test Passed