답안 #448176

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448176 2021-07-29T06:38:23 Z BERNARB01 Dijamant (COI16_dijament) C++17
27 / 100
191 ms 4004 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	map<string, int> vis;
	int id = 1;
	for (int i = 0; i < n; i++) {
		string tmp;
		getline(cin >> ws, tmp);
		stringstream ss;
		ss << tmp;
		string s, K;
		ss >> K;
		if (vis[K]) {
			cout << "greska" << '\n';
			continue;
		}
		ss >> s;
		vector<int> v;
		int bl = 1;
		while (1) {
			ss >> s;
			if (s == ";") {
				break;
			}
			if (!vis[s]) {
				bl = 0;
				break;
			}
			v.push_back(vis[s]);
		}
		if (!bl) {
			cout << "greska" << '\n';
			continue;
		}
		vis[K] = id++;
		cout << "ok" << '\n';
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 332 KB Output is correct
7 Correct 2 ms 332 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 332 KB Output is correct
7 Correct 2 ms 332 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Incorrect 1 ms 292 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 191 ms 4004 KB Output isn't correct
2 Halted 0 ms 0 KB -