ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 07.12.2019 20:07:30
ამოცანა: უცნაური ლიფტი
მომხმარებელი: zko69
ვერდიქტი: ამოუხსნელი
შეფასება: 0 ქულა
#include <bits/stdc++.h> int n,a,b,ans=0,i,j=0,k=0,mx,mn; std::string s; main(){ std::cin>>s; a=s.size(); for(i=0;i<a;i++){ if(s[i]=='U') j++; if(s[i]=='D') k++; } mx=max(j,k); mn=mim(j,k); cout<<mx-mn+1; return 0; }
PROB_cpp_UID692PID158_e4aeac/main.cpp: In function 'int main()': PROB_cpp_UID692PID158_e4aeac/main.cpp:11:11: error: 'max' was not declared in this scope mx=max(j,k); ^ PROB_cpp_UID692PID158_e4aeac/main.cpp:11:11: note: suggested alternative: In file included from /usr/include/c++/6/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65, from PROB_cpp_UID692PID158_e4aeac/main.cpp:1: /usr/include/c++/6/bits/stl_algo.h:3465:5: note: 'std::max' max(initializer_list<_Tp> __l, _Compare __comp) ^~~ PROB_cpp_UID692PID158_e4aeac/main.cpp:12:11: error: 'mim' was not declared in this scope mn=mim(j,k); ^ PROB_cpp_UID692PID158_e4aeac/main.cpp:13:1: error: 'cout' was not declared in this scope cout<<mx-mn+1; ^~~~ PROB_cpp_UID692PID158_e4aeac/main.cpp:13:1: note: suggested alternative: In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:75:0, from PROB_cpp_UID692PID158_e4aeac/main.cpp:1: /usr/include/c++/6/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^~~~