結果
問題 | No.557 点対称 |
ユーザー |
![]() |
提出日時 | 2017-08-12 00:13:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 992 bytes |
コンパイル時間 | 761 ms |
コンパイル使用メモリ | 94,920 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 22:28:49 |
合計ジャッジ時間 | 1,533 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <cmath> #include <vector> #include <list> #include <map> #include <set> #include <functional> #include <queue> #include <iostream> #include <string.h> #include <iomanip> #include <algorithm> #include <functional> #include <cstdint> #include <climits> #include <unordered_set> #include <sstream> #include <stack> using namespace std; typedef long long int ll; typedef pair<int,int> pii; int main() { ll n; cin >> n; if(n == 1) { cout << 2 << endl; return 0; } if(n == 2) { cout << 4 << endl; return 0; } ll p = 4; ll m = n - 2; if(n % 2 == 1) { p = 12; m--; } m /= 2; vector<ll> v; v.reserve(1e6); ll d = 5; while(m > 0) { const ll mod = 1000000007; v.push_back(d); if(m & 1) { p *= d; p %= mod; } m >>= 1; d *= d; d %= mod; } cout << p << endl; return 0; }