Submission #926399

#TimeUsernameProblemLanguageResultExecution timeMemory
926399rainboyMartian DNA (IOI16_dna)C11
100 / 100
10 ms604 KiB
#include "dna_c.h" #include <stdlib.h> #define N 1000 #define K 20 char cc[N + K + 1]; char *analyse(int n, int t) { int m, k, i; char c; srand(12345); m = 0, k = 0; while (k < K) { cc[m++] = rand() % 2 + '0'; cc[m] = 0; if (make_test(cc)) k = 0; else cc[m - 1] = cc[m - 1] == '0' ? '1' : '0', k++; } for (i = m - k + 1; i <= m; i++) { c = cc[i]; cc[i] = 0; if (!make_test(cc)) { m = i - 1; break; } cc[i] = c; } while (m < n) { m++; for (i = m - 1; i > 0; i--) cc[i] = cc[i - 1]; cc[0] = '0'; cc[m] = 0; if (!make_test(cc)) cc[0] = '1'; } cc[n] = 0; return cc; }

Compilation message (stderr)

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