提出 #75836898
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define LONGMAX 1e18
#define INTMAX 2147483647
int main(void)
{
string s;
cin >> s;
int n;
cin >> n;
for (int i = 0; i < s.length(); i++)
{
if (i < n || (s.length() - n) <= i)
{
continue;
}
else
{
cout << s[i];
}
}
cout << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Chompers |
| ユーザ | lalashvbp |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 100 |
| コード長 | 443 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3556 KiB |
コンパイルエラー
./Main.cpp: In function 'int main()':
./Main.cpp:13:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
13 | for (int i = 0; i < s.length(); i++)
| ~~^~~~~~~~~~~~
./Main.cpp:15:39: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
15 | if (i < n || (s.length() - n) <= i)
| ~~~~~~~~~~~~~~~~~^~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00-sample-01.txt | AC | 1 ms | 3352 KiB |
| 00-sample-02.txt | AC | 1 ms | 3344 KiB |
| 00-sample-03.txt | AC | 1 ms | 3424 KiB |
| 01-01.txt | AC | 1 ms | 3456 KiB |
| 01-02.txt | AC | 1 ms | 3344 KiB |
| 01-03.txt | AC | 1 ms | 3544 KiB |
| 01-04.txt | AC | 1 ms | 3432 KiB |
| 01-05.txt | AC | 1 ms | 3512 KiB |
| 01-06.txt | AC | 1 ms | 3544 KiB |
| 01-07.txt | AC | 1 ms | 3380 KiB |
| 01-08.txt | AC | 1 ms | 3556 KiB |
| 01-09.txt | AC | 1 ms | 3456 KiB |