提出 #75049419
ソースコード 拡げる
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <tuple>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstdint>
#include <cmath>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
struct Init { Init() { ios::sync_with_stdio(0); cin.tie(0); } }init;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vl = vector<ll>;
using v2 = vector<vector<ll>>;
template<typename T,typename U>
istream &operator>>(istream &is,pair<T,U> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
for (T &in : v)
is >> in;
return is;
}
#define rep(i, x, limit) for (int i = (int)x; i < (int)limit; i++)
#define REP(i, x, limit) for (int i = (int)x; i <= (int)limit; i++)
#define foreach(i,vec) for (auto i = begin(vec);i != end(vec);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define el '\n'
#define spa " "
#define Yes cout << "Yes" << el
#define No cout << "No" << el
#define YES cout << "YES" << el
#define NO cout << "NO" << el
#define eps (1e-10)
#define Equals(a,b) (fabs((a) - (b)) < eps )
#define debug(x) cerr << #x << " = " << x << el
constexpr ll INF = 1e18;
int main()
{
int n,m;
cin >> n >> m;
vl f(n);
cin >> f;
set<int> x;
for(auto i:f) {
x.insert(i);
}
if(x.size() == n) Yes; else No;
vector<bool> al(120);
for(auto i:f) {
al[i - 1] = true;
}
bool t = true;
for (int i = 0; i < m; i++) {
if(!al[i]) t = false;
}
if(t) Yes; else No;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Mapping |
| ユーザ | Quuri |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 1817 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3624 KiB |
コンパイルエラー
./Main.cpp: In function 'int main()':
./Main.cpp:63:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
63 | if(x.size() == n) Yes; else No;
| ~~~~~~~~~^~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 | 3520 KiB |
| 00_sample_01.txt | AC | 1 ms | 3624 KiB |
| 00_sample_02.txt | AC | 1 ms | 3524 KiB |
| 00_sample_03.txt | AC | 1 ms | 3588 KiB |
| 01_random_1_00.txt | AC | 1 ms | 3564 KiB |
| 01_random_1_01.txt | AC | 1 ms | 3584 KiB |
| 01_random_1_02.txt | AC | 1 ms | 3536 KiB |
| 02_random_2_00.txt | AC | 1 ms | 3540 KiB |
| 02_random_2_01.txt | AC | 1 ms | 3588 KiB |
| 02_random_2_02.txt | AC | 1 ms | 3504 KiB |
| 03_random_3_00.txt | AC | 1 ms | 3408 KiB |
| 03_random_3_01.txt | AC | 1 ms | 3476 KiB |
| 03_random_3_02.txt | AC | 1 ms | 3560 KiB |
| 04_random_4_00.txt | AC | 1 ms | 3564 KiB |
| 04_random_4_01.txt | AC | 1 ms | 3540 KiB |
| 04_random_4_02.txt | AC | 1 ms | 3420 KiB |
| 04_random_4_03.txt | AC | 1 ms | 3540 KiB |
| 04_random_4_04.txt | AC | 1 ms | 3408 KiB |
| 04_random_4_05.txt | AC | 1 ms | 3596 KiB |