QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#201625#5512. Stone Arranging 2jmyszka#0 25ms4940kbC++172.1kb2023-10-05 15:36:542024-07-04 02:16:43

Judging History

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

  • [2024-07-04 02:16:43]
  • 评测
  • 测评结果:0
  • 用时:25ms
  • 内存:4940kb
  • [2023-10-05 15:36:54]
  • 提交

answer

#include <bits/stdc++.h>
#include <fstream>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template<class A, class B>
ostream& operator<<(ostream& o, const pair<A, B>& p) {return o << '(' << p.first << ", " << p.second << ')';}
template<size_t Index = 0, typename... Types>
ostream& printTupleElements(ostream& o, const tuple<Types...>& t) {if constexpr (Index < sizeof...(Types)){if(Index > 0){o << ", ";}o << get<Index>(t);printTupleElements<Index + 1>(o, t);}return o;}
template<typename... Types>
ostream& operator<<(ostream& o, const tuple<Types...>& t){o << "(";printTupleElements(o, t);return o << ")";}
template<class T>
auto operator<<(ostream& o, const T& x) -> decltype(x.end(), o){o << '{';bool first = true;for (const auto& e : x){if (!first){o << ", ";}o << e;first = false;} return o << '}';}
#define DEBUG
#ifdef DEBUG
#define fastio()
#define debug(x...) cerr << "[" #x "]: ", [](auto... $) {((cerr << $ << "; "), ...); }(x), cerr << '\n'
#define check(x) if (!(x)) { cerr << "Check failed: " << #x << " in line " << __LINE__ << endl; exit(1); }
#else
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0);
#define debug(...)
#define check(x) 
#endif
typedef long long ll;
#define pi pair<int, int>
#define pll pair<ll, ll>
#define st first
#define nd second
#define vi vector<int>
#define vll vector<ll>
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
unordered_map<int, vi>wys;
void solve() {
	//ifstream cin("nazwa.in");
	//ofstream cout("nazwa.out");
	int n;
	cin >> n;
	vi tab(n + 1);
	for(int i = 1; i <= n; i++) {
		cin >> tab[i];
		wys[tab[i]].eb(i);
	}
	for(int i = 1; i <= n; i++) {
		for(int j = i - 1; j >= 1; j--) {
			if(tab[j] == tab[i]) {
				for(int k = j + 1; k < i; k++) {
					tab[k] = tab[i];
				}
				break;
			}
		}
	}
	for(int i = 1; i <= n; i++) {
		cout << tab[i] << ' ';
	}
	cout << '\n';
}
int main() {
	fastio();
	int t = 1;
	//cin >> t;
	while(t--) {
		solve();
	}
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 25
Accepted
time: 0ms
memory: 3592kb

input:

1
1

output:

1 

result:

ok single line: '1 '

Test #2:

score: -25
Wrong Answer
time: 0ms
memory: 3592kb

input:

2
1
1

output:

1 1 

result:

wrong answer 1st lines differ - expected: '1', found: '1 1 '

Subtask #2:

score: 0
Wrong Answer

Test #29:

score: 0
Wrong Answer
time: 25ms
memory: 4940kb

input:

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
1...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

wrong answer 1st lines differ - expected: '1', found: '1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 '

Subtask #3:

score: 0
Skipped

Dependency #1:

0%