結果

問題 No.834 Random Walk Trip
ユーザー karinohitokarinohito
提出日時 2023-10-06 02:03:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 975 bytes
コンパイル時間 2,653 ms
コンパイル使用メモリ 201,828 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-06 02:03:24
合計ジャッジ時間 6,596 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<time.h>
using namespace std;

using ll = long long;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vvvvll = vector<vvvll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vvvvb = vector<vvvb>;

bool DEB = 0;

bool isbool(ll N){
    if(N<=1)return 0;
    for(ll i=2;i*i<=N;i++){
        if(N%i==0)return 0;
    }
    return 1;
}

ll modPow(ll a,ll n,ll mod){
    a%=mod;
    if(n==0)return 1;
    if(n%2==1)return (modPow(a,n-1,mod)*a)%mod;
    ll res=modPow(a,n/2,mod);
    return (res*res)%mod;
}

int main() {
    ll N;
    cin>>N;
    vll A(N);
    rep(i,N)cin>>A[i];
    vll L,R;
    rep(i,N)rep(j,N)rep(k,j)if(A[j]<A[k]){
        L.push_back(j);
        R.push_back(k);
        swap(A[j],A[k]);
    }
    ll M=L.size();
    cout<<M<<endl;
    rep(i,M)cout<<L[i]<<" "<<R[i]<<endl;
    cin>>N;
}
0