Submission #536539

#TimeUsernameProblemLanguageResultExecution timeMemory
536539rainboyJOIOJI (JOI14_joioji)C11
20 / 100
284 ms272 KiB
#include <stdio.h> #define N 4000 int max(int a, int b) { return a > b ? a : b; } int main() { static char cc[N + 1]; int n, i, j, kj, ko, ki, l; scanf("%d%s", &n, cc); l = 0; for (i = 0; i < n; i++) { kj = ko = ki = 0; for (j = i; j < n; j++) { if (cc[j] == 'J') kj++; else if (cc[j] == 'O') ko++; else ki++; if (kj == ki && ko == ki) l = max(l, j - i + 1); } } printf("%d\n", l); return 0; }

Compilation message (stderr)

joioji.c: In function 'main':
joioji.c:11:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d%s", &n, cc);
      |  ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...