Submission #25017369
Source Code Expand
#include <bits/stdc++.h>
#define requires(...) typename std::enable_if<__VA_ARGS__::value, int>::type = 0
using namespace std;
template<class U, class V>
istream &operator>>(istream &is, pair<U, V> &p) { return is >> p.first >> p.second; }
template<class U, class V>
ostream &operator<<(ostream &os, const pair<U, V> &p) {
return os << "(" << p.first << ", " << p.second << ")";
}
template<class Istream, class Container, requires(is_same<Istream, istream>)>
Istream &operator>>(Istream &is, Container &container) {
for (auto &value : container) is >> value;
return is;
}
template<class Ostream, class Container, requires(is_same<Ostream, ostream>)>
Ostream &operator<<(Ostream &os, const Container &container) {
auto _begin = begin(container), _end = end(container);
for (auto it = _begin; it != _end;)
os << "{ "[it != _begin] << *it << ",}"[++it == _end];
return os;
}
namespace io {
template <class ...As> struct last {};
template <class ...As> using last_t = typename last<As...>::type;
template <class A> struct last<A> { using type = A; };
template <class A, class ...As> struct last<A, As...> {
using type = typename last<As...>::type;
};
template <class Z>
Z read(Z &) { Z z; cin >> z; return z; }
template <class A, class ...As>
last_t<As...> read(A &a, As &...as) { return cin >> a, read(as...); }
void log_rest() {}
template <class A, class ...As>
void log_rest(const A &a, const As &...as) { cerr << ", " << a; log_rest(as...); }
template<class A, class ...As>
void log(const string &pref, const A &a, const As &...as)
{ cerr << pref << a, log_rest(as...); }
} // namespace io
#define A(xs) begin(xs), end(xs)
#define B(...) [&](auto &&lhs, auto &&rhs) { \
return __VA_ARGS__; \
}
#define U(...) [&](auto &&lhs, auto &&rhs) { \
auto predicate = [&](auto &&x) { \
return __VA_ARGS__; \
}; \
return predicate(lhs) < predicate(rhs); \
}
#define X first
#define Y second
#define PB push_back
#define EB emplace_back
#define R(...) __VA_ARGS__ = io::read(__VA_ARGS__)
#define RC(name, ...) name(__VA_ARGS__); cin >> name
#define G3(_1, _2, _3, FUNC, ...) FUNC
#define F1(i, n) for (typename remove_cv<decltype(n)>::type i = {}; i != n; ++i)
#define F2(i, a, b) for (typename common_type<decltype(a), decltype(b)>::type \
down = a > b, i = a - down; i + down != b; \
down ? --i : ++i)
#define F(...) G3(__VA_ARGS__, F2, F1)(__VA_ARGS__)
#ifdef DEBUG
int recursion_depth = 0;
# define D for (bool _flag = true; _flag; _flag = !_flag)
# define L(...) (++recursion_depth, \
io::log(string(recursion_depth - 1, '\t') + \
string(__func__) + ":" + to_string(__LINE__) + \
" \t( "#__VA_ARGS__" ) := ", \
__VA_ARGS__), \
--recursion_depth, cerr << "\n")
# define dbg(...) [&](const string &func) -> auto && { \
++recursion_depth; \
auto&& value = __VA_ARGS__; \
--recursion_depth; \
cerr << string(recursion_depth, '\t') \
<< func << ":" << __LINE__ \
<< " \t"#__VA_ARGS__" = " << value << endl; \
return forward<decltype(value)>(value); \
}(__func__)
# define TEST(name) \
void test_##name(); \
int test_result_##name = [] { \
D test_##name(); \
D cerr << #name" tests have passed!" \
<< endl; \
return 0; \
}(); \
void test_##name()
#else
# define L(...) while (false) cerr
# define D while (false)
# define dbg(...) (__VA_ARGS__)
# define TEST(name) void test_##name()
#endif
template<class T>
T make_vec(T default_value) { return default_value; }
template<class T, class Arg, class ...Args>
auto make_vec(T default_value, Arg size, Args ...rest)
-> vector<decltype(make_vec(default_value, rest...))> {
auto level = make_vec(default_value, rest...);
return vector<decltype(level)>(size, level);
}
template<class Xs> int len(const Xs &xs) { return static_cast<int>(xs.size()); }
using i64 = int64_t;
using f80 = long double;
using Str = string;
template<class T = int> using Vec = vector<T>;
template<class K = int, class H = hash<K>> using US = unordered_set<K, H>;
template<class K, class V, class H = hash<K>> using UM = unordered_map<K, V, H>;
template<class U = int, class V = U> using P = pair<U, V>;
using G = Vec<Vec<int>>;
template <class T, class P>
auto bin_search(T l, T r, P p) -> T {
for (T m; m = (l + r) / 2, m != l && m != r; (p(m) ? l : r) = m);
return l;
}
i64 mod_ = 1000000007;
i64 bin_pow(i64 val, i64 pow)
{
if (pow == 0)
return 1;
i64 x = bin_pow(val * val % mod_, pow / 2);
if (pow & 1) x *= val;
return x % mod_;
}
Vec<P<int>> dxy = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
int main() {
int R(n);
if (n < 126)
{
cout << 4;
}
else if (n < 212)
{
cout << 6;
}
else
cout << 8;
return 0;
}
namespace {
auto fast_io = [] {
#ifndef DEBUG
# ifndef INTERACTIVE
ios::sync_with_stdio(false);
cin.tie(nullptr);
# endif // INTERACTIVE
# ifdef FILES
freopen(FILES".in", "r", stdin);
freopen(FILES".out", "w", stdout);
# endif // FILES
#endif // DEBUG
cout << setprecision(20) << fixed;
cerr << boolalpha << setprecision(4) << fixed;
return 0;
}();
} // namespace
Submission Info
| Submission Time |
|
| Task |
A - New Generation ABC |
| User |
viskonsin |
| Language |
C++ (GCC 9.2.1) |
| Score |
100 |
| Code Size |
6046 Byte |
| Status |
AC |
| Exec Time |
6 ms |
| Memory |
3656 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
100 / 100 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
example_00.txt, example_01.txt, example_02.txt |
| All |
example_00.txt, example_01.txt, example_02.txt, test_0.txt, test_1.txt, test_2.txt, test_3.txt, test_4.txt, test_5.txt |
| Case Name |
Status |
Exec Time |
Memory |
| example_00.txt |
AC |
6 ms |
3452 KiB |
| example_01.txt |
AC |
2 ms |
3568 KiB |
| example_02.txt |
AC |
2 ms |
3504 KiB |
| test_0.txt |
AC |
2 ms |
3508 KiB |
| test_1.txt |
AC |
2 ms |
3616 KiB |
| test_2.txt |
AC |
1 ms |
3576 KiB |
| test_3.txt |
AC |
3 ms |
3568 KiB |
| test_4.txt |
AC |
2 ms |
3656 KiB |
| test_5.txt |
AC |
2 ms |
3652 KiB |