Submission #872757

#TimeUsernameProblemLanguageResultExecution timeMemory
872757rainboyLost Array (NOI19_lostarray)C11
100 / 100
22 ms2572 KiB
#include <stdio.h> #define N 100000 int max(int a, int b) { return a > b ? a : b; } int main() { static int aa[N]; int n, m, h, i, j, a; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) aa[i] = 1; for (h = 0; h < m; h++) { scanf("%d%d%d", &i, &j, &a), i--, j--; aa[i] = max(aa[i], a), aa[j] = max(aa[j], a); } for (i = 0; i < n; i++) printf("%d ", aa[i]); printf("\n"); return 0; }

Compilation message (stderr)

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