結果
問題 |
No.2827 Enter User Name to Play
|
ユーザー |
![]() |
提出日時 | 2025-04-17 18:12:57 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 65,708 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-04-17 18:12:59 |
合計ジャッジ時間 | 1,677 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:25: warning: ‘N’ is used uninitialized [-Wuninitialized] 7 | char *og = new char[N]; | ^ main.cpp:5:9: note: ‘N’ declared here 5 | int N; | ^
ソースコード
#include <iostream> using namespace std; int main(){ int N; int num; char *og = new char[N]; char *newchar = new char[N]; cin>>N; for(int i=0;i<N;i++) cin>>og[i]; for(int i=0;i<N;i++) { cin>>num; newchar[i]=og[num-1]; num=0; } for(int i=0;i<N;i++) cout<<newchar[i]; return 0; }