QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#446800#6389. Topicalgiorgi_pkhaladze0 2ms9808kbC++23918b2024-06-17 16:22:472024-06-17 16:22:48

Judging History

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

  • [2024-06-17 16:22:48]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:9808kb
  • [2024-06-17 16:22:47]
  • 提交

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<=n; k++){
			while(a[k]>=v[k][cnt[k]].ff){
				gio=1;
				b[v[k][cnt[k]].ss]++;
				if(b[v[k][cnt[k]].ss]==m){ ans++;
					for(i=1; i<=m; i++){
						a[k]+=u[v[k][cnt[k]].ss][i];
					}
				} cnt[k]++;
			}
		}
	} 
	cout<<ans;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1 1
693647287
340782526

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: -12
Wrong Answer
time: 2ms
memory: 9808kb

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:

0

result:

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

Subtask #2:

score: 0
Runtime Error

Test #8:

score: 0
Runtime Error

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:


result:


Subtask #3:

score: 0
Runtime Error

Test #15:

score: 0
Runtime Error

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:


result:


Subtask #4:

score: 0
Skipped

Dependency #1:

0%