Submission #36957958


Source Code Expand

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double PI = acos(-1);



int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    rep(i,n) {
        if (s[i] != t[i]) {
            cout << i+1 << endl;
            return 0;
        }
    }
    cout << n+1 << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Extra Character
User taki0711
Language C++ (GCC 9.2.1)
Score 300
Code Size 670 Byte
Status AC
Exec Time 26 ms
Memory 5380 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 27
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 21 ms 5208 KiB
random_02.txt AC 9 ms 3672 KiB
random_03.txt AC 20 ms 5260 KiB
random_04.txt AC 12 ms 3704 KiB
random_05.txt AC 25 ms 5376 KiB
random_06.txt AC 17 ms 4288 KiB
random_07.txt AC 25 ms 5204 KiB
random_08.txt AC 9 ms 3720 KiB
random_09.txt AC 26 ms 5188 KiB
random_10.txt AC 18 ms 4244 KiB
random_11.txt AC 20 ms 5260 KiB
random_12.txt AC 10 ms 3696 KiB
random_13.txt AC 23 ms 5272 KiB
random_14.txt AC 21 ms 5200 KiB
random_15.txt AC 3 ms 3488 KiB
random_16.txt AC 3 ms 3624 KiB
random_17.txt AC 26 ms 5276 KiB
random_18.txt AC 20 ms 5260 KiB
random_19.txt AC 19 ms 5280 KiB
random_20.txt AC 26 ms 5316 KiB
random_21.txt AC 25 ms 5280 KiB
random_22.txt AC 19 ms 5380 KiB
random_23.txt AC 20 ms 5288 KiB
random_24.txt AC 24 ms 5316 KiB
sample_01.txt AC 11 ms 3588 KiB
sample_02.txt AC 3 ms 3512 KiB
sample_03.txt AC 2 ms 3540 KiB