QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#773259#9786. Magical Bagsucup-team5319#WA 0ms3828kbC++14600b2024-11-23 08:11:042024-11-23 08:11:08

Judging History

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

  • [2024-11-23 08:11:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3828kb
  • [2024-11-23 08:11:04]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
vector<pair<int, int>> vc;
int main() {
		int n; scanf("%d", &n);
		for (int i = 0; i < n; i++) {
			int mx = -0x3f3f3f3f, mn = 0x3f3f3f3f;
			int m; scanf("%d", &m);
			vector<int> v(m); for (int j = 0; j < m; j++) {
				int x; scanf("%d", &x); mx = max(mx, x), mn = min(mn, x);
				v[j] = x;
			}
			vc.push_back({mn, mx});
		}
		sort(vc.begin(), vc.end());
		int cnt = 0, f = -1;
		for (int i = 0; i < n; i++) {
			cnt += f < vc[i].first;
			f = max(f, vc[i].second);
		}
		printf("%d\n", n * 2 - cnt);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3828kb

input:

4
3 4 7 10
2 1 9
4 11 2 8 14
3 6 12 13

output:

7

result:

ok 1 number(s): "7"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

4
1 1
1 2
1 3
1 4

output:

4

result:

ok 1 number(s): "4"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

4
3 4 7 10
2 1 9
4 11 2 8 14
3 6 12 13

output:

7

result:

ok 1 number(s): "7"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

4
1 1
1 2
1 3
1 4

output:

4

result:

ok 1 number(s): "4"

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3788kb

input:

100
4 372861091 407948190 424244630 359746969
6 568180757 527358812 494745349 665803213 674832670 586694351
4 696340797 775899164 919971335 716827187
4 123145962 344250363 122030550 251739234
4 342654413 368648894 150539766 255189030
1 194505887
3 755984448 736803561 745474041
4 709314938 498953418 ...

output:

198

result:

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