提出 #75105192


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define all(x) (x).begin(), (x).end()
#define pb push_back

template<class T> inline bool chmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template<class T> inline bool chmin(T& a, T b) { return a > b ? a = b, 1 : 0; }

const int MOD = 1e9 + 7;

void solve() {
    int n,m;cin>>n>>m;
    set<int> st;
    for(int i=0;i<n;i++){
        int x;cin>>x;
        st.insert(x);
    }
    cout<<(st.size()==n?"Yes\n":"No\n");
    cout<<(st.size()>=m?"Yes\n":"No\n");

    
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int tt = 1;
    //cin>>tt;
    while (tt--) {
        solve();
    }

    return 0;
}

提出情報

提出日時
問題 B - Mapping
ユーザ lavi3
言語 C++23 (GCC 15.2.0)
得点 200
コード長 838 Byte
結果 AC
実行時間 1 ms
メモリ 3676 KiB

コンパイルエラー

./Main.cpp: In function 'void solve()':
./Main.cpp:23:21: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   23 |     cout<<(st.size()==n?"Yes\n":"No\n");
      |            ~~~~~~~~~^~~
./Main.cpp:24:21: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   24 |     cout<<(st.size()>=m?"Yes\n":"No\n");
      |            ~~~~~~~~~^~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 4
AC × 19
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3548 KiB
00_sample_01.txt AC 1 ms 3636 KiB
00_sample_02.txt AC 1 ms 3676 KiB
00_sample_03.txt AC 1 ms 3484 KiB
01_random_1_00.txt AC 1 ms 3620 KiB
01_random_1_01.txt AC 1 ms 3480 KiB
01_random_1_02.txt AC 1 ms 3620 KiB
02_random_2_00.txt AC 1 ms 3604 KiB
02_random_2_01.txt AC 1 ms 3620 KiB
02_random_2_02.txt AC 1 ms 3572 KiB
03_random_3_00.txt AC 1 ms 3484 KiB
03_random_3_01.txt AC 1 ms 3584 KiB
03_random_3_02.txt AC 1 ms 3636 KiB
04_random_4_00.txt AC 1 ms 3484 KiB
04_random_4_01.txt AC 1 ms 3548 KiB
04_random_4_02.txt AC 1 ms 3620 KiB
04_random_4_03.txt AC 1 ms 3620 KiB
04_random_4_04.txt AC 1 ms 3604 KiB
04_random_4_05.txt AC 1 ms 3484 KiB