cp-documentation

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub zawa-tin/cp-documentation

:heavy_check_mark: Test/AOJ/ITP1_2_C.test.cpp

Depends on

Code

#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/2/ITP1_2_C"

#include "../../Src/Template/TypeAlias.hpp"
#include "../../Src/Template/ArrayIO.hpp"

#include <iostream>
#include <array>
#include <utility>

using namespace zawa;

int main() {
    std::array<u32, 3> a; std::cin >> a;
    if (a[1] > a[2]) std::swap(a[1], a[2]);
    if (a[0] > a[1]) std::swap(a[0], a[1]);
    if (a[1] > a[2]) std::swap(a[1], a[2]);
    std::cout << a << std::endl;
}
#line 1 "Test/AOJ/ITP1_2_C.test.cpp"
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/2/ITP1_2_C"

#line 2 "Src/Template/TypeAlias.hpp"

#include <cstdint>
#include <cstddef>

namespace zawa {

using i16 = std::int16_t;
using i32 = std::int32_t;
using i64 = std::int64_t;
using i128 = __int128_t;

using u8 = std::uint8_t;
using u16 = std::uint16_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;

using usize = std::size_t;

} // namespace zawa
#line 2 "Src/Template/ArrayIO.hpp"

#line 4 "Src/Template/ArrayIO.hpp"

#include <iostream>
#include <array>

namespace zawa {

template <class T, usize N>
std::istream &operator>>(std::istream& is, std::array<T, N>& A) {
    for (T& a : A) {
        is >> a;
    }
    return is;
}

template <class T, usize N>
std::ostream &operator<<(std::ostream& os, const std::array<T, N>& A) {
    for (u32 i{} ; i < A.size() ; i++) {
        os << A[i] << (i + 1 == A.size() ? "" : " ");
    }
    return os;
}

} // namespace zawa
#line 5 "Test/AOJ/ITP1_2_C.test.cpp"

#line 8 "Test/AOJ/ITP1_2_C.test.cpp"
#include <utility>

using namespace zawa;

int main() {
    std::array<u32, 3> a; std::cin >> a;
    if (a[1] > a[2]) std::swap(a[1], a[2]);
    if (a[0] > a[1]) std::swap(a[0], a[1]);
    if (a[1] > a[2]) std::swap(a[1], a[2]);
    std::cout << a << std::endl;
}
Back to top page