QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#511135 | #5203. Easy Assembly | wangyue2017 | WA | 1ms | 5676kb | C++17 | 498b | 2024-08-09 16:41:39 | 2024-08-09 16:41:39 |
Judging History
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'