結果

問題 No.2092 Conjugation
ユーザー mnmmnm
提出日時 2022-10-07 21:34:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 1,039 bytes
コンパイル時間 902 ms
コンパイル使用メモリ 100,592 KB
実行使用メモリ 8,344 KB
最終ジャッジ日時 2023-09-03 00:34:14
合計ジャッジ時間 3,098 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 69 ms
8,244 KB
testcase_08 AC 73 ms
8,076 KB
testcase_09 AC 58 ms
8,184 KB
testcase_10 AC 62 ms
8,044 KB
testcase_11 AC 62 ms
8,048 KB
testcase_12 AC 56 ms
8,052 KB
testcase_13 AC 53 ms
8,076 KB
testcase_14 AC 52 ms
8,048 KB
testcase_15 AC 58 ms
8,048 KB
testcase_16 AC 83 ms
8,048 KB
testcase_17 AC 97 ms
8,344 KB
testcase_18 AC 85 ms
8,052 KB
testcase_19 AC 13 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:37:17: 警告: ‘x’ may be used uninitialized [-Wmaybe-uninitialized]
   37 |     dec_rep(i, x-1, 1){
      |                 ^
main.cpp:26:20: 備考: ‘x’ はここで定義されています
   26 |     lint k, cnt=0, x, y;
      |                    ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <bitset>
#include <map>
#include <set>
#include <queue>
#include <iomanip>

#define rep(i,n) for(i=0; i<n; ++i)
#define inc_rep(i,a,n) for(i=a; i<=n; ++i)
#define dec_rep(i,n,a) for(i=n; i>=a; --i)
#define in(a) cin >> a
#define out(a,b) cout << a << b
#define print_vec(v) for(auto it=v.begin();it!=v.end();++it)cout<<*it <<" ";cout<<endl
#define print_vec2d(v) for(int i=0;i<v.size();++i){for(int j=0;j<v[i].size();++j)cout<<v[i][j]<<" ";cout<<endl;}cout<<endl
using namespace std;
using lint = long long;


int main(void){
    int i, j;
    lint k, cnt=0, x, y;
    lint p, q, n, m;
    string s;
    in(n);
    map<int, int> d;
    rep(i,n){
        int a;
        in(a);
        if(i==0) x=a;
        d[a]=i+1;
    }
    dec_rep(i, x-1, 1){
        if(d[i]==0){
            d[i]=d[i+1];
        }
    }
    rep(i,x){
        cout << d[i+1];
        if(i!=x-1) cout << " ";
    }
    cout << endl;

    return 0;
}
0