QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#446799#6389. Topicalgiorgi_pkhaladze0 7ms10676kbC++23918b2024-06-17 16:22:082024-06-17 16:22:09

Judging History

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

  • [2024-06-17 16:22:09]
  • 评测
  • 测评结果:0
  • 用时:7ms
  • 内存:10676kb
  • [2024-06-17 16:22:08]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,k,i,j,ans,a[1000005],x,y,cnt[1000005],b[1000005];
vector<pll> v[1000005];
int main() {
	cin>>n>>m;
	ll u[n+1][m+1];
	for(k=1; k<=n; k++){
		for(j=1; j<=m; j++){
			cin>>x;
			v[j].pb({x,k});
		}
	}
	for(k=1; k<=m; k++)cnt[k]=0;
	for(k=1; k<=m; k++){sort(v[k].begin(),v[k].end()); v[k].pb({1e17,-1});}
	for(i=1; i<=n; i++) for(j=1; j<=m; j++)cin>>u[i][j];
	for(k=1; k<=m; k++)a[k]=0;
	for(k=1; k<=n; k++)b[k]=0;
	bool gio=1;
	ans=0;
	while(gio){
		gio=0;
		for(k=1; k<=m; k++){
			while(a[k]>=v[k][cnt[k]].ff){
				gio=1;
				b[v[k][cnt[k]].ss]++;
				if(b[v[k][cnt[k]].ss]==n){ ans++;
					for(i=1; i<=m; i++){
						a[k]+=u[v[k][cnt[k]].ss][i];
					}
				} cnt[k]++;
			}
		}
	} 
	cout<<ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1 1
693647287
340782526

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 12
Accepted
time: 2ms
memory: 7752kb

input:

1 100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
279985824 991797187 998715443 98505529 106002744 636773096 815089164 196160830 796988849 87975...

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Wrong Answer
time: 3ms
memory: 10676kb

input:

1 10000
841961872 0 0 0 0 0 0 0 0 0 0 0 0 0 831386430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 205210920 705123207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 276768098 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 661649446 0 0 0 0 0 0 0 0 0 0 ...

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 2ms
memory: 7708kb

input:

100 1
893339036
896783899
690308537
201770764
262364362
105000893
770698921
744238454
470980016
935046317
642998516
100481910
392307650
116783134
196939768
372329082
346372520
43063564
245523488
389084350
130314590
412588681
987795927
681635353
304582580
472268968
700147283
743357606
792644412
99955...

output:

0

result:

wrong answer 1st numbers differ - expected: '85', found: '0'

Subtask #3:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 7ms
memory: 6104kb

input:

10000 1
568857328
651788426
751475430
102940442
763289419
468657944
770847628
780257867
16919385
575963868
281824241
291248174
140016533
313529232
302186452
32709864
787073783
1926820
239509174
220454071
34252400
390385721
675239026
245106357
489697460
28435096
825528061
159083009
16370561
223299279...

output:

0

result:

wrong answer 1st numbers differ - expected: '10000', found: '0'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%