提出 #75065733
ソースコード 拡げる
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <bitset>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <unordered_map>
#include <map>
#include <queue>
#include <unordered_set>
#include <cassert>
#include <list>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numbers>
#include <iostream>
#include <string>
#include <random>
using namespace std;
#define fori(n)for (int i = 0; i < n; i++)
#define fo(n)for (int i = 0; i < n; i++)
#define fori1(n)for (ll i = 1; i < n + 1; i++)
#define revi1(n)for (int i = n; i >=0; i--)
#define forj(n)for (ll j = 0; j < (n); j++)
#define rep(i, n)for (ll i = 0; i < (n); i++)
#define repj(i, j, n)for (ll i = j; i < (n); i++)
#define forj1(n)for (ll j = 1; j < n+1; j++)
#define revj1(n)for (ll j = n; j >=0; j--)
#define revi(n)for (int i = n-1; i >= 0; i--)
#define ll long long
#define ull unsigned ll
#define MAXN (2147483647)
#define MINN (-2147483648)
#define ffast_io ios::sync_with_stdio(false);\
cout.tie(nullptr); cin.tie(nullptr)
string svo(bool fl) {
if (fl)
return "YES";
return "NO";
}
vector<vector<ll>> multi(vector<vector<ll>> a, vector<vector<ll>> b) {
vector<vector<ll>> res(a.size(), vector<ll>(b[0].size(), 0));
fori(a.size()) {
forj(b[0].size()) {
ll temp = 0;
rep(k, b.size())temp = (temp + (a[i][k] * b[k][j]) % 1000000007l) % 1000000007;
res[i][j] = temp;
}
}
return res;
}
vector<vector<ll>> pow(const vector<vector<ll>> &mat, int powred) {
if (powred == 1) return mat;
if (powred % 2 == 1) return multi(pow(mat, powred - 1), mat);
vector<vector<ll>> temp = pow(multi(mat, mat), powred / 2);
return temp;
}
ll pow1(ll mat, ll powred) {
if (powred == 1L) return mat;
if ((powred % 2LL) == 1LL) return (pow1(mat, powred - 1LL) * mat) % 10LL;
auto temp = pow1((mat * mat) % 10LL, powred / 2LL);
return temp;
}
template<typename T>
void debug(const std::vector<T> &ttt, std::ostream &out = std::cout) {
int temp = 1;
for (auto it = ttt.begin(); it != ttt.end(); ++it, temp++) out << *it << ' ';
out << std::endl;
}
template<typename T>
void debug(const std::vector<vector<T>> &ttt, std::ostream &out = std::cout) {
for (int it = 0; it != ttt.size(); ++it) debug(ttt[it]);
}
template<typename T>
void debug(set<T> ttt, std::ostream &out = std::cout) {
for (auto t: ttt) out << t << " ";
out << endl;
}
void debug(bool k, std::ostream &out = std::cout) { if (k) out << "yes"; else out << "no"; }
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,tune=native")
std::vector<int> prefix_function(const std::string &s) {
int n = s.size();
std::vector<int> pi(n);
for (int i = 1; i < n; ++i) {
int j = pi[i - 1];
while (j > 0 && s[i] != s[j])
j = pi[j - 1];
if (s[i] == s[j]) ++j;
pi[i] = j;
}
return pi;
}
void solve() {
int n, m;
cin >> n >> m;
set<int> dd;
vector<int> d(m, 0);
fori(n ) {
int a;
cin >> a;
a--;
dd.insert(a);
d[a]++;
}
if (dd.size() == n) {
cout << "Yes" << "\n";
} else {
cout << "No" << "\n";
}
bool flag = true;
fori(m) {
if (d[i] == 0) {
flag = false;
}
}
if (flag) {
cout << "Yes" << "\n";
} else {
cout << "No" << "\n";
}
}
int main() {
ffast_io;
solve();
return 0;
}
提出情報
提出日時
2026-04-18 21:32:34+0900
問題
B - Mapping
ユーザ
kashapoV
言語
C++23 (GCC 15.2.0)
得点
200
コード長
3768 Byte
結果
AC
実行時間
1 ms
メモリ
3676 KiB
コンパイルエラー
./Main.cpp: In function 'std::vector<std::vector<long long int> > multi(std::vector<std::vector<long long int> >, std::vector<std::vector<long long int> >)':
./Main.cpp:26:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | #define fori(n)for (int i = 0; i < n; i++)
| ^
./Main.cpp:51:5: note: in expansion of macro 'fori'
51 | fori(a.size()) {
| ^~~~
./Main.cpp:30:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | #define forj(n)for (ll j = 0; j < (n); j++)
| ~~^~~~~
./Main.cpp:52:9: note: in expansion of macro 'forj'
52 | forj(b[0].size()) {
| ^~~~
./Main.cpp:31:35: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
31 | #define rep(i, n)for (ll i = 0; i < (n); i++)
| ^
./Main.cpp:54:13: note: in expansion of macro 'rep'
54 | rep(k, b.size())temp = (temp + (a[i][k] * b[k][j]) % 1000000007l) % 1000000007;
| ^~~
./Main.cpp: In function 'void solve()':
./Main.cpp:126:19: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
126 | if (dd.size() == n) {
| ~~~~~~~~~~^~~~
ジャッジ結果
セット名
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
3548 KiB
00_sample_01.txt
AC
1 ms
3492 KiB
00_sample_02.txt
AC
1 ms
3576 KiB
00_sample_03.txt
AC
1 ms
3604 KiB
01_random_1_00.txt
AC
1 ms
3652 KiB
01_random_1_01.txt
AC
1 ms
3632 KiB
01_random_1_02.txt
AC
1 ms
3592 KiB
02_random_2_00.txt
AC
1 ms
3600 KiB
02_random_2_01.txt
AC
1 ms
3652 KiB
02_random_2_02.txt
AC
1 ms
3456 KiB
03_random_3_00.txt
AC
1 ms
3576 KiB
03_random_3_01.txt
AC
1 ms
3600 KiB
03_random_3_02.txt
AC
1 ms
3652 KiB
04_random_4_00.txt
AC
1 ms
3456 KiB
04_random_4_01.txt
AC
1 ms
3676 KiB
04_random_4_02.txt
AC
1 ms
3676 KiB
04_random_4_03.txt
AC
1 ms
3576 KiB
04_random_4_04.txt
AC
1 ms
3480 KiB
04_random_4_05.txt
AC
1 ms
3632 KiB