Submission #200555

#TimeUsernameProblemLanguageResultExecution timeMemory
200555KalamStudentsko (COCI14_studentsko)C++11
100 / 100
8 ms892 KiB
// KALAM # include<bits/stdc++.h> # define debug(x) cerr << #x << " = " << x << endl using namespace std; const int N = 100000 + 77; int A , n , k , a[N] , F[N]; vector < int > U; int main() { memset(F , 63 , sizeof F); scanf("%d %d" , & n , & k); for(int i = 1;i <= n;++ i) scanf("%d" , a + i) , U.push_back(a[i]); sort(U.begin() , U.end()); U.resize(unique(U.begin() , U.end()) - U.begin()); for(int i = 1;i <= n;++ i) a[i] = (lower_bound(U.begin() , U.end() , a[i]) - U.begin()) / k + 1; F[0] = -1; for(int i = 1;i <= n;++ i) { int id = upper_bound(F , F + n + 2 , a[i]) - F; F[id] = a[i]; A = max(A , id); } printf("%d\n" , n - A); return 0; }

Compilation message (stderr)

studentsko.cpp: In function 'int main()':
studentsko.cpp:13:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d %d" , & n , & k);
    ~~~~~^~~~~~~~~~~~~~~~~~~~~
studentsko.cpp:15:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%d" , a + i) , U.push_back(a[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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...