QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#509548#64. NaanKiharaTouma0 12ms14312kbC++14889b2024-08-08 15:58:102024-08-08 15:58:10

Judging History

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

  • [2024-08-08 15:58:10]
  • 评测
  • 测评结果:0
  • 用时:12ms
  • 内存:14312kb
  • [2024-08-08 15:58:10]
  • 提交

answer

//qoj64
#include <bits/stdc++.h>
using namespace std;

const int N = 2010;
int n, m, ok[N], ans[N], cut[N], pr[N];
typedef long long ll;
ll v[N][N], sum[N], nw[N];

int main(){
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; ++ i){
		for(int j = 1; j <= m; ++ j){
			scanf("%lld", &v[i][j]);
			sum[i] += v[i][j];
		}
	}
	for(int j = 1, c = 0; j <= m; ++ j){
		for(int i = 1; i <= n; ++ i){
			if(!ok[i]){
				nw[i] += v[i][j];
				if(nw[i] * n >= sum[i]){
					++ c;
					ans[c] = j;
					++ pr[j];
					cut[c] = i;
					ok[i] = 1;
					for(int k = 1; k <= n; ++ k){
						if(!ok[k]){
							nw[k] = 0;
						}
					}
					-- j;
					break;
				}
			}
		}
	}
	for(int i = 1; i < n; ++ i){
		printf("%lld %lld\n", (ans[i]-1)*pr[ans[i]]+1, pr[ans[i]]);
		-- pr[ans[i]];
	}
	for(int i = 1; i <= n; ++ i){
		printf("%d ", cut[i]);
	}
	puts("");
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 1ms
memory: 3912kb

input:

2 1516
42058 25892 51128 40494 78380 30332 47660 58339 90812 50469 28184 75581 61837 25051 90975 98279 81022 90217 31015 72984 89884 68399 47215 10071 43418 61089 91302 96661 47701 86531 26050 80503 54870 1405 71971 39883 82485 66816 115 49358 86761 24392 32521 87048 19107 56752 23862 96755 80318 44...

output:

750 1
2 1 

result:

ok good plan

Test #2:

score: 5
Accepted
time: 1ms
memory: 3920kb

input:

2 1695
76378 25507 49544 44950 65160 78873 9386 2835 83577 43277 76229 211 44539 72155 22877 94528 90143 3059 2545 54142 93915 38121 21660 42212 2905 22170 43789 49582 23309 23087 21879 45961 28979 2149 83758 55646 64230 18591 99255 85995 12089 33270 72149 71120 93645 42211 83004 67031 30337 58759 8...

output:

846 1
1 2 

result:

ok good plan

Test #3:

score: 5
Accepted
time: 1ms
memory: 4008kb

input:

2 1896
5656 8488 83550 73597 66974 30814 60595 60681 58121 15839 43067 39354 72302 99482 94940 54418 44486 26825 3593 2745 46490 31847 38002 89179 52576 56052 23613 2386 32515 13670 51023 99869 67448 18185 89358 79676 73441 90660 76289 78975 35379 98098 96191 16119 75401 71516 46141 53036 49002 9248...

output:

938 1
1 2 

result:

ok good plan

Test #4:

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

input:

2 1089
5 4 5 1 5 3 2 4 5 5 1 3 3 1 2 5 4 1 5 5 5 3 1 2 2 2 1 5 2 92110 1 3 2 4 1 1 1 5 2 4 2 3 4 5 2 1 5 3 68199 92895 2 3 2 2 4 3 4 5 2 21113 2 3 2 3 4 2 3 2 3 5 1 2 4 3 4 2 2 4 3 1 5 1 3 2 2 3 3 5 1 2 5 4 5 4 5 2 3 2 5 3 1 1 4 1 3 1 3 4 3 3 2 1 5 3 4 4 5 4 4 4 5 2 5 1 5 4 2 2 3 1 4 1 2 31268 5 1 5...

output:

446 1
2 1 

result:

ok good plan

Test #5:

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

input:

2 207
2 4 5 2 5 5 4 3 53669 1 3 3 2 4 4 5 3 5 4 4 3 2 4 2 4 3 50596 5 4 4 1 5 2 3 5 4 3 2 5 4 5 1 5 5 1 3 4633 2 1 53463 3 5 5 4 4 2 2 5 2 74695 2 55853 90432 5 5 4 1 1 3 2 5 1 2 3 4 2 5 2 1819 1 5 5 1 4 1 3 3 1 4 1 3 3 33131 1 4 4 3 1 1 3 4 2 3 5934 2 3 2 1 1 3 24906 4 1 5 5 4 2 3 2 2 5 2 1 5 1 1 5...

output:

75 1
2 1 

result:

ok good plan

Test #6:

score: 5
Accepted
time: 1ms
memory: 3912kb

input:

2 1484
79520 5 2 1 4 2 4 4 1 5 3 5 1 3 2 3 4 5 2 1 5 5 5 5 3 5 3 1 2 2 4 5 2 4 1 4 5 4 5 29879 36119 5 14571 1 5 5 3 3 2 4 4 5 31580 1 1 1 4 5 4 3 1 4 3 2 5 2 3 1 2 4 4 3 2 35480 1 5 4 4 1 2 2 5 5 2 3 3 4 1 1 4 1 4 5 4 1 1 1 4856 4 3 5 5 5 5 3 3 5571 91607 3273 3 1 4 2 5 63040 5 2 1 3 2 1 2 99930 4 ...

output:

602 1
1 2 

result:

ok good plan

Test #7:

score: 0
Wrong Answer
time: 0ms
memory: 3912kb

input:

2 1644
5 2 4 2 2 3 1 4 3 4 1 4 4 5 1 2 5 2 2 3 1 5 3 1 4 5 5 4 2 5 2 4 5 4 3 5 4 5 2 5 1 3 1 5 2 5 3 2 5 3 5 3 4 3 5 2 5 2 69823 3 4 1 2 2 1 4 1 4 5 4 4 2 2 5 5 5 5 4 4 5 4 2 4 5 3 5 1 5 4 5 4 4 5 3 5 2 2 5 5 1 2 1 2 3 4 3 2 5 3 4 3 3 1 1 4 4 1 3 3 2 2 4 3 2 1 1 5 3 4 1 3 2 2 1 4 5 1 5 4 5 5 5 5 1 5...

output:

117 2
1 2 

result:

wrong answer 

Subtask #2:

score: 0
Wrong Answer

Test #15:

score: 24
Accepted
time: 0ms
memory: 4008kb

input:

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

output:

570 1
2 1 

result:

ok good plan

Test #16:

score: 0
Wrong Answer
time: 1ms
memory: 4032kb

input:

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

output:

290 1
580 1
862 1
1 4 3 2 

result:

wrong answer 

Subtask #3:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 12ms
memory: 14312kb

input:

563 467
8049 85539 27182 28071 94216 41847 50021 12220 27028 36160 7314 23133 44548 80654 65291 17329 61691 98590 68874 59735 6789 7383 17300 46373 35858 95819 15891 55598 25928 20662 99160 79046 1004 1901 33290 20640 86369 3246 36921 56090 11582 48092 48473 32198 80924 42208 80056 24593 43827 68820...

output:

1 324
1 323
1 322
1 321
1 320
1 319
1 318
1 317
1 316
1 315
1 314
1 313
1 312
1 311
1 310
1 309
1 308
1 307
1 306
1 305
1 304
1 303
1 302
1 301
1 300
1 299
1 298
1 297
1 296
1 295
1 294
1 293
1 292
1 291
1 290
1 289
1 288
1 287
1 286
1 285
1 284
1 283
1 282
1 281
1 280
1 279
1 278
1 277
1 276
1 275
...

result:

wrong answer