답안 #1074716

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1074716 2024-08-25T13:15:05 Z Cherypashkin Sifra (COCI21_sifra) C++14
50 / 50
1 ms 348 KB
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define ld long double
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define TASK_NAME "windows"
#define coutp cout << "       "
#define cont continue

using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

/*
ordered_set<int> s;
s.order_of_key(a[i]); the number of elements STRICTLY less than a[i]
s.insert(a[i].S);
*/

const long long inf = 2e18, mod = 1000000007;
const ld eps = 1e-9;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int multitest = 1; //cin >> multitest;
    while(multitest--) {
        string s; cin >> s;
        set<string> se;
        string s2 = "";
        for (int i = 0; i < (int)s.size(); i++) {
            if (s[i] - '0' >= 0 and s[i] - '0' <= 9) {
                s2 += s[i];
                cont;
            }if (s2.size() != 0) {
                if (s2[0] != '0')se.insert(s2);
                s2 = "";
            }
        }if (s2.size() != 0) {
            if (s2[0] != '0')se.insert(s2);
            s2 = "";
        }cout<< se.size();
    }return 0;
}
/*
26
5 4 5 4 5 4 3 2 1 2 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3

7
6 3 9 5 2 8 7
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct