MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / main

Function main

contents/algorithm/code/LDS_bs.cpp:26–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int main(void){
27 ios::sync_with_stdio(false);
28 cin.tie(0);
29
30 cin>>N;
31 for(int i=0; i<N; i++)
32 cin>>arr[i];
33
34 int end = 0;
35 LDS[end] = arr[0];
36 for(int i=1; i<N; i++){
37 if(LDS[end] <= arr[i]){
38 int idx = search(0, end, arr[i]);
39 LDS[idx] = arr[i];
40 }
41 else
42 LDS[++end] = arr[i];
43 }
44
45 cout<<end+1<<"\n";
46
47 return 0;
48}

Callers

nothing calls this directly

Calls 1

searchFunction · 0.85

Tested by

no test coverage detected