結果

問題 No.1232 2^x = x
ユーザー iqueue02
提出日時 2020-09-18 23:32:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 1,804 ms
コンパイル使用メモリ 193,760 KB
最終ジャッジ日時 2025-01-14 18:02:54
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;

void solve (int p) {
  if (p == 2) cout << 2 << endl;
  else cout << (ll)(p - 1) * (p - 1) << endl;
}

int main() {
  int n;
  cin >> n;
  while (n--) {
    int p;
    cin >> p;
    solve(p);
  }
  return 0; 
}
0