QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#875542#2745. Mechanical DollAlimkhan18 163ms34188kbC++231.6kb2025-01-29 22:55:292025-01-29 22:55:29

Judging History

This is the latest submission verdict.

  • [2025-01-29 22:55:29]
  • Judged
  • Verdict: 18
  • Time: 163ms
  • Memory: 34188kb
  • [2025-01-29 22:55:29]
  • Submitted

answer

#include "doll.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ff first
#define ss second

const int maxn = 1e6 + 10;

int n, s, pw, l, id, a[maxn];
vector <int> X, Y;
vector <int> c;
map <int, int> lf, rg;
vector <pair <int, int> > d;

void get(int v, int tl, int tr) {
	int tm = (tl + tr) / 2;
	if (tm <= l) {
		lf[v] = -1;
	}
	if (tm + 1 == tr) {
		rg[v] = a[tr];
		// cnt++;
	} else {
		s--;
		rg[v] = s;
		get(s, tm + 1, tr);
	}
	if (tl == tm && lf[v] == 0) {
		lf[v] = a[tl];
		// cnt++;
	} else {
		if (lf[v] == 0) {
			s--;
			lf[v] = s;
			get(s, tl, tm);
		}
	}
	// cout << v << " " << lf[v] << " " << rg[v] << '\n';
}

void create_circuit(int M, std::vector<int> A) {
	A.push_back(0);	
	// c = {A[0]};
// 	A.erase(A.begin());
	// a = A;
	n = A.size();
	pw = 2;
	while(pw < n) {
		pw *= 2;
	}
	while(l + n < pw) {
		l++;
		a[l] = -1;
	}
	for (int i = 0; i < A.size(); i++) {
		int x = 0;
		for (int j = 19; j >= 0; j--) {
			if ((((i + l) >> j) & 1) == 1) {
				x += (1 << (19 - j));
			}
		}
		d.push_back({x, A[i]});
	}
	sort(d.begin(), d.end());
	id = l + 1;
	for (int i = 0; i < d.size(); i++) {
		a[id] = d[i].ss;
		id++;
	}
	s = -1;
	get(-1, 1, pw);
	for (int i = 1; i <= M; i++) {
		c.push_back(-1);
	}
	c.push_back(-1);
	for (int i = -1; i >= s; i--) {
		X.push_back(lf[i]);
		Y.push_back(rg[i]);
		// cout << i << " " << lf[i] << " " << rg[i] << '\n';
	}
	// for (int i = 0; i < c.size(); i++) {
	// 	cout << c[i] << " ";
	// }
	// cout << '\n';
	answer(c, X, Y);
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

9 9
2 9 8 1 3 7 6 4 5

output:

Wrong Answer: wrong motion

result:

wrong answer 

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 79ms
memory: 25248kb

input:

65537 131072
38169 29889 63383 43430 55643 44435 63973 61457 18223 38917 62266 26543 10814 970 44978 20275 62383 23625 55275 37609 18805 62029 32115 42887 25636 51086 64204 11787 41137 16164 3764 59071 41518 13112 48670 57859 63154 43506 4175 38360 56815 16082 35241 41583 11729 45167 16539 36608 524...

output:

Wrong Answer: wrong motion

result:

wrong answer 

Subtask #3:

score: 0
Wrong Answer

Test #14:

score: 0
Wrong Answer
time: 129ms
memory: 32864kb

input:

66666 199998
46730 34215 30702 41294 43268 29126 13518 38942 42908 58361 10352 13453 61990 51635 45179 17080 11893 59293 8765 48892 9847 29159 4183 35752 44930 54866 19016 8489 9471 61999 29220 3802 39755 15070 38640 20910 16621 20205 2930 36405 53436 33759 40537 24283 20254 60792 29716 4450 42478 2...

output:

Wrong Answer: wrong motion

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #23:

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

input:

5 16
2 4 2 4 5 5 2 4 5 4 2 2 5 5 4 1

output:

Wrong Answer: wrong motion

result:

wrong answer 

Subtask #5:

score: 18
Accepted

Test #31:

score: 18
Accepted
time: 0ms
memory: 3968kb

input:

1 33
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

output:

Accepted: 37 286

result:

points 1

Test #32:

score: 18
Accepted
time: 96ms
memory: 23176kb

input:

1 131072
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Accepted: 131089 2752510

result:

points 1

Test #33:

score: 18
Accepted
time: 94ms
memory: 24856kb

input:

1 131073
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Accepted: 131089 2752510

result:

points 1

Test #34:

score: 18
Accepted
time: 163ms
memory: 32100kb

input:

1 200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Accepted: 200012 3836286

result:

points 1

Subtask #6:

score: 0
Wrong Answer

Test #35:

score: 0
Wrong Answer
time: 124ms
memory: 34188kb

input:

40000 200000
18605 24497 29838 20963 4861 7592 1633 39477 36565 8297 18190 30474 13552 13537 21338 11904 20265 31867 16132 3720 10773 14695 7860 2766 29 34536 36990 22269 35364 15921 24814 6064 39832 24011 17689 20704 9159 7612 1993 36334 29110 2976 29779 10914 25954 17922 39388 28558 30311 7769 195...

output:

Wrong Answer: wrong motion

result:

wrong answer