QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#805667#8975. Eva and Euro coinsSGColinCompile Error//C++201003b2024-12-08 17:52:152024-12-08 17:52:15

Judging History

This is the latest submission verdict.

  • [2024-12-08 17:52:15]
  • Judged
  • [2024-12-08 17:52:15]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

inline int rd() {
	int x = 0;
	bool f = 0;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) f |= (c == '-');
	for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
	return f ? -x : x;
}

#define N 1000007

#define fr  first
#define sc  second
#define pci pair<char, int>

int na, nb;

pci a[N], b[N];

int main() {
	int n = rd(), k = rd();
	if (k == 1) {puts("Yes"); return 0;}
	for (int i = 1; i <= n; ++i) {
		char c = getchar();
		while (!isdigit(c)) c = getchar();
		if (na && a[na].fr == c) {
			++a[na].sc; if (a[na].sc == k) --na;
		} else a[++na] = mp(c, 1);
	}
	for (int i = 1; i <= n; ++i) {
		char c = getchar();
		while (!isdigit(c)) c = getchar();
		if (nb && b[nb].fr == c) {
			++b[nb].sc; if (b[nb].sc == k) --nb;
		} else b[++nb] = mp(c, 1);
	}
	if (na != nb) {puts("No"); return 0;}
	for (int i = 1; i <= na; ++i)
		if (a[i] != b[i]) {puts("No"); return 0;}
	puts("Yes");
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:31:34: error: ‘mp’ was not declared in this scope
   31 |                 } else a[++na] = mp(c, 1);
      |                                  ^~
answer.code:38:34: error: ‘mp’ was not declared in this scope
   38 |                 } else b[++nb] = mp(c, 1);
      |                                  ^~