Submission #75974001


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
struct FastIO { FastIO(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(12); } } fastio;

/*--------------------------------------------------*/
using i64 = int64_t;
using ll = int64_t;
using ld = long double;
template<typename T> using vc = vector<T>;
template<typename T> using vv = vc<vc<T>>;
template<typename T> using vvv = vc<vv<T>>;
template<typename T> using vvvv = vc<vvv<T>>;
template<typename T> using P = pair<T,T>;
template<typename T> using pq_ = priority_queue<T>;
template<typename T> using pq_g = priority_queue<T, vc<T>, greater<T>>;
using vi = vc<int>; using vvi = vc<vi>;
using Pi = P<int>;
/*--------------------------------------------------*/
#define pb push_back
#define em emplace
#define eb emplace_back
#define pob pop_back
#define el '\n'
#define YES cout<<"Yes"<<el
#define NO cout<<"No"<<el
#define NG cout<<-1<<el
#define ansNG( ans, ng, isEl ) if( ans == ng ){ cout<<-1; }else{ cout<<ans; } if( isEl ){ cout<<el; }else{ cout<<" "; }
#define all(a)  a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n)     for(int i = 0; i < (n); ++i)
#define rep3(i,l,r)  for(int i = (l); i < (r); ++i)
#define rrep(i,n)    for(int i = (n)-1; i >= 0; --i)
#define rrep3(i,l,r) for(int i = (r)-1; i >= (l); --i)
#define next_p(x) next_permutation( x )
/*--------------------------------------------------*/
template<typename T> inline bool chmin( T &a, T b ){ if( a > b ){ a = b; return true; } return false; }
template<typename T> inline bool chmax( T &a, T b ){ if( a < b ){ a = b; return true; } return false; }
template<typename T> istream& operator>>( istream& i, vc<T>& v ) { rep( j, size(v) ) i >> v[j]; return i; }
#define clog_bit( a, bit ) clog<< bitset<bit>(a) <<el;
#define clog_vc( v, e )  for( auto a1: v ){ if( a1 == e ){ clog<<"- "; }else{ clog<<a1<<" "; } } clog<<el;
#define clog_vv( v, e )  for( auto a2: v ){ clog_vc( a2, e ) };
#define clog_vvv( v, e ) for( auto a3: v ){ clog_vv( a3, e ); clog<<el; };
/*--------------------------------------------------*/
int INF    = 1e9+10;
int INF2   = 2e9+10;
ll INFLL = (ll)2e18+10;
const int m = 998244353; //m=1e9+7;
/*--------------------------------------------------*/

int main(){
    int N,M; cin>>N>>M;
    set<int>st;
    bool flg = true;
    rep(i,N){
        int a; cin>>a;
        if( !st.insert(a).second ){ flg = false; }
    }
    flg?YES:NO;
    st.size() == M?YES:NO;
}

Submission Info

Submission Time
Task C - Mapping
User castle_
Language C++23 (Clang 21.1.0)
Score 200
Code Size 2521 Byte
Status AC
Exec Time 1 ms
Memory 2948 KiB

Compile Error

./Main.cpp:59:15: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
   59 |     st.size() == M?YES:NO;
      |     ~~~~~~~~~ ^  ~
./Main.cpp:47:11: warning: unused variable 'm' [-Wunused-const-variable]
   47 | const int m = 998244353; //m=1e9+7;
      |           ^
2 warnings generated.

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 19
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_1_00.txt, 01_random_1_01.txt, 01_random_1_02.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 03_random_3_00.txt, 03_random_3_01.txt, 03_random_3_02.txt, 04_random_4_00.txt, 04_random_4_01.txt, 04_random_4_02.txt, 04_random_4_03.txt, 04_random_4_04.txt, 04_random_4_05.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 2936 KiB
00_sample_01.txt AC 1 ms 2912 KiB
00_sample_02.txt AC 1 ms 2948 KiB
00_sample_03.txt AC 1 ms 2892 KiB
01_random_1_00.txt AC 1 ms 2688 KiB
01_random_1_01.txt AC 1 ms 2716 KiB
01_random_1_02.txt AC 1 ms 2924 KiB
02_random_2_00.txt AC 1 ms 2716 KiB
02_random_2_01.txt AC 1 ms 2920 KiB
02_random_2_02.txt AC 1 ms 2920 KiB
03_random_3_00.txt AC 1 ms 2932 KiB
03_random_3_01.txt AC 1 ms 2912 KiB
03_random_3_02.txt AC 1 ms 2948 KiB
04_random_4_00.txt AC 1 ms 2880 KiB
04_random_4_01.txt AC 1 ms 2924 KiB
04_random_4_02.txt AC 1 ms 2716 KiB
04_random_4_03.txt AC 1 ms 2772 KiB
04_random_4_04.txt AC 1 ms 2948 KiB
04_random_4_05.txt AC 1 ms 2920 KiB