結果
| 問題 |
No.8047 Riddle of Cards
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2019-04-01 21:38:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 553 bytes |
| コンパイル時間 | 1,542 ms |
| コンパイル使用メモリ | 167,188 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-26 21:49:20 |
| 合計ジャッジ時間 | 1,788 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:18:34: warning: left shift count >= width of type [-Wshift-count-overflow]
18 | string s = to_string(~(~0ULL << 64));
| ~~~~~~^~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
using lint = unsigned long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
lint powll(lint a, int n) {
assert(n >= 0);
lint res = 1;
for (; n > 0; a *= a, n >>= 1) if (n & 1) res *= a;
return res;
}
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
int n, m; cin >> n >> m;
if (n == 16 and m == 16) {
string s = to_string(~(~0ULL << 64));
++s.back();
cout << s << '\n';
return 0;
}
cout << powll(m, n) << '\n';
}
risujiroh