Submission #66297873


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
 
#pragma region
 
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...)
#endif
 
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
 
#define all(x) x.begin(), x.end()
#define lef(x) (x << 1)
#define rig(x) (lef(x) | 1)
#define ft first
#define sd second
#define eb emplace_back
#define pb push_back
#define get_bit(x,i) ((x)&(1ll<<(i)))
 
using ll = long long;
using ld = long double;
// using i128 = __int128_t;
 
// template<class T> using ordset = tree<T, null_type, less<T>,
// rb_tree_tag, tree_order_statistics_node_update>;
 
template<class T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
 
const int MOD = 998244353;
 
struct mi {
    int v;
    explicit operator int() const { return v; }
    mi() { v = 0; }
    mi(long long _v) : v(_v % MOD) { v += (v < 0) * MOD;}
};
mi &operator+=(mi &a, mi b) {
    if ((a.v += b.v) >= MOD) a.v -= MOD;
    return a;
}
mi &operator-=(mi &a, mi b) {
    if ((a.v -= b.v) < 0) a.v += MOD;
    return a;
}
mi operator+(mi a, mi b) { return a += b; }
mi operator-(mi a, mi b) { return a -= b; }
mi operator*(mi a, mi b) { return mi((long long)a.v * b.v); }
mi &operator*=(mi &a, mi b) { return a = a * b; }
mi mypow(mi a, long long p) {
    assert(p >= 0);
    return p == 0 ? 1 : mypow(a * a, p / 2) * (p & 1 ? a : 1);
}
mi inv(mi a) {
    assert(a.v != 0);
    return mypow(a, MOD - 2);
}
mi operator/(mi a, mi b) { return a * inv(b); }
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
#pragma endregion

void test(){
    int n;
    cin >> n;
    set<int> S;
    for(int i=0; i<n; i++){
        int x; cin >> x;
        S.insert(x);
    }
    cout<<S.size()<<"\n";
    for(auto i: S) cout<<i<<" ";
    cout<<"\n";
}
 
int32_t main(){ 
    cin.tie(nullptr)->sync_with_stdio(false);
    // cout<<fixed<<setprecision(15);
    
    int tt = 1;
    // cin >> tt;
 
    for(int i=1; i<=tt; i++){
        // cout<<"Case "<<i<<": ";
        test();
    }
    
    return 0;
}

Submission Info

Submission Time
Task B - Compression
User Wevton
Language C++ 20 (gcc 12.2)
Score 150
Code Size 2168 Byte
Status AC
Exec Time 1 ms
Memory 3596 KiB

Compile Error

Main.cpp:4: warning: ignoring ‘#pragma region ’ [-Wunknown-pragmas]
    4 | #pragma region
      | 
Main.cpp:66: warning: ignoring ‘#pragma endregion ’ [-Wunknown-pragmas]
   66 | #pragma endregion
      | 

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 3
AC × 21
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3432 KiB
00_sample_01.txt AC 1 ms 3460 KiB
00_sample_02.txt AC 1 ms 3424 KiB
01_random_00.txt AC 1 ms 3472 KiB
01_random_01.txt AC 1 ms 3520 KiB
01_random_02.txt AC 1 ms 3584 KiB
01_random_03.txt AC 1 ms 3596 KiB
01_random_04.txt AC 1 ms 3460 KiB
01_random_05.txt AC 1 ms 3456 KiB
01_random_06.txt AC 1 ms 3500 KiB
01_random_07.txt AC 1 ms 3380 KiB
01_random_08.txt AC 1 ms 3480 KiB
01_random_09.txt AC 1 ms 3456 KiB
01_random_10.txt AC 1 ms 3424 KiB
01_random_11.txt AC 1 ms 3452 KiB
01_random_12.txt AC 1 ms 3440 KiB
01_random_13.txt AC 1 ms 3524 KiB
01_random_14.txt AC 1 ms 3424 KiB
01_random_15.txt AC 1 ms 3460 KiB
01_random_16.txt AC 1 ms 3548 KiB
01_random_17.txt AC 1 ms 3456 KiB