結果
問題 |
No.2460 #強調#
|
ユーザー |
![]() |
提出日時 | 2025-09-18 19:41:19 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 249 bytes |
コンパイル時間 | 3,123 ms |
コンパイル使用メモリ | 276,032 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-18 19:41:23 |
合計ジャッジ時間 | 4,264 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:26: warning: ‘e’ may be used uninitialized [-Wmaybe-uninitialized] 16 | cout << S.substr(s+1, e-s-1) << endl; | ~^~ main.cpp:8:13: note: ‘e’ was declared here 8 | int s=-1, e; | ^
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; int s=-1, e; for(int i=0; i<(int)S.size(); i++){ if(S[i]=='#'){ if(s==-1) s=i; else e=i; } } cout << S.substr(s+1, e-s-1) << endl; }