提出 #75067677


ソースコード 拡げる

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
int main() {
  int N,M;
  cin >> N >> M;

  map<int,int> mp;
  REP(i,N){
    int F;
    cin >> F;
    mp[F]++;
  }

  if(mp.size() == N)cout << "Yes" << endl;
  else cout << "No" << endl;

  bool flag = true;
  REP(i,M) {
    if (mp[i+1] == 0)flag = false;
  }

  if(flag)cout << "Yes" << endl;
  else cout << "No" << endl;
}

提出情報

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

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:19:16: warning: comparison of integer expressions of different signedness: 'std::map<int, int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   19 |   if(mp.size() == N)cout << "Yes" << endl;
      |      ~~~~~~~~~~^~~~

ジャッジ結果

セット名 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 3564 KiB
00_sample_01.txt AC 1 ms 3488 KiB
00_sample_02.txt AC 1 ms 3512 KiB
00_sample_03.txt AC 1 ms 3564 KiB
01_random_1_00.txt AC 1 ms 3564 KiB
01_random_1_01.txt AC 1 ms 3528 KiB
01_random_1_02.txt AC 1 ms 3664 KiB
02_random_2_00.txt AC 1 ms 3564 KiB
02_random_2_01.txt AC 1 ms 3596 KiB
02_random_2_02.txt AC 1 ms 3640 KiB
03_random_3_00.txt AC 1 ms 3440 KiB
03_random_3_01.txt AC 1 ms 3440 KiB
03_random_3_02.txt AC 1 ms 3536 KiB
04_random_4_00.txt AC 1 ms 3544 KiB
04_random_4_01.txt AC 1 ms 3564 KiB
04_random_4_02.txt AC 1 ms 3484 KiB
04_random_4_03.txt AC 1 ms 3596 KiB
04_random_4_04.txt AC 1 ms 3640 KiB
04_random_4_05.txt AC 1 ms 3596 KiB