QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#326425#5512. Stone Arranging 2SUICIDEGIRL0 14ms3832kbC++141.5kb2024-02-13 02:18:052024-02-13 02:18:05

Judging History

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

  • [2024-02-13 02:18:05]
  • 评测
  • 测评结果:0
  • 用时:14ms
  • 内存:3832kb
  • [2024-02-13 02:18:05]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define F first
#define S second

using namespace std;
//using namespace __gnu_pbds;

//typedef tree<ll, null_type, less_equal<ll>,
   // rb_tree_tag, tree_order_statistics_node_update>
    //TREE;

int main() {

	ios_base::sync_with_stdio(0); cin.tie(0);

	int n; cin >> n;
	vector <int> v (n);
	for (int i = 0; i < n; i++) {
        cin >> v[i];
	}
	map <int, int> mp;

	mp[v[0]] = 0;
    for (int i = 1; i < n; i++) {
        if (mp[v[i]] == 0 && v[i] != v[0]) {
            mp[v[i]] = i;
        }

    }

    vector <pair <int,int> > x;

    int r = n-1;
    int l = mp[v[n-1]];
    int aux = l;
    int help = r;
    x.pb({r-l, v[n-1]});
    map <int,int> Mp;
    Mp[v[n-1]]++;
    int g = n-1;
    map <int,int> mapa;
    mapa[v[g]] = g;

    for (int i = n-2; i >= 0; i--) {
        r = i;
        l = mp[v[i]];
        if (l < aux && Mp[v[i]] == 0) {
            x.pop_back();

            x.pb({help - mapa[v[g]]+1, v[g]});
            x.pb({r-l+1, v[i]});

            aux = l;
            help = r;
            Mp[v[i]]++;
            g =i;
        }
        mapa[v[i]] = i;
    }
    reverse (x.begin(), x.end());
    for (auto c : x) {
        int to = c.F;
        while (to--) {
            cout << c.S << "\n";
        }
    }
	return 0;
}
/**
1 2 !


1
1
2
2
1
2
2
1
1
2


6
1
2
1
2
3
2



**/

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1
1

output:


result:

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

Subtask #2:

score: 0
Wrong Answer

Test #29:

score: 0
Wrong Answer
time: 14ms
memory: 3832kb

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 200000th lines differ - expected: '1', found: ''

Subtask #3:

score: 0
Skipped

Dependency #1:

0%