提出 #53090322
ソースコード 拡げる
// #pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf (ll)1e18
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define lll __int128
const int N = 1e6 + 5;
void solve() {
string s, t;
cin >> s >> t;
s = '0' + s, t = '0' + t;
for (ll i = 1, j = 1; i < t.size() && j < s.size(); ) {
if (t[i] == s[j]) {
cout << i << " ";
j++;
}
i++;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
solve();
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Typing |
| ユーザ | TopCloser |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 200 |
| コード長 | 612 Byte |
| 結果 | AC |
| 実行時間 | 11 ms |
| メモリ | 4000 KiB |
コンパイルエラー
Main.cpp: In function ‘void solve()’:
Main.cpp:18:33: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
18 | for (ll i = 1, j = 1; i < t.size() && j < s.size(); ) {
| ~~^~~~~~~~~~
Main.cpp:18:49: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
18 | for (ll i = 1, j = 1; i < t.size() && j < s.size(); ) {
| ~~^~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample00.txt, sample01.txt, sample02.txt |
| All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| sample00.txt | AC | 1 ms | 3568 KiB |
| sample01.txt | AC | 1 ms | 3428 KiB |
| sample02.txt | AC | 1 ms | 3416 KiB |
| testcase00.txt | AC | 1 ms | 3500 KiB |
| testcase01.txt | AC | 7 ms | 3832 KiB |
| testcase02.txt | AC | 11 ms | 3908 KiB |
| testcase03.txt | AC | 11 ms | 3900 KiB |
| testcase04.txt | AC | 8 ms | 3808 KiB |
| testcase05.txt | AC | 2 ms | 3616 KiB |
| testcase06.txt | AC | 4 ms | 3784 KiB |
| testcase07.txt | AC | 4 ms | 3644 KiB |
| testcase08.txt | AC | 9 ms | 3876 KiB |
| testcase09.txt | AC | 2 ms | 3720 KiB |
| testcase10.txt | AC | 1 ms | 3640 KiB |
| testcase11.txt | AC | 1 ms | 3612 KiB |
| testcase12.txt | AC | 1 ms | 3708 KiB |
| testcase13.txt | AC | 1 ms | 3764 KiB |
| testcase14.txt | AC | 8 ms | 3800 KiB |
| testcase15.txt | AC | 8 ms | 4000 KiB |
| testcase16.txt | AC | 9 ms | 3976 KiB |
| testcase17.txt | AC | 7 ms | 3728 KiB |
| testcase18.txt | AC | 8 ms | 3824 KiB |