Submission #53089128
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); string s, t; cin >> s >> t; int i = 0, j = 0; while (i < size(s)) { while (j < size(t) and s[i] != t[j]) { ++j; } assert(j < size(t) and t[j] == s[i]); cout << j + 1 << ' '; ++i, ++j; } cout << '\n'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Typing |
User | achvanov |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 392 Byte |
Status | AC |
Exec Time | 10 ms |
Memory | 3844 KiB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:12:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 12 | while (i < size(s)) { | ~~^~~~~~~~~ Main.cpp:13:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 13 | while (j < size(t) and s[i] != t[j]) { | ~~^~~~~~~~~ In file included from /usr/include/c++/12/cassert:44, from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:33, from Main.cpp:1: Main.cpp:16:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 16 | assert(j < size(t) and t[j] == s[i]); | ~~^~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3436 KiB |
sample01.txt | AC | 1 ms | 3464 KiB |
sample02.txt | AC | 1 ms | 3416 KiB |
testcase00.txt | AC | 1 ms | 3480 KiB |
testcase01.txt | AC | 7 ms | 3672 KiB |
testcase02.txt | AC | 10 ms | 3736 KiB |
testcase03.txt | AC | 10 ms | 3584 KiB |
testcase04.txt | AC | 8 ms | 3776 KiB |
testcase05.txt | AC | 2 ms | 3708 KiB |
testcase06.txt | AC | 4 ms | 3652 KiB |
testcase07.txt | AC | 4 ms | 3548 KiB |
testcase08.txt | AC | 8 ms | 3608 KiB |
testcase09.txt | AC | 2 ms | 3464 KiB |
testcase10.txt | AC | 1 ms | 3648 KiB |
testcase11.txt | AC | 2 ms | 3660 KiB |
testcase12.txt | AC | 1 ms | 3648 KiB |
testcase13.txt | AC | 2 ms | 3608 KiB |
testcase14.txt | AC | 7 ms | 3508 KiB |
testcase15.txt | AC | 7 ms | 3824 KiB |
testcase16.txt | AC | 9 ms | 3684 KiB |
testcase17.txt | AC | 7 ms | 3688 KiB |
testcase18.txt | AC | 7 ms | 3844 KiB |