Submission #17615332


Source Code Expand

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.
 
#ifdef local
#include <bits/extc++.h>
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(args...) qqbx(#args, args)
using ost = std::ostream;
#define DESTL(STL, BEG, END, OUT) \
    template <typename ...T> ost& operator<<(ost &O, std::STL<T...> v) { int f=0; for(auto x: v) O << (f++ ? ", " : BEG) << OUT; return O << END; }
DESTL(deque, "[", "]", x); DESTL(vector, "[", "]", x);
DESTL(set, "{", "}", x); DESTL(multiset, "{", "}", x); DESTL(unordered_set, "{", "}", x);
DESTL(map , "{", "}", x.first << ":" << x.second); DESTL(unordered_map , "{", "}", x.first << ":" << x.second);
template <typename U, typename V> ost& operator<<(ost &O, std::pair<U,V> p) { return O << '(' << p.first << ',' << p.second << ')'; }
template <typename T, size_t N> ost& operator<<(ost &O, std::array<T,N> a) { int f=0; for(T x: a) O << (f++ ? ", " : "[") << x; return O << "]"; }
template <typename T, size_t ...I> ost& prtuple(ost &O, T t, std::index_sequence<I...>) { return (..., (O << (I ? ", " : "(") << std::get<I>(t))), O << ")"; }
template <typename ...T> ost& operator<<(ost &O, std::tuple<T...> t) { return prtuple(O, t, std::make_index_sequence<sizeof...(T)>()); }
template <typename ...T> void qqbx(const char *s, T ...args) {
    int cnt = sizeof...(T);
    (std::cerr << "\033[1;32m(" << s << ") = (" , ... , (std::cerr << args << (--cnt ? ", " : ")\033[0m\n")));
}
#else
#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) int(lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)
 
using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 2000025, INF = 1e18, MOD = 1000000007, K = 19, inf = 1e7;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    map<ll,pll> mp;
    int a = 1;
    for(ll p = 3; p < INF; p *= 3) {
        int b = 1;
        for(ll q = 5; q < INF; q *= 5) {
            mp[p+q] = {a, b};
            ++b;
        }
        ++a;
    }
    ll n;
    cin >> n;
    if(mp.count(n)) cout << mp[n].first << ' ' << mp[n].second << '\n';
    else cout << -1 << '\n';
}

Submission Info

Submission Time
Task A - 106
User bingxuan9112
Language C++ (GCC 9.2.1)
Score 300
Code Size 3421 Byte
Status AC
Exec Time 8 ms
Memory 3676 KiB

Compile Error

./Main.cpp:9:1: warning: multi-line comment [-Wcomment]
    9 | //  \###################\
      | ^
./Main.cpp:35: warning: ignoring #pragma loop_opt  [-Wunknown-pragmas]
   35 | #pragma loop_opt(on)
      | 
./Main.cpp: In function ‘constexpr ll cdiv(ll, ll)’:
./Main.cpp:60:56: warning: suggest parentheses around comparison in operand of ‘^’ [-Wparentheses]
   60 | constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
      |                                                       ~^~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00, 00_sample_01, 00_sample_02
All 00_sample_00, 00_sample_01, 00_sample_02, 01_test_00, 01_test_01, 01_test_02, 01_test_03, 01_test_04, 01_test_05, 01_test_06, 01_test_07, 01_test_08, 01_test_09, 01_test_10, 01_test_11, 01_test_12, 01_test_13, 01_test_14, 01_test_15, 01_test_16, 01_test_17, 02_beet_killer
Case Name Status Exec Time Memory
00_sample_00 AC 8 ms 3648 KiB
00_sample_01 AC 2 ms 3544 KiB
00_sample_02 AC 2 ms 3544 KiB
01_test_00 AC 3 ms 3648 KiB
01_test_01 AC 3 ms 3644 KiB
01_test_02 AC 3 ms 3592 KiB
01_test_03 AC 2 ms 3596 KiB
01_test_04 AC 2 ms 3648 KiB
01_test_05 AC 2 ms 3656 KiB
01_test_06 AC 5 ms 3528 KiB
01_test_07 AC 2 ms 3544 KiB
01_test_08 AC 2 ms 3592 KiB
01_test_09 AC 3 ms 3520 KiB
01_test_10 AC 2 ms 3668 KiB
01_test_11 AC 2 ms 3624 KiB
01_test_12 AC 2 ms 3516 KiB
01_test_13 AC 3 ms 3592 KiB
01_test_14 AC 2 ms 3492 KiB
01_test_15 AC 2 ms 3644 KiB
01_test_16 AC 4 ms 3584 KiB
01_test_17 AC 2 ms 3676 KiB
02_beet_killer AC 3 ms 3492 KiB