fork download
  1. #include <cstdio>
  2. #include <string>
  3.  
  4. int alpha[256];
  5. char buf[100001];
  6.  
  7. int main(void) {
  8. int n; scanf("%d", &n);
  9. while(n--) {
  10. int x; scanf("%d ", &x);
  11. if (x == 0) {
  12. alpha[32] += 1;
  13. }
  14. else if (x >= 1 && x <= 26) {
  15. x -= 1;
  16. alpha['A' + x] += 1;
  17. }
  18. else if (x >= 27 && x <= 52) {
  19. x -= 27;
  20. alpha['a' + x] += 1;
  21. }
  22. }
  23.  
  24. fgets(buf, sizeof(buf), stdin);
  25. for (int i = 0; buf[i] != '\0'; i++) {
  26. alpha[buf[i]] -= 1;
  27. }
  28. for (int i = 0; i < 256; i++) {
  29. if (alpha[i] != 0) {
  30. printf("n\n");
  31. return 0;
  32. }
  33. }
  34. printf("y\n");
  35. return 0;
  36. }
Success #stdin #stdout 0s 15328KB
stdin
11
44 0 38 41 38 31 23 8 41 30 38
Hello World
stdout
n