結果

問題 No.1635 Let’s Sort Integers!!
ユーザー chocoruskchocorusk
提出日時 2021-08-18 04:42:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,780 bytes
コンパイル時間 3,109 ms
コンパイル使用メモリ 186,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 12:22:50
合計ジャッジ時間 10,275 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,940 KB
testcase_29 AC 0 ms
6,940 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 1 ms
6,944 KB
testcase_48 AC 1 ms
6,944 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 2 ms
6,944 KB
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 AC 2 ms
6,940 KB
testcase_69 AC 2 ms
6,940 KB
testcase_70 WA -
testcase_71 WA -
testcase_72 WA -
testcase_73 WA -
testcase_74 WA -
testcase_75 WA -
testcase_76 WA -
testcase_77 WA -
testcase_78 AC 2 ms
6,944 KB
testcase_79 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    ll n, k;
    cin>>n>>k;
    cout<<-1<<endl;
    return 0;
    ll s=0;
    for(ll i=1; i<n; i++){
        s+=i;
    }
    if(k<n-1 || k>s){
        cout<<-1<<endl;
        return 0;
    }
    if(k==n-1){
        for(ll i=1; i<=n; i++){
            cout<<i;
            if(i<n) cout<<" ";
        }
        cout<<endl;
        return 0;
    }
    for(ll i=1; i<n-1; i++){
        if(s-i<=k){
            deque<int> ans;
            int v=1;
            for(int j=0; j<k-(s-i)+1; j++){
                ans.push_front(v);
                v++;
            }
            for(int j=0; j<i+1-(k-(s-i)); j++){
                ans.push_back(v);
                v++;
            }
            int j=0;
            while(v<=n){
                if(j&1) ans.push_back(v);
                else ans.push_front(v);
                v++; j++;
            }
            int ans1[1000010];
            for(int j=1; j<=n; j++){
                ans1[ans[j-1]]=j;
            }
            for(int j=1; j<=n; j++){
                cout<<ans1[j];
                if(j<n) cout<<" ";
            }
            cout<<endl;
            return 0;
        }
        s-=i;
    }
    return 0;
}
0