結果
問題 | No.1232 2^x = x |
ユーザー |
|
提出日時 | 2020-09-18 22:47:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 684 bytes |
コンパイル時間 | 2,427 ms |
コンパイル使用メモリ | 193,076 KB |
最終ジャッジ日時 | 2025-01-14 17:38:43 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
ソースコード
#include"bits/stdc++.h" using namespace std; #define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define rep(i,n) REP((i),0,(n)) using ll = long long; using pll = pair<ll, ll>; using tp3 = tuple<ll, ll, ll>; constexpr int INF = 1 << 28; constexpr ll INFL = 1ll << 60; constexpr int dh[4] = { 0,1,0,-1 }; constexpr int dw[4] = { -1,0,1,0 }; bool isin(const int H, const int W, const int h, const int w) { return 0 <= h && h < H && 0 <= w && w < W; } // ============ template finished ============ int main() { int N; cin >> N; rep(_, N) { ll p; cin >> p; ll res = p == 2 ? 2 : (p - 1)*(p - 1); cout << res << endl; } return 0; }