QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511135#5203. Easy Assemblywangyue2017WA 1ms5676kbC++17498b2024-08-09 16:41:392024-08-09 16:41:39

Judging History

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

  • [2024-08-09 16:41:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5676kb
  • [2024-08-09 16:41:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N =1.1e6;
int a[N];
pair<int,int> s[N];
signed main(){
	int t;
	cin>>t;
	int ip=0;
	for(int i=1;i<=t;++i){
		int n;
		cin>>n;
		for(int i=1;i<=n;++i)cin>>s[++ip].first,s[ip].second=ip;
		++ip;
	}
	sort(s+1,s+1+ip);
	for(int i=1;i<=ip;++i){
		if(s[i].second)
		a[s[i].second]=i;
	}
	int ans=0;
	for(int i=1;i<=ip;++i){
		if(a[i]==0)continue;
		ans++;
		while(a[i+1]==a[i]+1)i++;
	}
	cout<<ans-t<<" "<<ans-t+1<<endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5656kb

input:

2
3 3 5 8
2 9 2

output:

1 2

result:

ok 2 number(s): "1 2"

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 5676kb

input:

1
1 1

output:

0 1

result:

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