Submission #715041

# Submission time Handle Problem Language Result Execution time Memory
715041 2023-03-25T21:32:48 Z TheConverseEngineer Sifra (COCI21_sifra) C++17
0 / 50
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define sqr(x) ((ll)(x))*(x)
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;


int a = 0;

set<string> used;

int main() {
	cin.tie(0)->sync_with_stdio(0);

	string s; cin >> s;
	string lastInt = ""; bool lastWasInt = false;
	for (char c : s) {
		bool isNum = (c=='1') or (c=='2') or (c=='3') or (c=='4') or (c=='5') or (c=='6') or (c=='7') or (c=='8') or (c=='9');
		if (isNum and !lastWasInt) {lastInt = "" + c;}
		else if (isNum and lastWasInt) {lastInt += c;}
		else if (!isNum and lastWasInt) {
			if (!used.count(lastInt)) {
				a++;
				used.insert(lastInt);
				lastInt = "";
			}
		}
		lastWasInt = isNum;
	}
	if (sz(lastInt) > 0 and !used.count(lastInt)) {
		a++;
		used.insert(lastInt);
		lastInt = "";
	}

	cout << a;
 	
} 
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Incorrect 0 ms 340 KB Output isn't correct
7 Incorrect 0 ms 324 KB Output isn't correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Incorrect 0 ms 212 KB Output isn't correct
10 Incorrect 0 ms 212 KB Output isn't correct