Submission #441657

#TimeUsernameProblemLanguageResultExecution timeMemory
441657rainboyGo (COCI16_go)C11
50 / 50
1 ms276 KiB
#include <stdio.h> #define N 70 int main() { static char ss[N][32]; static int aa[N], bb[N]; int n, i, i_, k_, sum; scanf("%d", &n); sum = 0, k_ = 0, i_ = -1; for (i = 0; i < n; i++) { int k; scanf("%s%d%d", ss[i], &aa[i], &bb[i]); k = (bb[i] - 2) / (aa[i] - 2); sum += k; if (k_ < k) k_ = k, i_ = i; } printf("%d\n", sum); printf("%s\n", ss[i_]); return 0; }

Compilation message (stderr)

go.c: In function 'main':
go.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
go.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%s%d%d", ss[i], &aa[i], &bb[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...