結果

問題 No.1692 Expectations
ユーザー sapphire__15sapphire__15
提出日時 2021-10-01 21:23:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 2,012 bytes
コンパイル時間 2,150 ms
コンパイル使用メモリ 139,840 KB
実行使用メモリ 13,000 KB
最終ジャッジ日時 2023-09-26 16:18:27
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 52 ms
4,376 KB
testcase_11 AC 51 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 11 ms
4,376 KB
testcase_15 AC 107 ms
8,892 KB
testcase_16 AC 10 ms
4,380 KB
testcase_17 AC 49 ms
6,588 KB
testcase_18 AC 19 ms
4,772 KB
testcase_19 AC 132 ms
9,624 KB
testcase_20 AC 66 ms
11,760 KB
testcase_21 AC 77 ms
13,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <random>
#include <complex>
#include <bitset>

#define rep(i, n, s) for (int i = (s); i < int(n); i++)
#define per(i, n, s) for (int i = (n - 1); i >= int(s); i--)
#define MM << " " <<
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x)

template <class T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T>
using MaxHeap = std::priority_queue<T>;

using ll = long long;
using Pii = std::pair<int, int>;
using Pll = std::pair<ll, ll>;
using Pdd = std::pair<double, double>;

template <class T>
bool chmin(T &a, const T b) {
    if (a > b) {
        a = b;
        return true;
    } else {
        return false;
    }
}

template <class T>
bool chmax(T &a, const T b) {
    if (a < b) {
        a = b;
        return true;
    } else {
        return false;
    }
}

template <class T>
void vdeb(const std::vector<T> &da) {
    auto n = da.size();
    for (size_t i = 0; i < n; i++) {
        if (i == n - 1)
            std::cout << da[i] << std::endl;
        else
            std::cout << da[i] << " ";
    }
}
template<class T>
void vdeb(const std::vector<std::vector<T>> &da) {
    auto n = da.size();
    for (size_t i = 0; i < n; i++) {
        std::cout << i << " : ";
        vdeb(da[i]);
    }
}

template <>
void vdeb(const std::vector<std::string> &da) {
    auto n = da.size();
    for (size_t i = 0; i < n; i++) { std::cout << da[i] << std::endl; }
}

using namespace std;

int main() {
    int n, m; cin >> n >> m;
    vector<int> da(n);
    rep(i,n,0) cin >> da[i];
    cout << set<int>(all(da)).size() MM (all_of(all(da), [&da](int x) {return x == da[0];}) && n == m ? 1 : 0) << endl;
}
0