QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#509555#64. NaanKiharaTouma0 16ms12536kbC++14938b2024-08-08 16:01:262024-08-08 16:01:31

Judging History

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

  • [2024-08-08 16:01:31]
  • 评测
  • 测评结果:0
  • 用时:16ms
  • 内存:12536kb
  • [2024-08-08 16:01:26]
  • 提交

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 <= m; ++ i){
		++ pr[i];
	}
	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("");
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

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:

1499 2
2 1 

result:

wrong answer 

Subtask #2:

score: 0
Wrong Answer

Test #15:

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

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:

1139 2
2 1 

result:

wrong answer 

Subtask #3:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 16ms
memory: 12536kb

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 325
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
...

result:

wrong answer