Submission #75060856


Source Code Expand

//競プロ C++テンプレ
#include <bits/stdc++.h>
using namespace std;


int main() {
    int N,K;
    cin >> N >> K;
    int sum = 1;
    
    vector<int> vec(N);
    for(int i = 0; i < N ; i++){
      cin >> vec.at(i);
    }
    
    sort(vec.begin(),vec.end());
    bool isok = true;
    for(int i = 1; i < N; i++){
      if(vec.at(i-1) == vec.at(i)){
         isok = false;
      }else{
        sum++;
      }
    }
    if(isok) cout << "Yes" << endl;
    else cout << "No" << endl;
    
     if(N < K){
       cout << "No";
       return 0;
     }else if(sum == K){
       cout << "Yes";
     }else{
       cout << "No";
     }
     
}

Submission Info

Submission Time
Task B - Mapping
User gumi11ta
Language C++23 (GCC 15.2.0)
Score 200
Code Size 683 Byte
Status AC
Exec Time 1 ms
Memory 3624 KiB

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 3432 KiB
00_sample_01.txt AC 1 ms 3576 KiB
00_sample_02.txt AC 1 ms 3624 KiB
00_sample_03.txt AC 1 ms 3560 KiB
01_random_1_00.txt AC 1 ms 3624 KiB
01_random_1_01.txt AC 1 ms 3472 KiB
01_random_1_02.txt AC 1 ms 3564 KiB
02_random_2_00.txt AC 1 ms 3576 KiB
02_random_2_01.txt AC 1 ms 3532 KiB
02_random_2_02.txt AC 1 ms 3572 KiB
03_random_3_00.txt AC 1 ms 3472 KiB
03_random_3_01.txt AC 1 ms 3432 KiB
03_random_3_02.txt AC 1 ms 3600 KiB
04_random_4_00.txt AC 1 ms 3560 KiB
04_random_4_01.txt AC 1 ms 3624 KiB
04_random_4_02.txt AC 1 ms 3452 KiB
04_random_4_03.txt AC 1 ms 3576 KiB
04_random_4_04.txt AC 1 ms 3624 KiB
04_random_4_05.txt AC 1 ms 3568 KiB