QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#781291#9743. 重心树ZpairWA 0ms3856kbC++20367b2024-11-25 15:34:002024-11-25 15:34:01

Judging History

This is the latest submission verdict.

  • [2024-11-25 15:34:01]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3856kb
  • [2024-11-25 15:34:00]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int n;
void solve(){
	scanf("%d",&n);
	vector<pair<int, int> > ans;
	for(int i=1;i<=n;++i){
		int x,y;
		scanf("%d",&x);
		while(x--){
			scanf("%d",&y);
			ans.push_back({i,y});
		}
	}
	for(auto [x,y]:ans)
		printf("%d %d\n",x,y);
}
int main(){
	int T;cin>>T;
	while(T--)solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
4
2 3 4
1 3
0
0
3
1 3
1 3
0

output:

1 3
1 4
2 3
1 3
2 3

result:

wrong answer The index of the node i's father should less than i (test case 1)