Submission #75041204
Source Code Expand
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, k, n) for (ll i = (ll)(k); i < (ll)(n); i++)
#define repM(i, k, n) for (ll i = (ll)(k); i > (ll)(n); i--)
#define all(v) v.begin(), v.end()
#define sort_rev(v) sort((v).begin(), (v).end(), greater<>())
#define lmax(a, b) max((ll)a, (ll)b)
#define lmin(a, b) min((ll)a, (ll)b)
#define lclamp(x, a, b) clamp((ll)x, (ll)a, (ll)b)
using ll = long long;
const ll mod9 = 998244353;
const ll mod1 = 1000000007;
const ll INF = 9223372036854775807;
vector<ll> dx = {1, -1, 0, 0};
vector<ll> dy = {0, 0, 1, -1};
vector<ll> dx8 = {-1, -1, -1, 0, 1, 1, 1, 0};
vector<ll> dy8 = {-1, 0, 1, 1, 1, 0, -1, -1};
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define mi1 cout << -1 << endl
void YesNo(bool b){
if(b){
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
ofstream outputfile("test.txt");
ll GCD(ll x, ll y){
long long a = x, b = y;
while(a * b != 0){
if(a >= b){
a %= b;
} else {
b %= a;
}
}
return a+b;
}
ll powll(ll a, ll n){
ll ans = 1;
rep(i, n){
ans *= a;
}
return ans;
}
long long modpow(long long n, long long k, long long mod){
long long res = 1;
while(k){
if(k & 1){
res = (res * n) % mod;
}
n = (n * n) % mod;
k >>= 1;
}
return res;
}
struct Eratosthenes {
// テーブル
vector<bool> isprime;
// 整数 i を割り切る最小の素数
vector<ll> minfactor;
// コンストラクタで篩を回す
Eratosthenes(ll N) : isprime(N+1, true),
minfactor(N+1, -1) {
// 1 は予めふるい落としておく
isprime[1] = false;
minfactor[1] = 1;
// 篩
for (ll p = 2; p <= N; ++p) {
// すでに合成数であるものはスキップする
if (!isprime[p]) continue;
// p についての情報更新
minfactor[p] = p;
// p 以外の p の倍数から素数ラベルを剥奪
for (ll q = p * 2; q <= N; q += p) {
// q は合成数なのでふるい落とす
isprime[q] = false;
// q は p で割り切れる旨を更新
if (minfactor[q] == -1) minfactor[q] = p;
}
}
}
// 高速素因数分解
// pair (素因子, 指数) の vector を返す
vector<pair<ll ,ll>> factorize(ll n) {
vector<pair<ll,ll>> res;
while (n > 1) {
ll p = minfactor[n];
ll exp = 0;
// n で割り切れる限り割る
while (minfactor[n] == p) {
n /= p;
++exp;
}
res.emplace_back(p, exp);
}
return res;
}
};
ll vec_sum(vector<ll> A){
ll sum = 0;
for(ll a: A){
sum += a;
}
return sum;
}
vector<ll> isp(10e6, true);
void sieve() {
isp[0] = false;
isp[1] = false;
for (ll i=2; pow(i,2)<=10e6; i++) {
if (isp[i]) for(ll j=2; i*j<=10e6; j++) isp[i*j] = false;
}
}
void vec_cout(vector<ll> A){
for(ll a: A){
cout << a << endl;
}
}
void vec_c_cout(vector<char> A){
for(char a: A){
cout << a << endl;
outputfile << a << endl;
}
}
bool grid_in(ll x, ll y, ll weigth, ll heigth){
if(0 <= x && x < weigth && 0 <= y && y < heigth) return true;
return false;
}
vector<vector<ll>> grid_ll_rotate(vector<vector<ll>> A){
vector<vector<ll>> copy = A;
ll N = A.size();
rep(i, N){
rep(k, N){
copy[i][k] = A[k][N-1-i];
}
}
return copy;
}
void grid_ll_cout(vector<vector<ll>> A){
for(vector<ll> v: A){
for(ll a: v){
cout << a << " ";
}
cout << endl;
}
}
vector<string> grid_st_rotate(vector<string> A){
vector<string> copy = A;
ll N = A.size();
rep(i, N){
rep(k, N){
copy[i][k] = A[k][N-1-i];
}
}
return copy;
}
void grid_st_cout(vector<string> A){
for(string v: A){
cout << v << endl;
}
}
void write(string S){
cout << S << endl;
outputfile << S << endl;
}
void cout_fixed(double d){
cout << fixed << setprecision(15) << d;
}
class UnionFind{
public:
ll par[200009];
ll siz[200009];
// N頂点のUnion-Findを作成
void init(ll N){
rep2(i, 1, N+1) par[i] = -1; // 最初は親がない
rep2(i, 1, N+1) siz[i] = 1; // 最初はグループの頂点数が1
}
// 頂点xの根を返す関数
ll root(ll x){
while(true){
if(par[x] == -1) break;
x = par[x];
}
return x;
}
// 要素uとvを統合する関数
void unite(ll u, ll v){
ll RootU = root(u);
ll RootV = root(v);
if(RootU == RootV) return; // uとvが同じグループの時は処理を行わない
if(siz[RootU] < siz[RootV]){
par[RootU] = RootV;
siz[RootV] = siz[RootU] + siz[RootV];
} else {
par[RootV] = RootU;
siz[RootU] = siz[RootU] + siz[RootV];
}
}
// 要素uとvが同一のグループかどうかを返す関数
bool same(ll u, ll v){
if(root(u) == root(v)) return true;
return false;
}
};
// (a/b)%mod -> a*modinv(b, mod)
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, v);
}
u %= m;
if (u < 0) u += m;
return u;
}
# include <math.h>
bool IsPrime(ll num)
{
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
double sqrtNum = sqrt(num);
for (ll i = 3; i <= sqrtNum; i += 2)
{
if (num % i == 0)
{
// 素数ではない
return false;
}
}
// 素数である
return true;
}
int main(){
ll N, M;
cin >> N >> M;
set<ll> S;
rep(i, N){
ll a;
cin >> a;
S.insert(a);
}
YesNo(S.size() == N);
YesNo(S.size() == M);
}
Submission Info
Submission Time
2026-04-18 21:02:25+0900
Task
B - Mapping
User
mahi_mahi_
Language
C++23 (GCC 15.2.0)
Score
200
Code Size
6264 Byte
Status
AC
Exec Time
33 ms
Memory
81556 KiB
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:290:18: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
290 | YesNo(S.size() == N);
| ~~~~~~~~~^~~~
./Main.cpp:291:18: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
291 | YesNo(S.size() == M);
| ~~~~~~~~~^~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
200 / 200
Status
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
33 ms
81520 KiB
00_sample_01.txt
AC
30 ms
81420 KiB
00_sample_02.txt
AC
30 ms
81420 KiB
00_sample_03.txt
AC
30 ms
81500 KiB
01_random_1_00.txt
AC
30 ms
81500 KiB
01_random_1_01.txt
AC
30 ms
81496 KiB
01_random_1_02.txt
AC
30 ms
81556 KiB
02_random_2_00.txt
AC
30 ms
81500 KiB
02_random_2_01.txt
AC
30 ms
81488 KiB
02_random_2_02.txt
AC
29 ms
81520 KiB
03_random_3_00.txt
AC
29 ms
81488 KiB
03_random_3_01.txt
AC
29 ms
81556 KiB
03_random_3_02.txt
AC
30 ms
81496 KiB
04_random_4_00.txt
AC
30 ms
81504 KiB
04_random_4_01.txt
AC
30 ms
81512 KiB
04_random_4_02.txt
AC
30 ms
81520 KiB
04_random_4_03.txt
AC
29 ms
81536 KiB
04_random_4_04.txt
AC
30 ms
81496 KiB
04_random_4_05.txt
AC
29 ms
81520 KiB