Submission #159708

#TimeUsernameProblemLanguageResultExecution timeMemory
159708geon040702줄 세우기 (KOI13_jul)C++14
22 / 22
170 ms14856 KiB
#include <bits/stdc++.h> using namespace std; int number[1000010], memo[1000010]; int n, i, m, r; int main(void) { scanf("%d", &n); for(i=1;i<=n;i++) { scanf("%d", &number[i]); memo[number[i]] = memo[number[i]-1] + 1; if(memo[number[i]] > m) { m = memo[number[i]]; } } printf("%d\n", n-m); return 0; }

Compilation message (stderr)

jul.cpp: In function 'int main()':
jul.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
jul.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &number[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...