結果

問題 No.1232 2^x = x
ユーザー poohbearpoohbear
提出日時 2020-09-18 23:17:02
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 831 bytes
コンパイル時間 2,691 ms
コンパイル使用メモリ 200,536 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-04 11:34:36
合計ジャッジ時間 2,707 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;

long long modpow(long long a, long long n,ll mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main(){
    ll n;
    cin >> n;
    vector<ll>p(n);
    rep(i,n)cin>>p[i];
    rep(i,n){
        if(p[i]==2){
            cout << 2 << endl;
        }
        else cout << (p[i]-1)*(p[i]-1) << endl;
    }

    return 0;
}
0