답안 #464457

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
464457 2021-08-13T08:53:32 Z TheScrasse Sifra (COCI21_sifra) C++14
50 / 50
1 ms 312 KB
#include <bits/stdc++.h>
using namespace std;

#define nl "\n"
#define nf endl
#define ll long long
#define pb push_back
#define _ << ' ' <<

#define INF (ll)1e18
#define mod 998244353
#define maxn 110

ll i, i1, j, k, k1, t, n, m, res, flag[10], a, b;
string s;
set<ll> st;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    /* #if !ONLINE_JUDGE && !EVAL
        ifstream cin("input.txt");
        ofstream cout("output.txt");
    #endif */

    cin >> s; n = s.size() + 1; s = '#' + s + '#';
    for (i = 1; i <= n; i++) {
        k = (ll)s[i] - '0';
        if (k >= 0 && k <= 9) {
            m = 10 * m + k;
        } else if (m != 0) {
            st.insert(m); m = 0;
        }
    }

    cout << st.size() << nl;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 312 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 312 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct