| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 237411 | Doda | Karte (COCI15_karte) | C++14 | 5 ms | 384 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
typedef long long ll;
using namespace std;
int pot (ll q, ll w){
	ll qw = q;
	q = 1;
	for (int i = 0; i<w; i++)
		q*= qw;
	return q;
}
string s;
ll gr,rj,pd[14],kd[14],hd[14],td[14],p,k,h,t;
int main () {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> s;
ll c = s.size();
for (int i = 0; i<c;i+=3){
	string str;
	for (int k = 0; k<3;k++){
		str+=s[i+k];
	}
	if (str[0] == 'P'){
		ll a = int(str[1]-'0');
		ll b = int(str[2]-'0');
		ll broj = a*10+b;
		if (pd[broj] == 0)
			pd[broj]++;
		else
			gr=1;
	}
	else if (str[0] == 'K'){
		ll a = int(str[1]-'0');
		ll b = int(str[2]-'0');
		ll broj = a*10+b;
		if (kd[broj] == 0)
			kd[broj]++;
		else
			gr=1;
	}
	else if (str[0] == 'H'){
		ll a = int(str[1]-'0');
		ll b = int(str[2]-'0');
		ll broj = a*10+b;
		if (hd[broj] == 0)
			hd[broj]++;
		else
			gr=1;
	}
	else if (str[0] == 'T'){
		ll a = int(str[1]-'0');
		ll b = int(str[2]-'0');
		ll broj = a*10+b;
		if (td[broj] == 0)
			td[broj]++;
		else
			gr=1;
	}
}
if (gr==1)
	cout<<"GRESKA";
else{
	for (int i = 0;i<14;i++){
		if(pd[i] == 0)
			p++;
		if(kd[i] == 0)
			k++;
		if(hd[i] == 0)
			h++;
		if(td[i] == 0)
			t++;	
	}
	cout << p-1 << " " << k-1 << " " << h-1 << " " << t-1;
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
