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