結果
問題 | No.1232 2^x = x |
ユーザー | Navier_Boltzmann |
提出日時 | 2024-01-02 18:35:01 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 898 bytes |
コンパイル時間 | 5,285 ms |
コンパイル使用メモリ | 307,456 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-27 17:51:42 |
合計ジャッジ時間 | 6,077 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/istream:39, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/sstream:38, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/complex:45, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ccomplex:39, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:54, from main.cpp:1: In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]', inlined from 'int main()' at main.cpp:32:17: /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:202:25: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized] 202 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: In function 'int main()': main.cpp:28:10: note: 'x' was declared here 28 | ll k,x; | ^
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i,m,n,k) for (int i = (int)(m); i < (int)(n); i += (int)(k)) #define rrep(i,m,n,k) for (int i = (int)(m); i > (int)(n); i += (int)(k)) #define ll long long #define list(T,A,N) vector<T> A(N);for(int i=0;i<(int)(N);i++){cin >> A[i];} long long power_mod(long long n, long long k, long long mod) { long result = 1; // k を右シフトしつつ n を 2 乗していく while (k > 0) { // k の最下ビットが 1 なら、今の n を答えに掛ける if ((k & 1) == 1) result = (result * n) % mod; n = n * n % mod; k >>= 1; } return result; } int main(){ ll N; ll mod; cin >> N; ll k,x; rep(_,0,N,1){ cin >> mod; k = power_mod(mod-1,mod-2,mod); cout << x << endl; } return 0; }