Loading...
Submission
# When Author Problem Language CPU Memory
20866 2024-06-13 00:17:17 AHAMMED_99 Game On Space C 0 ms 1532 kb Wrong Answer - 4
Test Cases
# CPU Memory Points
1 0 ms 1400 kb 1 Accepted
2 0 ms 1328 kb 1 Accepted
3 0 ms 1324 kb 1 Accepted
4 0 ms 1532 kb 0 Wrong Answer
5 0 ms 0 kb 0 Skipped
6 0 ms 0 kb 0 Skipped
7 0 ms 0 kb 0 Skipped
8 0 ms 0 kb 0 Skipped
9 0 ms 0 kb 0 Skipped
10 0 ms 0 kb 0 Skipped
11 0 ms 0 kb 0 Skipped
12 0 ms 0 kb 0 Skipped
13 0 ms 0 kb 0 Skipped
14 0 ms 0 kb 0 Skipped
15 0 ms 0 kb 0 Skipped
16 0 ms 0 kb 0 Skipped
17 0 ms 0 kb 0 Skipped
18 0 ms 0 kb 0 Skipped
19 0 ms 0 kb 0 Skipped
20 0 ms 0 kb 0 Skipped
21 0 ms 0 kb 0 Skipped
22 0 ms 0 kb 0 Skipped
23 0 ms 0 kb 0 Skipped
24 0 ms 0 kb 0 Skipped
Source Code
  1. #include <stdio.h>
  2.  
  3. // Function to check if Tajbin can win based on the parity of max distances
  4. int checkTajbinWin(long maxDistances[], int n) {
  5. // Count the number of dimensions with odd maximum distances
  6. int oddCount = 0;
  7. for (int i = 0; i < n; i++) {
  8. if (maxDistances[i] % 2 != 0) {
  9. oddCount++;
  10. }
  11. }
  12. // If there are odd number of dimensions with odd maximum distances, Tajbin wins
  13. return oddCount % 2 != 0;
  14. }
  15.  
  16. int main() {
  17. int n;
  18. scanf("%d", &n);
  19. long maxDistances[n];
  20. for (int i = 0; i < n; i++) {
  21. scanf("%ld", &maxDistances[i]);
  22. }
  23.  
  24. // Check if Tajbin can win based on the parity of max distances
  25. int tajbinWins = checkTajbinWin(maxDistances, n);
  26.  
  27. // Output the winner
  28. if (tajbinWins) {
  29. printf("Tajbin\n");
  30. } else {
  31. printf("Tanvir\n");
  32. }
  33.  
  34. return 0;
  35. }
  36.