結果

問題 No.2007 Arbitrary Mod (Easy)
ユーザー srtubakisrtubaki
提出日時 2022-07-15 21:24:59
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 4,584 bytes
コンパイル時間 1,992 ms
コンパイル使用メモリ 193,884 KB
最終ジャッジ日時 2023-09-10 00:27:24
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In instantiation of ‘void print(const S&) [with S = atcoder::static_modint<998244353>]’:
main.cpp:75:10:   required from here
main.cpp:54:67: エラー: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘const atcoder::static_modint<998244353>’)
   54 | template <class S>             void  print(const S& a){ std::cout << a << '\n'; }
      |                                                         ~~~~~~~~~~^~~~
次のファイルから読み込み:  /usr/local/gcc7/include/c++/12.2.0/istream:39,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/sstream:38,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/complex:45,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/ccomplex:39,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:54,
         次から読み込み:  main.cpp:2:
/usr/local/gcc7/include/c++/12.2.0/ostream:108:7: 備考: 候補: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]’
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/local/gcc7/include/c++/12.2.0/ostream:108:36: 備考:   no known conversion for argument 1 from ‘const atcoder::static_modint<998244353>’ to ‘std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)’ {aka ‘std::basic_ostream<char>& (*)(std::basic_ostream<char>&)’}
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/local/gcc7/include/c++/12.2.0/ostream:117:7: 備考: 候補: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*

ソースコード

diff #

#pragma region template
#include <bits/stdc++.h>

using namespace std;

// clang-format off
using ll  = long long;    using vl   = vector<ll>;  using vvl   = vector<vl>;
using ld  = long double;  using vld  = vector<ld>;  using vvld  = vector<vld>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;
using vb = vector<bool>; using vvb = vector<vector<bool>>;
using vs = vector<string>;
using mll = map<ll, ll>;
template <class T> using max_heap = priority_queue<T>;
template <class T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
constexpr ll inf = 3001001000100100100LL;
#define endl '\n'

#define  _overload(_1, _2, _3, name, ...) name
#define   rep(...) _overload(__VA_ARGS__,   _rep,   _rep2,)(__VA_ARGS__)
#define  repc(...) _overload(__VA_ARGS__,  _repc,  _repc2,)(__VA_ARGS__)
#define  repr(...) _overload(__VA_ARGS__,  _repr,  _repr2,)(__VA_ARGS__)
#define reprc(...) _overload(__VA_ARGS__, _reprc, _reprc2,)(__VA_ARGS__)
#define   _rep(i,k,n) for(ll i=(k)  , i##_xxxx=(n); i < i##_xxxx; ++i)
#define  _repc(i,k,n) for(ll i=(k)  , i##_xxxx=(n); i <=i##_xxxx; ++i)
#define  _repr(i,k,n) for(ll i=(n)-1, i##_xxxx=(k); i >=i##_xxxx; --i)
#define _reprc(i,k,n) for(ll i=(n)  , i##_xxxx=(k); i >=i##_xxxx; --i)
#define   _rep2(i,n)   _rep(i,0,n)
#define  _repc2(i,n)  _repc(i,1,n)
#define  _repr2(i,n)  _repr(i,0,n)
#define _reprc2(i,n) _reprc(i,1,n)

#define rall(o) rbegin(o), rend(o)
#define  all(o)  begin(o),  end(o)
template <class C> ll sz(const C& c) { return static_cast<ll>(c.size()); }
template <class T> bool chmax(T& m, const T& v){ if (m < v){ m = v; return true; } return false; }
template <class T> bool chmin(T& m, const T& v){ if (v < m){ m = v; return true; } return false; }
template <class T> T cdiv(const T& a, const T& b){ return (a + b - 1) / b; }
template <class T> T rdiv(const T& a, const T& b){ return (a + b / 2) / b; }
template <class T, class S>             string join(const T& v, const S& sep                  ){ stringstream ss; bool f = false; for (const auto& e : v){ if (f) ss << sep; f = true; ss << e;} return ss.str(); }
template <class T, class S, class... U> string join(const T& v, const S& sep, const U& ...args){ stringstream ss; bool f = false; for (const auto& c : v){ if (f) ss << sep; f = true; ss << join(c, args...); } return ss.str(); }
template <class T>            ostream& operator<<(ostream& os, const vector<T>&            seq){ os << '[' << join(seq, ",") << ']'; return os; } template <class T>            ostream& operator<<(ostream& os, const vector<vector<T>>&    seq){ os << '[' << join(seq, ",\n ") << ']'; return os; }
template <class T>            ostream& operator<<(ostream& os, const deque<T>&             seq){ os << '[' << join(seq, ",") << ']'; return os; }
template <class T>            ostream& operator<<(ostream& os, const set<T>&               seq){ os << '{' << join(seq, ",") << '}'; return os; }
template <class T , class TH> ostream& operator<<(ostream& os, const unordered_set<T, TH>& seq){ os << '{' << join(seq, ",") << '}'; return os; }
template <class TK, class TV> ostream& operator<<(ostream& os, const map<TK, TV>&          seq){ os << '{'; bool f = false; for (const auto& e : seq){ if (f) os << ','; f = true; os << e.first << ":" << e.second; } os << '}'; return os; }
template <class T1, class T2> ostream& operator<<(ostream& os, const pair<T1, T2>&          pa){ os << '(' << pa.first << ',' << pa.second << ')'; return os; }

#if LOCAL
#define debug(...) _debug(__VA_ARGS__, __LINE__)
#else
#define debug(...)
#endif
void print() { std::cout << '\n'; }
template <class S>             void  print(const S& a){ std::cout << a << '\n'; }
template <class S>             void _debug(const S& a){ std::cerr << "(L:" << std::setw(3) << a << ")\n"; }
template <class S, class... T> void  print(const S& a, const T&... args){ std::cout << a << ' ';  print(args...); }
template <class S, class... T> void _debug(const S& a, const T&... args){ std::cerr << a << ' '; _debug(args...); }

struct setup_main { setup_main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << fixed << setprecision(15); } } setup_main_;

#include <atcoder/modint.hpp>

using namespace atcoder;
constexpr ll MOD = 998244353;
using mint = static_modint<MOD>;
using vm = vector<mint>;
using vvm = vector<vm>;
ostream& operator<<(ostream& os, const mint& v){ os << v.val(); return os; }

// clang-format on
#pragma endregion

void solve(ll a, ll n) {
    print(MOD);
    print(mint(a).pow(n));
}

int main() {
    ll a, n;
    cin >> a >> n;

	solve(a, n);
}
0