結果

問題 No.2827 Enter User Name to Play
ユーザー vjudge1
提出日時 2025-04-19 05:09:08
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 1,580 ms
コンパイル使用メモリ 130,944 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-19 05:09:11
合計ジャッジ時間 2,002 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:10:13: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
   10 |     int arr[n];
      |             ^
main.cpp:10:13: note: read of non-const variable 'n' is not allowed in a constant expression
main.cpp:6:9: note: declared here
    6 |     int n;
      |         ^
1 warning generated.

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string name;
    cin>>name;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    for(int j=0;j<n;j++)
    {
        int num=arr[j];
        // cout<<num;
        cout<<name[num-1];
    }
}
0