結果

問題 No.2827 Enter User Name to Play
コンテスト
ユーザー vjudge1
提出日時 2025-04-17 18:13:00
言語 C++17(clang)
(clang++ 22.1.2 + boost 1.90.0)
コンパイル:
clang++ -O2 -lm -std=c++1z -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
コード長 292 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,478 ms
コンパイル使用メモリ 129,920 KB
実行使用メモリ 5,632 KB
最終ジャッジ日時 2026-07-09 17:08:55
合計ジャッジ時間 1,666 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:13:13: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
   13 |     int num[c];
      |             ^
main.cpp:13:13: note: read of non-const variable 'c' is not allowed in a constant expression
main.cpp:5:9: note: declared here
    5 |     int c;
      |         ^
1 warning generated.

ソースコード

diff #
raw source code

#include<iostream>
using namespace std;
int main(){
    int c;
    cin>>c;
    char *n;
    n=new char [c];

    for(int i=0;i<c;i++ ){
        cin>>n[i];
    }
    int num[c];
    for(int i=0;i<c;i++){
        cin>>num[i];
    }
    for(int i=0;i<c;i++){
        cout<<n[num[i]-1];
    }

}
0