submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s698974887
p03775
C++
#include<bits/stdc++.h> using namespace std; int check( int i ) { int count = 0; while( i ) { i /= 10; count++; } return count; } int main( void ) { long int N; cin >> N; long int A, B; int = max, min; min = 1000; for( int i = 1; i <= N; i++ ) { if( i * ( N / i ) == N ) { A = check( i ); B = check( N / i ); // cout << A << i << B << endl; if( A > B ) max = A; else max = B; } if( min > max ) { min = max; } //max = 0; } cout << min << endl; }
a.cc: In function 'int main()': a.cc:20:7: error: expected unqualified-id before '=' token 20 | int = max, min; | ^ a.cc:22:9: error: overloaded function with no contextual type information 22 | min = 1000; | ^~~~ a.cc:29:15: error: overloaded function with no contextual type information 29 | max = A; | ^ a.cc:31:15: error: overloaded function with no contextual type information 31 | max = B; | ^ a.cc:33:13: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator>' 33 | if( min > max ) { | ~~~~^~~~~ a.cc:34:13: error: overloaded function with no contextual type information 34 | min = max; | ^~~ a.cc:38:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 38 | cout << min << endl; | ~~~~~^~~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basi
s867240657
p03775
C++
#include <iostream> #include <string> #include <algorithm> #include <math.h> using namespace std; int digit(long long int a) { int ans = 0; while(a > 0){ a/=10; ans++; } return ans; } int main() { int i; int count = 1; long long int N, A = 1, B; int ans = 15; cin >> N; while ((double)A =< sqrt((double)N)) { if (N % A == 0) { B = N/A; count = max(digit(A),digit(B)); if (ans > count) { ans = count; } } A++; } cout << ans <<endl; }
a.cc: In function 'int main()': a.cc:27:27: error: expected primary-expression before '<' token 27 | while ((double)A =< sqrt((double)N)) | ^
s264092548
p03775
C++
#include <bits/stdc++.h> using ll=long long; int cnt_digits(ll N){ int digits=0; while(N>0){ N/=10; digits++; } return digits; } int main(void){ ll N; cin >> N; int ans=cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N) for(ll A=1LL;A*A<=N;++A){ if(N%A!=0) continue; const ll B=N/A; const int cur=max(cnt_digits(A),cnt_digits(B)); if(ans>cur){ ans=cur; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 16 | cin >> N; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:24:16: error: 'max' was not declared in this scope; did you mean 'std::max'? 24 | const int cur=max(cnt_digits(A),cnt_digits(B)); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:31:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 31 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:31:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 31 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s224565004
p03775
C++
using ll=long long; int cnt_digits(ll N){ int digits=0; while(N>0){ N/=10; digits++; } return digits; } int main(void){ ll N; cin >> N; int ans=cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N) for(ll A=1LL;A*A<=N;++A){ if(N%A!=0) continue; const ll B=N/A; const int cur=max(cnt_digits(A),cnt_digits(B)); if(ans>cur){ ans=cur; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:2: error: 'cin' was not declared in this scope 15 | cin >> N; | ^~~ a.cc:23:16: error: 'max' was not declared in this scope 23 | const int cur=max(cnt_digits(A),cnt_digits(B)); | ^~~ a.cc:30:2: error: 'cout' was not declared in this scope 30 | cout << ans << endl; | ^~~~ a.cc:30:17: error: 'endl' was not declared in this scope 30 | cout << ans << endl; | ^~~~
s464947565
p03775
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int main(){ long long X; cin >> X; int root=sqrt(X); int ans = log10(X); for(int i=0;i<root;i++){ if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:29: error: no matching function for call to 'min(const double&, int&)' 13 | if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:13:29: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'int') 13 | if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:13:29: note: mismatched types 'std::initializer_list<_Tp>' and 'double' 13 | if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s942295150
p03775
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int main(){ long long X; cin >> X; int root=sqrt(X); ans = log10(X); for(int i=0;i<root;i++){ if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | ans = log10(X); | ^~~ | abs
s880001846
p03775
C++
//#include<bits/stdc++.h> #include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include<set> #include<map> /* #include<boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/rational.hpp> namespace mp = boost::multiprecision; using Real = mp::number<mp::cpp_dec_float<1024>>; using Bint = mp::cpp_int; */ using namespace std; #define int long long #define REP(i,s,e) for((i)=(s);(i)<(e);(i)++) #define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--) #define FOR(i,n) for((i)=(0);(i)<(n);(i)++) #define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--) #define MOD 1000000007 signed main(){ int N; cin>>N; int ans=LLONG_MAX; for(int i=1;i<sqrt(N)+1;i++){ if(N%i==0){ int n1=N/i; int n2=i; int keta1=0; int keta2=0; while(n1!=0){ keta1++; n1/=10; } while(n2!=0){ keta2++; n2/=10; } ans=min(ans,max(keta1,keta2)); } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:33:13: error: 'LLONG_MAX' was not declared in this scope 33 | int ans=LLONG_MAX; | ^~~~~~~~~ a.cc:9:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 8 | #include<map> +++ |+#include <climits> 9 |
s035238006
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long n; cin >> n; string s; long a; for(long i = 10000;i >= 1;i--){ if(n % i == 0){ a = max(i,n/i) s = to_string(a); cout << s.size() << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:11:21: error: expected ';' before 's' 11 | a = max(i,n/i) | ^ | ; 12 | s = to_string(a); | ~
s392827465
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long n; cin >> n; string s; long a; for(int i = 10000;i >= 1;i--){ if(n % i == 0){ a = max(i,n/i) s = to_string(a); cout << s.size() << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: no matching function for call to 'max(int&, long int)' 11 | a = max(i,n/i) | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:11:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int') 11 | a = max(i,n/i) | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:11:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 11 | a = max(i,n/i) | ~~~^~~~~~~
s763317800
p03775
C++
#include <bits/stdc++.h> using namespace std; # define ll long long # define VI vector<int> # define VLL vector<ll> # define PII pair<int,int> #define mp make_pair #define pb push_back # define PI acos(-1) # define double long double const int MxN = 10005 ; # define FOR(i,a,b) for(int i = a ; i < b ; ++i) # define RFOR(i,a,b) for(int i = a ; i >= b ; --i) /* VARIABLES */ ll n ; /* END OF VARIABLES */ int dig(ll n) { int ans = 0 ; while(n) { n = n / 10 ; ans++; } return ans ; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL) ; int ans = 1e9 ; cin >> n ; for(ll i = 1 ; i <= sqrt(n) , i++) { if(n%i == 0) ans = min(ans,dig(max(i,n/i))) ; } cout << ans ; return 0 ; }
a.cc: In function 'int main()': a.cc:34:42: error: expected ';' before ')' token 34 | for(ll i = 1 ; i <= sqrt(n) , i++) { | ^ | ;
s166135608
p03775
C++
#include <bits/stdc++.h> using namespace std; # define ll long long # define VI vector<int> # define VLL vector<ll> # define PII pair<int,int> #define mp make_pair #define pb push_back # define PI acos(-1) # define double long double const int MxN = 10005 ; # define FOR(i,a,b) for(int i = a ; i < b ; ++i) # define RFOR(i,a,b) for(int i = a ; i >= b ; --i) /* VARIABLES */ ll n ; /* END OF VARIABLES */ int dig(ll n) { int ans = 0 ; while(n) { n = n / 10 ; ans++; } return ans ; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL) ; int ans = 1e9 ; cin >> n ; FOR(i,1,sqrt(n)+1) { if(n%i == 0) ans = min(ans,dig(max(i,n/i))) ; } cout << ans ; return 0 ; }
a.cc: In function 'int main()': a.cc:36:46: error: no matching function for call to 'max(int&, long long int)' 36 | ans = min(ans,dig(max(i,n/i))) ; | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:36:46: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 36 | ans = min(ans,dig(max(i,n/i))) ; | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:36:46: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 36 | ans = min(ans,dig(max(i,n/i))) ; | ~~~^~~~~~~
s466606088
p03775
C++
#include <bits/stdc++.h> #include <string.h> #include <vector> //s#define rep(i, n) for (int i = 0; i < (n); i++) #define MAX 10000 using namespace std; #define ll long long #define pb push_back #define mp make_pair #define all(a) (a).begin(),(a).end() #define rep(i,a,n) for(int i=a; i<n; i++) #define r0 return 0 #define INF (int)1e15 #define MOD 1000000007 int main(){ long long n,ans=0; cin>>n; for(int i=1;i<= sqrt(n);i++){ if(n%i == 0){ if(ans == 0) ans = max(f(i),f(n/i)); else ans = min(max(f(i),f(n/i)),ans); } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:30:19: error: 'f' was not declared in this scope 30 | ans = max(f(i),f(n/i)); | ^ a.cc:32:23: error: 'f' was not declared in this scope 32 | ans = min(max(f(i),f(n/i)),ans); | ^
s056537227
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int note = 100; for (int i=1; i <= sqrt(n)+1;i++){ if (n%i == 0){ long long b = n/i; int a = to_string(max(i,b)).length(); note = min(note,a); } } cout << note << endl; }
a.cc: In function 'int main()': a.cc:12:46: error: no matching function for call to 'max(int&, long long int&)' 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:12:46: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:12:46: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~
s467868473
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int note = 100; for (int i=1; i <= sqrt(n)+1;i++){ if (n%i == 0){ long long b = n/i; int a = to_string(max(i,b)).length(); note = min(note,a); } } cout << note << endl; cout << max(1,1) << endl; }
a.cc: In function 'int main()': a.cc:12:46: error: no matching function for call to 'max(int&, long long int&)' 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:12:46: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:12:46: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | int a = to_string(max(i,b)).length(); | ~~~^~~~~
s743671648
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> note(0); for (int i=1; i <= n**0.5+1,i++){ if (n%i == 0){ int a = to_string( max(i,n/i) ).length(); note.push_back(a); } } cout << min(note) << endl; }
a.cc: In function 'int main()': a.cc:8:26: error: invalid type argument of unary '*' (have 'double') 8 | for (int i=1; i <= n**0.5+1,i++){ | ^~~~ a.cc:8:36: error: expected ';' before ')' token 8 | for (int i=1; i <= n**0.5+1,i++){ | ^ | ; a.cc:14:16: error: no matching function for call to 'min(std::vector<int>&)' 14 | cout << min(note) << endl; | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed: a.cc:14:16: note: 'std::vector<int>' is not derived from 'std::initializer_list<_Tp>' 14 | cout << min(note) << endl; | ~~~^~~~~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided
s491298288
p03775
C++
#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <math.h> using namespace std; int c_get_keta(long long int a) { int a_cnt = 0; while (a > 0){ a_cnt++; a /= 10; } return a_cnt; } void c_digits_in_multiplication(void) { long long int n; int min_tmp; int ans_min = 10000000; cin >> n; int n_end = int(sqrt(long double(n))); for (long long int a = 1; a <= (n_end); a++) { if (n % a != 0) continue; //cout << a << endl; long long int b = n / a; if (a > b) { min_tmp = c_get_keta(a); } else { min_tmp = c_get_keta(b); } //cout << "n, a,b:" << n<<","<<a << "," << b << endl; if (min_tmp < ans_min) ans_min = min_tmp; } cout << ans_min << endl; } int main() { c_digits_in_multiplication(); return 0; }
a.cc: In function 'void c_digits_in_multiplication()': a.cc:23:21: error: expected primary-expression before 'int' 23 | int n_end = int(sqrt(long double(n))); | ^~~
s348771931
p03775
C++
#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <math.h> using namespace std; int c_get_keta(long long int a) { int a_cnt = 0; while (a > 0){ a_cnt++; a /= 10; } return a_cnt; } void c_digits_in_multiplication(void) { long long int n; int min_tmp; int ans_min = 10000000; cin >> n; long long int n_end = long(long( int(sqrt(long double(n))))); for (long long int a = 1; a <= (n_end); a++) { if (n % a != 0) continue; //cout << a << endl; long long int b = n / a; if (a > b) { min_tmp = c_get_keta(a); } else { min_tmp = c_get_keta(b); } //cout << "n, a,b:" << n<<","<<a << "," << b << endl; if (min_tmp < ans_min) ans_min = min_tmp; } cout << ans_min << endl; } int main() { c_digits_in_multiplication(); return 0; }
a.cc: In function 'void c_digits_in_multiplication()': a.cc:23:31: error: expected primary-expression before 'long' 23 | long long int n_end = long(long( int(sqrt(long double(n))))); | ^~~~
s646352922
p03775
C++
#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <math.h> using namespace std; int c_get_keta(long long int a) { int a_cnt = 0; while (a > 0){ a_cnt++; a /= 10; } return a_cnt; } void c_digits_in_multiplication(void) { long long int n; int min_tmp; int ans_min = 10000000; cin >> n; long long int n_end = long int(sqrt(long double(n))); for (long long int a = 1; a <= (n_end); a++) { if (n % a != 0) continue; //cout << a << endl; long long int b = n / a; if (a > b) { min_tmp = c_get_keta(a); } else { min_tmp = c_get_keta(b); } //cout << "n, a,b:" << n<<","<<a << "," << b << endl; if (min_tmp < ans_min) ans_min = min_tmp; } cout << ans_min << endl; } int main() { c_digits_in_multiplication(); return 0; }
a.cc: In function 'void c_digits_in_multiplication()': a.cc:23:31: error: expected primary-expression before 'long' 23 | long long int n_end = long int(sqrt(long double(n))); | ^~~~
s454563009
p03775
C++
#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <math.h> using namespace std; int c_get_keta(long long int a) { int a_cnt = 0; while (a > 0){ a_cnt++; a /= 10; } return a_cnt; } void c_digits_in_multiplication(void) { long long int n; int min_tmp; int ans_min = 10000000; cin >> n; long long int n_end = long long int(sqrt(long double(n))); for (long long int a = 1; a <= (n_end); a++) { if (n % a != 0) continue; //cout << a << endl; long long int b = n / a; if (a > b) { min_tmp = c_get_keta(a); } else { min_tmp = c_get_keta(b); } //cout << "n, a,b:" << n<<","<<a << "," << b << endl; if (min_tmp < ans_min) ans_min = min_tmp; } cout << ans_min << endl; } int main() { c_digits_in_multiplication(); return 0; }
a.cc: In function 'void c_digits_in_multiplication()': a.cc:23:31: error: expected primary-expression before 'long' 23 | long long int n_end = long long int(sqrt(long double(n))); | ^~~~
s445958134
p03775
C++
from math import sqrt n = int(input()) n2 = n pfs = [] i = 2 while n2 > 0 and n2 >= i: if n2 % i == 0: n2 //= i pfs.append(i) else: i += 1 a, b = 1, 1 for i in range(len(pfs)-1, -1, -1): c = pfs[i] if a <= b: a *= c else: b *= c def digits(n): ans = 0 while n > 0: ans += 1 n //= 10 return ans print (max(digits(a), digits(b)))
a.cc:1:1: error: 'from' does not name a type 1 | from math import sqrt | ^~~~
s035191359
p03775
C++
#include <functional> #include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <string> #include <vector> #include <random> #include <bitset> #include <queue> #include <cmath> #include <stack> #include <set> #include <map> typedef long long ll; using namespace std; const ll MOD = 1000000007LL; // 約数のvectorを返す vector<ll> divisor(ll n) { vector<ll> ret; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i != n / i) ret.push_back(n / i); } } return ret; } int main() { ll n; cin >> n; auto div = divisor(n); int ans = 10; for (ll d : div) { ans = min(ans, to_string(d).size() + to_string(n / d).length()); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:18: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)' 38 | ans = min(ans, to_string(d).size() + to_string(n / d).length()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/hashtable_policy.h:36, from /usr/include/c++/14/bits/hashtable.h:35, from /usr/include/c++/14/bits/unordered_map.h:33, from /usr/include/c++/14/unordered_map:41, from /usr/include/c++/14/functional:63, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:38:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 38 | ans = min(ans, to_string(d).size() + to_string(n / d).length()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:38:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 38 | ans = min(ans, to_string(d).size() + to_string(n / d).length()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s507539631
p03775
C++
#include<iostream> #include<algorithm> #include<vector> #include <iomanip> #include <cmath> #include <string.h> #include <stdio.h> using namespace std; int main(){ int A, B, C, X, Y; cin >> A >> B >> X >> Y; int res = A*X + B*Y; for(int i=1; i<= max(X, Y); i++){ int ab = i*2; int candC*ab + A*(X-i) +B*(Y-i); } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:18: error: expected initializer before '*' token 21 | int candC*ab + A*(X-i) +B*(Y-i); | ^
s963755903
p03775
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextLong(); long res = Long.MAX_VALUE; for (long i = 1; i <= n; i++) { if (n % i == 0) { int tmpRes = Math.max( String.valueOf(i).length(), String.valueOf(n / i).length()); if (tmpRes < res) res = tmpRes; } } System.out.println(res); } }
Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s179742627
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int A,B; N=A*B; for(int i=0;i<10000000000;i++){ A=i; int Ad=0; while(Ad>0){ Ad=A/10;Ad++; } B=i; int Bd=0; while(Bd>0){ Bd=B/10;Bd++; } if(N=A*B) cout<<Ad<<endl; }
a.cc: In function 'int main()': a.cc:25:4: error: expected '}' at end of input 25 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s786988965
p03775
C++
#include<bits/stdc++.h> int lg(int a) { int k = 1; int ret = 1; while (k * 10 <= a) { k *= 10; ret ++; } return ret; } int F(int a, int b) { int c = lg(a); int d = lg(b); return max(c, d); } int main () { int N; cin >> N; int ans = 100; for (int i = 1; i * i <= N; i ++) { if (N % i == 0) { ans = F(i, N / i); } } cout << ans << endl; }
a.cc: In function 'int F(int, int)': a.cc:14:10: error: 'max' was not declared in this scope; did you mean 'std::max'? 14 | return max(c, d); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc: In function 'int main()': a.cc:18:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 18 | cin >> N; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 25 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:25:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 25 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s033800814
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int Max; int Min = 10; for(int i = 1; i <= N; i++){ if(N % i == 0){ string str1 = to_string(i); string str2 = to_string(N/i); Max = max(str1.size(), str2.size()); Min = min(min, max); } } cout << Min << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:22: error: no matching function for call to 'min(<unresolved overloaded function type>, <unresolved overloaded function type>)' 15 | Min = min(min, max); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:15:22: note: couldn't deduce template parameter '_Tp' 15 | Min = min(min, max); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:15:22: note: couldn't deduce template parameter '_Tp' 15 | Min = min(min, max); | ~~~^~~~~~~~~~
s504365125
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n; bool st=true; cin>>n; int a=0; int b; int count=0; for(int i=1;i*i<=n;i++){ a++; } for(int i=a;st;i--){ if(n%a==0){ b=n/a; st=false; } } for(int i=0;b>=10;i++){ b/=10; c++; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:22:3: error: 'c' was not declared in this scope 22 | c++; | ^ a.cc:24:9: error: 'c' was not declared in this scope 24 | cout<<c<<endl; | ^
s335286041
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n; bool st=true; cin>>n; int a=0; int count=0; for(int i=1;i*i<=n;i++){ a++; } for(int i=a;st;i--){ if(n%a==0){ int b=n/a; st=false; } } for(int i=0;b>=10;i++){ b/=10; c++; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:19:13: error: 'b' was not declared in this scope 19 | for(int i=0;b>=10;i++){ | ^ a.cc:21:3: error: 'c' was not declared in this scope 21 | c++; | ^ a.cc:23:9: error: 'c' was not declared in this scope 23 | cout<<c<<endl; | ^
s856881051
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n,b; double a; int c=0; int d; int e=0; cin>>n; a=sqrt(n); b=(long long)a; for(int i=b;c==0;i--){ if(n%i==0){ d=n/i; break; } } for(i=0;d>=10;i++){ e++; d/=10; } cout<<e<<endl; }
a.cc: In function 'int main()': a.cc:19:7: error: 'i' was not declared in this scope 19 | for(i=0;d>=10;i++){ | ^
s197758971
p03775
Java
public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(); List<String> b = new ArrayList<>(); List<Long> c = new ArrayList<>(); int ans = Long.toString(a).length(); for(long i=1; i<=a/2; i++) { if(a%i ==0) { c.add(i); } } for(long e : c) { for(long f: c) { if(a == e*f) { long g = e > f ? e : f; b.add(Long.toString(g)); } } } for(String d : b) { if(ans > d.length()) { ans = d.length(); } } System.out.println(ans); } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol List<String> b = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:6: error: cannot find symbol List<String> b = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol List<Long> c = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:7: error: cannot find symbol List<Long> c = new ArrayList<>(); ^ symbol: class ArrayList location: class Main 6 errors
s813983372
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) typedef long long ll; int calc_digit(long long N) { int res = 0; while (N) { ++res; N /= 10; } return res; } ll calc(ll n){ ll res=pow(10,11); for(int i=1;i*i<=n;i++){ if(n%i==0){ res = min(res,calc_digit(n/i)); } } return res; } int main(){ ll n; cin >> n; auto res = calc(n); cout << res; return 0; }
a.cc: In function 'll calc(ll)': a.cc:19:16: error: no matching function for call to 'min(ll&, int)' 19 | res = min(res,calc_digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 19 | res = min(res,calc_digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:19:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 19 | res = min(res,calc_digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~
s528746390
p03775
C++
# include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) typedef long long ll; ll calc(ll n){ ll res=pow(10,11); for(int i=1;i*i<=n;i++){ if(n%i==0){ res = min(res,n/i); } } return res; } int main(){ ll n; cin << n; auto res = calc(n); cout << res; return 0; }
a.cc: In function 'int main()': a.cc:18:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'll' {aka 'long long int'}) 18 | cin << n; | ~~~ ^~ ~ | | | | | ll {aka long long int} | std::istream {aka std::basic_istream<char>} a.cc:18:7: note: candidate: 'operator<<(int, ll {aka long long int})' (built-in) 18 | cin << n; | ~~~~^~~~ a.cc:18:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:18:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 18 | cin << n; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 18 | cin << n; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits
s469392625
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; ++i) using namespace std; int digit(long long n){ int d = 0; while(n > 0){n /= 10; ++d;} return max(1, d); } int main(){ long long n; int a = 1e9; cin >> n; rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i))); cout << a << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:11:75: error: expected ';' before ')' token 11 | rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i))); | ^ | ;
s548456188
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(long long i = 0; i < n; ++i) using namespace std; long long digit(long long n){ long long d = 0; while(n > 0){n /= 10; ++d;} return max(1, d); } int main(){ long long n, a = 1e15; cin >> n; rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i))); cout << a << "\n"; return 0; }
a.cc: In function 'long long int digit(long long int)': a.cc:7:13: error: no matching function for call to 'max(int, long long int&)' 7 | return max(1, d); | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:7:13: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 7 | return max(1, d); | ~~~^~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 7 | return max(1, d); | ~~~^~~~~~ a.cc: In function 'int main()': a.cc:11:75: error: expected ';' before ')' token 11 | rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i))); | ^ | ;
s134523088
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(long long i = 0; i < n; ++i) using namespace std; int digit(long long n){ int d = 1; while(n > 0){n /= 10; ++d;} return max(1, d); } int main(){ long long n, a = 1e15; cin >> n; rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i)); cout << a << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:11:45: error: no matching function for call to 'min(long long int&, int)' 11 | rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:11:45: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 11 | rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:11:45: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 11 | rep(i, sqrt(n)) if(n % (i+1) == 0) a = min(a, digit(n/(i+1))-digit(n/i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s780362813
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ ll N; cin >> N; int f = 100; int s; for(int i = 1; i <= sqrt(N); i++) { s = 0; int it; if(N % i == 0) { it = N / i; while(it > 0) { it /= 10; s++; } if(f > s) f = s; } } cout << f; return 0; }
a.cc: In function 'int main()': a.cc:5:4: error: 'll' was not declared in this scope 5 | ll N; | ^~ a.cc:6:11: error: 'N' was not declared in this scope 6 | cin >> N; | ^
s061221997
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; #define rep(i,m,n) for(int i=m;i<n;i++) ll mod=1e9+7; int main(){ ll n; cin>>n; ll ans=810; for(ll i=1;i*i<=n;i++){ if(n%i==0){ string s=to_string(i); string t=to_string(n/i); int a=s.size(); int b=t.size(); ans=min(ans,max(a,b)); } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:18:14: error: no matching function for call to 'min(ll&, const int&)' 18 | ans=min(ans,max(a,b)); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:18:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 18 | ans=min(ans,max(a,b)); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:18:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 18 | ans=min(ans,max(a,b)); | ~~~^~~~~~~~~~~~~~
s304655318
p03775
C++
#include <iostream> #include <algorithm> #include <string> #include <queue> #include <cmath> #include <map> #include <iomanip> #include <unordered_map> #include <stack> #include <cstring> using namespace std; typedef long long ll; const ll INF = 1000000007; const ll mod = 998244353; ll check(ll N) { ll ans = INF; for (ll i = 1; i * i <= N; i++) { if (N % i == 0) { ll target = N / i; ll temp = 0; while (target >= 1) { target /= 10; temp++; } ans = min(ans, temp); } } return temp; } int main() { ll N; cin >> N; const auto& res = check(N); cout << res << endl; return 0; }
a.cc: In function 'll check(ll)': a.cc:34:16: error: 'temp' was not declared in this scope; did you mean 'tm'? 34 | return temp; | ^~~~ | tm
s336117451
p03775
C++
#include<bits/stdc++.h> #define LL long long using namespace std; int main(){ LL N; cin>>N; LL A,B,ans=10000000; for(int i=1;i*i<=N;i++){ if(N%i==0){ A=N%i; string a=to_string(A); LL ma=a; ans=min(ans,ma); } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:12:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'long long int' in initialization 12 | LL ma=a; | ^ | | | std::string {aka std::__cxx11::basic_string<char>}
s778428749
p03775
C++
#include<bits/stdc++.h> #define LL long long using namespace std; int main(){ LL N; cin>>N; LL A,B,ans=10000000; for(int i=1;i*i<=N;i++){ if(N%i==0){ A=N%i; string a=to_string(A); ans=min(ans,a.size()); } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:12:14: error: no matching function for call to 'min(long long int&, std::__cxx11::basic_string<char>::size_type)' 12 | ans=min(ans,a.size()); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:12:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 12 | ans=min(ans,a.size()); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:12:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 12 | ans=min(ans,a.size()); | ~~~^~~~~~~~~~~~~~
s272546101
p03775
C
#include<stdio.h> int max(long a,long b){ if(a>b){ return a; }else{ return b; } } int min(long a,long b){ if(a>b){ return b; }else{ return a; } } int f(long a,long b){ long c=max(a,b); int keta=1; for(int i=0;i<10;i++){ if(c/10>0){ keta++; c/=10; } } return keta; } int main(void){ long N=0; int minnum=11; scanf("%ld",&N); for(long a=1;a*a<N;a++){ long b=0; if(N%a == 0){ b=N/a; b=f(a,b); minnum=min(res,minnum); } } printf("%d",minnum); return 0; }
main.c: In function 'main': main.c:44:18: error: 'res' undeclared (first use in this function) 44 | minnum=min(res,minnum); | ^~~ main.c:44:18: note: each undeclared identifier is reported only once for each function it appears in
s543367130
p03775
C
#include<stdio.h> int max(long a,long b){ if(a>b){ return b; }else{ return a; } } int min(long a,long b){ if(a>b){ return b; }else{ return a; } } int f(long a,long b){ c=max(a,b); keta=1; for(int i=0;i<10;i++){ if(c/10>0){ keta++; c/=10; } } return keta; } int main(void){ long long int N=0; int minnum=11; scanf("%lld",&N); for(int a=1;a*a<N;a++){ if(N%a == 0){ int b=N/a; int res=f(a,b); if(res<minnum){ minnum=res; } } } printf("%d",minnum); return 0; }
main.c: In function 'f': main.c:20:3: error: 'c' undeclared (first use in this function) 20 | c=max(a,b); | ^ main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in main.c:21:3: error: 'keta' undeclared (first use in this function) 21 | keta=1; | ^~~~
s349750152
p03775
C
#include<stdio.h> int main(void){ int N=0,A=0,B=0,remA=0,remB=0;ketaA=0,ketaB=0; int res=0,ans=0,min=10000000000; scanf("%d",&N); for(i=1;i<=10000000000;i++){ A=i; if(N%B == 0){ B=N/B; while(remA!=1){ remA = A%10; remA = (A-remA)/10; ketaA++; } while(remB!=1){ remB = A%10; remB = (A-remB)/10; ketaB++; } if(ketaA>ketaB){ res=ketaA; }else{ res=ketaB; } if(min>res){ ans=res; } } } printf("%d",ans); return 0; }
main.c: In function 'main': main.c:4:33: error: 'ketaA' undeclared (first use in this function) 4 | int N=0,A=0,B=0,remA=0,remB=0;ketaA=0,ketaB=0; | ^~~~~ main.c:4:33: note: each undeclared identifier is reported only once for each function it appears in main.c:4:41: error: 'ketaB' undeclared (first use in this function) 4 | int N=0,A=0,B=0,remA=0,remB=0;ketaA=0,ketaB=0; | ^~~~~ main.c:5:23: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow] 5 | int res=0,ans=0,min=10000000000; | ^~~~~~~~~~~ main.c:8:7: error: 'i' undeclared (first use in this function) 8 | for(i=1;i<=10000000000;i++){ | ^
s758792303
p03775
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int _count_digit( long long num){ int count = 1; while(num / 10 > 0){ count++; num /=10; } return count; } int get_large_digit(long long A, long long B){ return max( _count_digit(A), _count_digit(B) ); } int main() { long long N; cin >> N; int ans = INT_MAX; for (long long i = 1; i * i <= N; ++i) { if (N % i == 0) { int tmp = get_large_digit( i, N/i ); ans = min(ans, tmp); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:25:15: error: 'INT_MAX' was not declared in this scope 25 | int ans = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algorithm> +++ |+#include <climits> 4 |
s316485386
p03775
C++
#include <iostream> #include <vector> #include <string> #define rep(i, cc, n) for (int i = cc; i < n; ++i) using ll = long long; int main() { ll N; cin >> N; int ans = cnt_digits(N); for (ll A = 1; A * A <= N; A++) { if (N % A != 0) { continue; } const int cur = max(cnt_digits(A), cnt_digits(N / A)); if (cur > ans) { ans = cur; } } cout << ans << endl; return 0; } int cnt_digits(ll N) { int digits = 0; while (N > 0) { N / 10; digits++; } return digits; }
a.cc: In function 'int main()': a.cc:11:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 11 | cin >> N; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:13:15: error: 'cnt_digits' was not declared in this scope 13 | int ans = cnt_digits(N); | ^~~~~~~~~~ a.cc:22:25: error: 'max' was not declared in this scope; did you mean 'std::max'? 22 | const int cur = max(cnt_digits(A), cnt_digits(N / A)); | ^~~ | std::max In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:30:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 30 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:30:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 30 | cout << ans << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s162075734
p03775
C++
#include <iostream> #include <vector> #include <string> #define rep(i, cc, n) for (int i = cc; i < n; ++i) using ll = long long; using namespace std; int main() { ll N; cin >> N; int ans = cnt_digits(N); for (ll A = 1; A * A <= N; A++) { if (N % A != 0) { continue; } const int cur = max(cnt_digits(A), cnt_digits(N / A)); if (cur > ans) { ans = cur; } } cout << ans; return 0; } int cnt_digits(ll N) { int digits = 0; while (N > 0) { N / 10; digits++; } return digits; }
a.cc: In function 'int main()': a.cc:14:15: error: 'cnt_digits' was not declared in this scope 14 | int ans = cnt_digits(N); | ^~~~~~~~~~
s225741869
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int f(ll x, ll y){ int cnt=0; ll z=max(x,y); while(z>0){ z/=10; cnt++; } return cnt; } int main() { ll n; cin >> n; ll ans=f(n,1); for(ll i=1LL;i*i<n;i++){ if(n%i==0){ ll p=n/i; int e=f(i,p); ans=min(ans,e); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no matching function for call to 'min(ll&, int&)' 22 | ans=min(ans,e); | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:22:15: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 22 | ans=min(ans,e); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:22:15: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 22 | ans=min(ans,e); | ~~~^~~~~~~
s478241896
p03775
C++
include <bits/stdc++.h> using namespace std; typedef long long ll; int f(ll x, ll y){ int cnt=0; ll z=max(x,y); while(z>0){ z/=10; cnt++; } return cnt; } int main() { ll ans=11; ll n; cin >> n; for(ll i=1LL;i*i<n;i++){ if(n%i==0){ const ll p=n/i; const ll e=f(i,p); ans=min(ans,e); } } cout << ans << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int f(ll, ll)': a.cc:7:8: error: 'max' was not declared in this scope 7 | ll z=max(x,y); | ^~~ a.cc: In function 'int main()': a.cc:17:9: error: 'cin' was not declared in this scope 17 | ll n; cin >> n; | ^~~ a.cc:22:12: error: 'min' was not declared in this scope; did you mean 'main'? 22 | ans=min(ans,e); | ^~~ | main a.cc:28:3: error: 'cout' was not declared in this scope 28 | cout << ans << endl; | ^~~~ a.cc:28:18: error: 'endl' was not declared in this scope 28 | cout << ans << endl; | ^~~~
s375378358
p03775
C++
#include <bits/stdc++.h> using namespace std; long long N; int main() { ios_base::sync_with_stdio(0); cin >> N; long long ans = 1e18; for(int i = 1; i * i <= N; i++) { if(N % i == 0) { ans = min(ans, max(log10(i), log10(N / i))); } } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:12:16: error: no matching function for call to 'min(long long int&, const double&)' 12 | ans = min(ans, max(log10(i), log10(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:12:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double') 12 | ans = min(ans, max(log10(i), log10(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:12:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 12 | ans = min(ans, max(log10(i), log10(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s789273312
p03775
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long N = Long.parseLong(sc.next()); sc.close(); int answer = Integer.MAX_VALUE; for(int i = 1; i <= Math.sqrt((double)N); i++) { if(N % i == 0) { long A = i; long B = N / i; int tmp = Math.max(String.valueOf(A).length(), String.valueOf(B).length()); if(tmp < answer) answer = tmp; }else { continue; } } System.out.println(answer); }
Main.java:23: error: reached end of file while parsing } ^ 1 error
s062057872
p03775
C
#include<stdio.h> int keta(int a){ int count = 0; int temp = a; while(temp != 0){ count ++; temp /= 10; } return count; } int main(void){ int n; scanf("%d",&n); int k = (int)sqrt(n,2); int ans; for(int i = k + 1;i > 0;i --){ if(n%i == 0){ int temp = n%i; ans = keta(temp); } } printf("%d\n",ans); return 0; }
main.c: In function 'main': main.c:18:16: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 18 | int k = (int)sqrt(n,2); | ^~~~ main.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt' 1 | #include<stdio.h> +++ |+#include <math.h> 2 | main.c:18:16: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch] 18 | int k = (int)sqrt(n,2); | ^~~~ main.c:18:16: note: include '<math.h>' or provide a declaration of 'sqrt' main.c:18:16: error: too many arguments to function 'sqrt'
s942613580
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) long long solve(long long k){ int ans=0; while(k){ ans++; k/=10; } return ans; } int main(){ long long n; cin >> n; int ans=10; rep(i,100000){ long long u=i+1; if(n%u==0){ ans=min(ans,max(solve(u),solve(n/u))); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:19:14: error: no matching function for call to 'min(int&, const long long int&)' 19 | ans=min(ans,max(solve(u),solve(n/u))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 19 | ans=min(ans,max(solve(u),solve(n/u))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 19 | ans=min(ans,max(solve(u),solve(n/u))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s213695096
p03775
C
/*自分の解答、TLE #include <iostream> #include <string> #include <cmath> //これはlogを使うときに必要 #include <vector> //これは配列(vector)を使うときに必要 #include <math.h> //べき乗を使うときに必要 using namespace std; long long digitbigger(long long a, long long b) { long long d; d = log10(b) + 1; return d; } int main() { long long n; cin >> n; long long ans = digitbigger(1, n); for(int i = 1; i * i <= n; i++) { if(n % i == 0) { ans = min(ans, digitbigger(i, n/i)); } } cout << ans << endl; return 0; } */ //正答例 #include <bits/stdc++.h> using ll=long long; int cnt_digits(ll N) { int digits = 0; while(N > 0) { N /= 10; digits++; } return digits; } int main(void){ ll N; cin >> N; int ans = cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N) for(ll A = 1LL; A * A <= N; ++A){ if(N % A != 0) continue; const ll B = N / A; const int cur = max(cnt_digits(A), cnt_digits(B)); if(ans > cur){ ans = cur; } } cout << ans << endl; return 0; }
main.c:30:10: fatal error: bits/stdc++.h: No such file or directory 30 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s078317073
p03775
C++
/*自分の解答、TLE #include <iostream> #include <string> #include <cmath> //これはlogを使うときに必要 #include <vector> //これは配列(vector)を使うときに必要 #include <math.h> //べき乗を使うときに必要 using namespace std; long long digitbigger(long long a, long long b) { long long d; d = log10(b) + 1; return d; } int main() { long long n; cin >> n; long long ans = digitbigger(1, n); for(int i = 1; i * i <= n; i++) { if(n % i == 0) { ans = min(ans, digitbigger(i, n/i)); } } cout << ans << endl; return 0; } */ //正答例 #include bits/stdc++.h using ll=long long; int cnt_digits(ll N) { int digits = 0; while(N > 0) { N /= 10; digits++; } return digits; } int main(void){ ll N; cin >> N; int ans = cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N) for(ll A = 1LL; A * A <= N; ++A){ if(N % A != 0) continue; const ll B = N / A; const int cur=max(cnt_digits(A),cnt_digits(B)); if(ans>cur){ ans=cur; } } cout << ans << endl; return 0; }
a.cc:30:10: error: #include expects "FILENAME" or <FILENAME> 30 | #include bits/stdc++.h | ^~~~ a.cc: In function 'int main()': a.cc:45:1: error: 'cin' was not declared in this scope 45 | cin >> N; | ^~~ a.cc:51:23: error: 'max' was not declared in this scope 51 | const int cur=max(cnt_digits(A),cnt_digits(B)); | ^~~ a.cc:57:5: error: 'cout' was not declared in this scope 57 | cout << ans << endl; | ^~~~ a.cc:57:20: error: 'endl' was not declared in this scope 57 | cout << ans << endl; | ^~~~
s178325502
p03775
C++
/*自分の解答、TLE #include <iostream> #include <string> #include <cmath> //これはlogを使うときに必要 #include <vector> //これは配列(vector)を使うときに必要 #include <math.h> //べき乗を使うときに必要 using namespace std; long long digitbigger(long long a, long long b) { long long d; d = log10(b) + 1; return d; } int main() { long long n; cin >> n; long long ans = digitbigger(1, n); for(int i = 1; i * i <= n; i++) { if(n % i == 0) { ans = min(ans, digitbigger(i, n/i)); } } cout << ans << endl; return 0; } */ //正答例 using ll=long long; int cnt_digits(ll N) { int digits = 0; while(N > 0) { N /= 10; digits++; } return digits; } int main(void){ ll N; cin >> N; int ans = cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N) for(ll A = 1LL; A * A <= N; ++A){ if(N % A != 0) continue; const ll B = N / A; const int cur=max(cnt_digits(A),cnt_digits(B)); if(ans>cur){ ans=cur; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:44:1: error: 'cin' was not declared in this scope 44 | cin >> N; | ^~~ a.cc:50:23: error: 'max' was not declared in this scope 50 | const int cur=max(cnt_digits(A),cnt_digits(B)); | ^~~ a.cc:56:5: error: 'cout' was not declared in this scope 56 | cout << ans << endl; | ^~~~ a.cc:56:20: error: 'endl' was not declared in this scope 56 | cout << ans << endl; | ^~~~
s010048723
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int F; for(int i = 0; i < 10000000000; i++){ //for(int j = i; j < 10000000000; j++){ if(i /** j*/ == N){ F = to_string(j).length(); goto BREAK; //} } } BREAK: cout << F << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: 'j' was not declared in this scope 11 | F = to_string(j).length(); | ^
s801133871
p03775
C++
#include<bits/stdc++.h> #include<cmath> using namespace std; int main(){ int64_t N; cin >> N ; int_64t ans = 11; for(int64_t i = 1; i*i<=N; i++){ if(N %i == 0){ int64_t B = N/i; int_64t loga = log10(i)+1; int_64t logb = log10(B)+1; } ans = min(ans,max(loga,logb)); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:1: error: 'int_64t' was not declared in this scope; did you mean 'int64_t'? 7 | int_64t ans = 11; | ^~~~~~~ | int64_t a.cc:12:12: error: expected ';' before 'loga' 12 | int_64t loga = log10(i)+1; | ^~~~~ | ; a.cc:13:12: error: expected ';' before 'logb' 13 | int_64t logb = log10(B)+1; | ^~~~~ | ; a.cc:15:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | ans = min(ans,max(loga,logb)); | ^~~ | abs a.cc:15:21: error: 'loga' was not declared in this scope; did you mean 'logl'? 15 | ans = min(ans,max(loga,logb)); | ^~~~ | logl a.cc:19:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 19 | cout << ans << endl; | ^~~ | abs
s696439128
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i; i < n; i++) using namespace std; //桁数を求める int f(int N){ int counter = 0; while(N>0){ N = N - (N%10); N = N/10; counter++; } return counter; } int main(){ int N; cin >> N; vector<int> F; double D = pow(N, 1/2) for(int i = 1; i <= D; i++){ if(N%i==0){ F.push_back(f(i)*f(N/i)); } } int ans = *min_element(F.begin(), F.end()); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:23:3: error: expected ',' or ';' before 'for' 23 | for(int i = 1; i <= D; i++){ | ^~~ a.cc:23:18: error: 'i' was not declared in this scope 23 | for(int i = 1; i <= D; i++){ | ^
s261663460
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i; i < n; i++) using namespace std; //桁数を求める int f(int N){ int counter = 0; while(N>0){ N = N - (N%10); N = N/10; counter++; } } int main(){ int N; cin >> N; vector<int> F; rep(i, pow(N, 1/2)){ if(N%i==0){ F.push_back(f(i)*f(N)); } } int ans = min_element(F.begin(), F.end()); cout << ans << endl; }
a.cc: In function 'int f(int)': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ a.cc: In function 'int main()': a.cc:26:24: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 26 | int ans = min_element(F.begin(), F.end()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> >
s974492626
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i; i < n; i++) using namespace std; //桁数を求める int f(int N){ int counter = 0; while(N>0){ N = N - (N%10); N = N/10; counter++; } } int main(){ int N; cin >> N; vector<int> F; rep(i, pow(N, 1/2)){ if(N%i==0){ F.push_back(f(i)*f(N)); } } int ans = min_element(F.begin(), F.end()) cout << ans << endl; }
a.cc: In function 'int f(int)': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ a.cc: In function 'int main()': a.cc:26:24: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 26 | int ans = min_element(F.begin(), F.end()) | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> >
s755039496
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i; i < n; i++) using namespace std; //桁数を求める int f(int N){ int counter = 0; while(N>0){ N = N - (N%10); N = N/10; counter++; } } int main(){ int N; cin >> N; vector<int> F; rep(i, pow(N, 1/2)){ if(N%i==0){ F.push_back(f(i)*f(N)); } } cout << min_element(F.begin(), F.end()) << endl; }
a.cc: In function 'int f(int)': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ a.cc: In function 'int main()': a.cc:27:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >') 27 | cout << min_element(F.begin(), F.end()) << endl; | ~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = s
s567508735
p03775
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i; i < n; i++) using namespace std; //桁数を求める int f(int N){ int counter = 0; while(N>0){ N = N - (N%10); N = N/10; counter++; } } int main(){ int N; cin >> N; vector<int> F; rep(i, pow(N, 1/2)){ if(N%i==0){ F.push_back(f(i)*f(N)); } } cout << min_element(F.begin(), F.end()); }
a.cc: In function 'int f(int)': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ a.cc: In function 'int main()': a.cc:27:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >') 27 | cout << min_element(F.begin(), F.end()); | ~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basi
s035012388
p03775
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n; int count=0; int min=11; int max_num; cin >> n; int sq = sqrt(n); for (int i = sq; i >0; i--) { if (n % i == 0) { max_num = max(n / i, i); while (max_num>=1) { count++; max_num=max_num / 10; } min = count; break; } count = 0; } cout << min; }
a.cc: In function 'int main()': a.cc:11:18: error: 'sqrt' was not declared in this scope; did you mean 'sq'? 11 | int sq = sqrt(n); | ^~~~ | sq
s195955524
p03775
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n; int count=0; int min=11; int max_num; cin >> n; for (int i = sqrt(n); i >0; i--) { if (n % i == 0) { max_num = max(n / i, i); while (max_num>=1) { count++; max_num=max_num / 10; } min = count; break; } count = 0; } cout << min; }
a.cc: In function 'int main()': a.cc:11:22: error: 'sqrt' was not declared in this scope 11 | for (int i = sqrt(n); i >0; i--) { | ^~~~
s500524087
p03775
C++
#include <iostream> using namespace std; int find_numdigits(int n) { int digits = 0; while (n != 0) { n /= 10; digits++; } return digits; } int main() { int N; cin >> N; int a, b; int min = 10000000000; for (int i = 1; i < N; i++) { for (int j = 1; j < N; j++) { if (i * j == N) { int i_digits = find_numdigits(i); int j_digits = find_numdigits(j); min = min(min, i_digits + j_digits); break; } } } cout << min << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:13: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow] 17 | int min = 10000000000; | ^~~~~~~~~~~ a.cc:23:18: error: 'min' cannot be used as a function 23 | min = min(min, i_digits + j_digits); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
s765715558
p03775
C++
#include <bits.stdc++.h> using namespace std; int f(int a, int b){ string x=to_string(a); string y=to_string(b); return x.size()>y.size() ? x.size() : y.size(); } int main(){ long n; cin>>n; int ans=11; for(int i=1;i<=sqrt(n);i++){ if(n%i==0){ int tmp=f(i,n/i); ans=min(ans,tmp); } } cout<<ans<<endl; }
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory 1 | #include <bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s189163799
p03775
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pb push_back #define f(i,n) for(i=0;i<n;i++) #define F(i,a,b) for(i=a;a<=b;i++) #define arr(a,n) for( i=0;i<n;i++)cin>>a[i]; #define fi first #define se second #define mp make_pair #define mod 1000000007 #define YES cout<<"YES"<<endl; #define Yes cout<<"Yes"<<endl; #define NO cout<<"NO"<<endl; #define No cout<<"No"<<endl; #define yes cout<<"yes"<<endl; #define no cout<<"no"<<endl; #define vi vector<ll> #define ed end() #define bg begin() #define sz size() #define ln length() #define s() sort(a,a+n); #define sr() sort(a,a+n,greater<ll>()); #define v() sort(v.begin(),v.end()); #define vr() sort(v.begin(),v.end(),greater<ll>()); #define mod 1000000007 #define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;} int digit(ll a,ll b) { ll c=0,d=0; while(a>0) { c+=1; a/=10; } while(b>0) { d+=1; b/=10; } if(c>d) return c; else return d; } int main() { */#ifndef ONLINE_JUDGE // for getting input from input.txt freopen("input.txt", "r", stdin); // for writing output to output.txt freopen("output.txt", "w", stdout); #endif*/ /* Ofcourse it's Hard. It's supposed to be Hard. If it's easy everyone would do it. HARD IS WHAT MAKES IT GREAT YESTERDAY U SAID TOMORROW SLOWLY BECOMING THE PERSON I SHOULD HAVE BEEN A LONG TIME AGO SAME TASK CAN'T BE FOUND DIFFICULT TWICE BTBHWSITW SPRH TU KAB P CP IS ALL ABOUT THINKING YOU HAVE MUCH MORE POTENTIAL THAN U THINK AJIT SHIDDAT 10 UR DAILY ROUTINE */ fast(); //ll t;cin>>t;while(t--) { ll n; int mn=INT_MAX; cin>>n; vi v; for(int i=1;i<=sqrt(n);i++) { if(n%i==0) { v.pb(n/i); v.pb(i); } } v() for(int i=0;i<v.size();i++) { for(int j=i+1;j<v.size();j++) { if(v[i]*v[j]==n) { int temp=digit(v[i],v[j]); mn=min(temp,mn); } } } cout<<mn<<endl; } return 0; }
a.cc:51:7: error: stray '#' in program 51 | */#ifndef ONLINE_JUDGE | ^ a.cc:56:6: error: #endif without #if 56 | #endif*/ | ^~~~~ a.cc: In function 'int main()': a.cc:51:6: error: expected primary-expression before '/' token 51 | */#ifndef ONLINE_JUDGE | ^ a.cc:51:8: error: 'ifndef' was not declared in this scope; did you mean 'index'? 51 | */#ifndef ONLINE_JUDGE | ^~~~~~ | index
s541627969
p03775
Java
ckage ABC057; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long a = 1; for(int i=1; i<=Math.sqrt(n); i++) { if(n%i == 0) { a = n/i; } } System.out.println((int)Math.log10(a)+1); } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. ckage ABC057; ^ (use --enable-preview to enable unnamed classes) Main.java:2: error: class, interface, enum, or record expected import java.util.*; ^ Main.java:3: error: class, interface, enum, or record expected import java.math.*; ^ 3 errors
s507015467
p03775
Java
import java.util.*; import java.math.*; public class DigitInMultipication { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = 1; for(int i=1; i<=Math.sqrt(n); i++) { if(n%i == 0) { a = n/i; } } System.out.println((int)Math.log10(a)); } }
Main.java:4: error: class DigitInMultipication is public, should be declared in a file named DigitInMultipication.java public class DigitInMultipication { ^ 1 error
s813559401
p03775
Java
import java.util.*; public class Math { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = 1; for(int i=1; i<=Math.sqrt(n); i++) { if(n%i == 0) { a = n/i; } } System.out.println((int)Math.log10(a)); } }
Main.java:3: error: class Math is public, should be declared in a file named Math.java public class Math { ^ Main.java:11: error: cannot find symbol for(int i=1; i<=Math.sqrt(n); i++) { ^ symbol: method sqrt(int) location: class Math Main.java:19: error: cannot find symbol System.out.println((int)Math.log10(a)); ^ symbol: method log10(int) location: class Math 3 errors
s073871503
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N; cin >> N; double a=sqrt(N); int b; int ans=10000000; for(int i=0;i<a;i++){ if(N%i==0){ b=N/i; int j; double c=exp10(j); while(b%c==0){ j++; } ans=min(j,ans); } } cout << ans+1 << endl; }
a.cc: In function 'int main()': a.cc:15:14: error: invalid operands of types 'int' and 'double' to binary 'operator%' 15 | while(b%c==0){ | ~^~ | | | | | double | int
s426928209
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N; cin >> N; double a=sqrt(N); int b; int ans=10000000000; for(int i=0;i<a;i++){ if(N%i==0){ b=N/i; double c=exp10(j); while(b%c==0){ j++; } ans=min(j,ans); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:11: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow] 9 | int ans=10000000000; | ^~~~~~~~~~~ a.cc:13:22: error: 'j' was not declared in this scope 13 | double c=exp10(j); | ^ a.cc:14:14: error: invalid operands of types 'int' and 'double' to binary 'operator%' 14 | while(b%c==0){ | ~^~ | | | | | double | int
s996617660
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N; cin >> N; double a=sqrt(N); int b; int ans=100000000000; for(int i=0;i<a;i++){ if(N%i==0){ b=N/i; int c; for(int j=0; j;j++){ if(b%exp10(j)==0){c++;} } ans=min(c,ans); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:11: warning: overflow in conversion from 'long int' to 'int' changes value from '100000000000' to '1215752192' [-Woverflow] 9 | int ans=100000000000; | ^~~~~~~~~~~~ a.cc:15:13: error: invalid operands of types 'int' and 'double' to binary 'operator%' 15 | if(b%exp10(j)==0){c++;} | ~^~~~~~~~~ | | | | int double
s672697007
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<long long> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} long long a; for(int i=0;i< a=vec.front(#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<long long> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} long long a; for(int i=0;i<vec.size()/2+1;i++){ a=vec.front(); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc:14:17: error: stray '#' in program 14 | a=vec.front(#include <numeric> | ^ a.cc: In function 'int main()': a.cc:14:18: error: 'include' was not declared in this scope 14 | a=vec.front(#include <numeric> | ^~~~~~~ a.cc:14:27: error: 'numeric' was not declared in this scope 14 | a=vec.front(#include <numeric> | ^~~~~~~ a.cc:16:1: error: expected primary-expression before 'using' 16 | using namespace std; | ^~~~~ a.cc:17:1: error: expected primary-expression before 'int' 17 | int main() { | ^~~ a.cc:16:21: error: expected ')' before 'int' 16 | using namespace std; | ^ | ) 17 | int main() { | ~~~ a.cc:13:8: note: to match this '(' 13 | for(int i=0;i< | ^ a.cc:17:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 17 | int main() { | ^~ a.cc:17:9: note: remove parentheses to default-initialize a variable 17 | int main() { | ^~ | -- a.cc:17:9: note: or replace parentheses with braces to value-initialize a variable a.cc:17:12: error: a function-definition is not allowed here before '{' token 17 | int main() { | ^ a.cc:31:26: error: expected '}' at end of input 31 | cout<<counter<<endl;} | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s102825117
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int counter=0; queue<int> vec; for(int i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} int a,b; b=vec.size(); b=b/2; b=b+1; a=vec.front(b); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:16:16: error: no matching function for call to 'std::queue<int>::front(int&)' 16 | a=vec.front(b); | ~~~~~~~~~^~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]' 231 | front() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; const_reference = const int&]' 243 | front() const | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate expects 0 arguments, 1 provided
s321732524
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<int> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} int a,b; b=vec.size(); b=b/2; b=b+1; a=vec.front(b); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:16:16: error: no matching function for call to 'std::queue<int>::front(int&)' 16 | a=vec.front(b); | ~~~~~~~~~^~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]' 231 | front() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; const_reference = const int&]' 243 | front() const | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate expects 0 arguments, 1 provided
s836842336
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<int> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} int a,b; b=vec.size(); b=b/2; a=vec.front(b+1); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:15:16: error: no matching function for call to 'std::queue<int>::front(int)' 15 | a=vec.front(b+1); | ~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]' 231 | front() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; const_reference = const int&]' 243 | front() const | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate expects 0 arguments, 1 provided
s327379086
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<int> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} int a; a=vec.front(vec.size()/2+1); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:13:16: error: no matching function for call to 'std::queue<int>::front(std::queue<int>::size_type)' 13 | a=vec.front(vec.size()/2+1); | ~~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]' 231 | front() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; const_reference = const int&]' 243 | front() const | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate expects 0 arguments, 1 provided
s877291450
p03775
C++
#include <numeric> #include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<long long> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} long long a; a=vec.front(vec.size()/2+1); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:13:16: error: no matching function for call to 'std::queue<long long int>::front(std::queue<long long int>::size_type)' 13 | a=vec.front(vec.size()/2+1); | ~~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = long long int; _Sequence = std::deque<long long int, std::allocator<long long int> >; reference = long long int&]' 231 | front() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:231:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = long long int; _Sequence = std::deque<long long int, std::allocator<long long int> >; const_reference = const long long int&]' 243 | front() const | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:243:7: note: candidate expects 0 arguments, 1 provided
s875923360
p03775
C++
#include <iostream> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<long long> vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} long long a; a=vec.front(vec.size()/2+1); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:7:5: error: 'queue' was not declared in this scope 7 | queue<long long> vec; | ^~~~~ a.cc:2:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 1 | #include <iostream> +++ |+#include <queue> 2 | using namespace std; a.cc:7:11: error: expected primary-expression before 'long' 7 | queue<long long> vec; | ^~~~ a.cc:10:6: error: 'vec' was not declared in this scope 10 | vec.push(i);}} | ^~~ a.cc:12:7: error: 'vec' was not declared in this scope 12 | a=vec.front(vec.size()/2+1); | ^~~
s358069943
p03775
C++
#include <iostream> using namespace std; int main() { long long N; cin >> N; int counter=0; queue<long long>vec; for(long long i=1;i*i<N;i++){ if(N%i==0){ vec.push(i);}} long long a; a=vec.front(vec.size()/2+1); while(a>0){ a=a/10; counter++;} cout<<counter<<endl;}
a.cc: In function 'int main()': a.cc:7:5: error: 'queue' was not declared in this scope 7 | queue<long long>vec; | ^~~~~ a.cc:2:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 1 | #include <iostream> +++ |+#include <queue> 2 | using namespace std; a.cc:7:11: error: expected primary-expression before 'long' 7 | queue<long long>vec; | ^~~~ a.cc:10:6: error: 'vec' was not declared in this scope 10 | vec.push(i);}} | ^~~ a.cc:12:7: error: 'vec' was not declared in this scope 12 | a=vec.front(vec.size()/2+1); | ^~~
s284573167
p03775
C++
#include<bits/stdc++.h> using namespace std; typedef long long llint; typedef long double ld; #define inf 1e18 #define mod 1000000007 priority_queue<llint,vector<llint>,greater<llint> > que; priority_queue<llint> q; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } vector<llint> v; int calc_digits(llint x){ llint ret=0; while(x){ x/=10; ret++; } return ret; } void solve(){ llint n; cin >> n; llint ans=inf; for(int i=1;i*i<=n;i++){ if(n%i==0){ llint B=n/i; int F=max(calc_digits(i),calc_digits(B)); ans=min(ans,F); } } cout << ans << endl; } int main() { solve(); return 0; }
a.cc: In function 'void solve()': a.cc:31:32: error: no matching function for call to 'min(llint&, int&)' 31 | ans=min(ans,F); | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:31:32: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 31 | ans=min(ans,F); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:31:32: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 31 | ans=min(ans,F); | ~~~^~~~~~~
s521655258
p03775
C++
1000003
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1000003 | ^~~~~~~
s388669148
p03775
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, c) for (int i = 0; i < (int)c; i++) #define all(v) v.begin(), v.end() using ll = long long; using P = pair<int, int>; const int inf = 1000000000; //10^9 const ll MOD = 1e9 + 7; //加算代入演算子は+=!!!!! //int 2^31 10^9まで int calc_digit(ll n) { int res = 0; while (n > 0) { res++; n /= 10; } return res; } int main() { ll N; cin >> N; ll res = inf; for (ll a = 1; a * a <= N; ++a) { if (N % a != 0) { continue; } ll b = n / a; ll temp = max(calc_digit(a), calc_digit(b)); res = min(res, temp); } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:16: error: 'n' was not declared in this scope 31 | ll b = n / a; | ^
s478333677
p03775
C++
//桁数の計算 int calc_digit(ll n) { int res = 0; while (n > 0) { res++; n /= 10; } return res; } int main() { ll n; cin >> n; ll res = inf; for (ll a = 1; a * a <= n; ++a) //素数か調べる ルートnまで順に試し割 { if (n % a != 0) //割り切れなければ以降飛ばす { continue; } ll b = n / a; //a * b = n の変換 ll temp = max(calc_digit(a), calc_digit(b)); //大きい方を取得 res = min(res, temp); //結果は最小値 } cout << res << endl; return 0; }
a.cc:2:16: error: 'll' was not declared in this scope 2 | int calc_digit(ll n) | ^~ a.cc: In function 'int main()': a.cc:15:9: error: 'll' was not declared in this scope 15 | ll n; | ^~ a.cc:16:9: error: 'cin' was not declared in this scope 16 | cin >> n; | ^~~ a.cc:16:16: error: 'n' was not declared in this scope 16 | cin >> n; | ^ a.cc:17:11: error: expected ';' before 'res' 17 | ll res = inf; | ^~~~ | ; a.cc:18:16: error: expected ';' before 'a' 18 | for (ll a = 1; a * a <= n; ++a) //素数か調べる ルートnまで順に試し割 | ^~ | ; a.cc:18:24: error: 'a' was not declared in this scope 18 | for (ll a = 1; a * a <= n; ++a) //素数か調べる ルートnまで順に試し割 | ^ a.cc:24:19: error: expected ';' before 'b' 24 | ll b = n / a; //a * b = n の変換 | ^~ | ; a.cc:25:19: error: expected ';' before 'temp' 25 | ll temp = max(calc_digit(a), calc_digit(b)); //大きい方を取得 | ^~~~~ | ; a.cc:26:17: error: 'res' was not declared in this scope 26 | res = min(res, temp); //結果は最小値 | ^~~ a.cc:26:32: error: 'temp' was not declared in this scope 26 | res = min(res, temp); //結果は最小値 | ^~~~ a.cc:26:23: error: 'min' was not declared in this scope; did you mean 'main'? 26 | res = min(res, temp); //結果は最小値 | ^~~ | main a.cc:28:9: error: 'cout' was not declared in this scope 28 | cout << res << endl; | ^~~~ a.cc:28:17: error: 'res' was not declared in this scope 28 | cout << res << endl; | ^~~ a.cc:28:24: error: 'endl' was not declared in this scope 28 | cout << res << endl; | ^~~~
s122842161
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int N; cin >> N; int ans = to_string(N).size(); for(long long int i = 1; i*i<=N;i++){ if (N%i == 0){ ans = min(ans,max(to_string(i).size(),to_string(N/i).size())); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:26: error: no matching function for call to 'min(int&, const long unsigned int&)' 10 | ans = min(ans,max(to_string(i).size(),to_string(N/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:10:26: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 10 | ans = min(ans,max(to_string(i).size(),to_string(N/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:10:26: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 10 | ans = min(ans,max(to_string(i).size(),to_string(N/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s498269330
p03775
C++
#include <bits/stdc++.h> using namespace std; int count_digits(int n){ digits = 1; while(n / 10 > 0){ digits++; n /= 10; } return digits; } int max_digits(int a, int b) { int digits_1, digits_2; digits_1 = count_digits(a); digits_2 = count_digits(b); if (digits_1 > digits_2) { return digits_1; } else { return digits_2; } } int main() { int N; cin >> N; int ans = 0; int digits; for (int A = 1; A <= sqrt(N); A++) { if(N % A != 0) { continue; } else { int B = N / A; digits = max_digits(A, B); if (digits > ans) { ans = digits; } } } cout << ans << endl; }
a.cc: In function 'int count_digits(int)': a.cc:6:3: error: 'digits' was not declared in this scope 6 | digits = 1; | ^~~~~~
s150092671
p03775
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ABC057_C { class Program { static void Main(string[] args) { var number = long.Parse(Console.ReadLine()); var square = Math.Sqrt(number); var func = new List<double>(); for (int a = 1; a <= square; a++) { if (number % a == 0) { double b = number / a; double max = Math.Max(a, (long)b); func.Add(Math.Log10(max) + 1); } } func.Sort(); Console.WriteLine((int)func[0]); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:28:6: error: expected ';' after class definition 28 | } | ^ | ; a.cc: In static member function 'static void ABC057_C::Program::Main(int*)': a.cc:13:13: error: 'var' was not declared in this scope 13 | var number = long.Parse(Console.ReadLine()); | ^~~ a.cc:14:17: error: expected ';' before 'square' 14 | var square = Math.Sqrt(number); | ^~~~~~ a.cc:15:17: error: expected ';' before 'func' 15 | var func = new List<double>(); | ^~~~ a.cc:16:34: error: 'square' was not declared in this scope 16 | for (int a = 1; a <= square; a++) | ^~~~~~ a.cc:18:21: error: 'number' was not declared in this scope 18 | if (number % a == 0) | ^~~~~~ a.cc:21:34: error: 'Math' was not declared in this scope 21 | double max = Math.Max(a, (long)b); | ^~~~ a.cc:22:21: error: 'func' was not declared in this scope 22 | func.Add(Math.Log10(max) + 1); | ^~~~ a.cc:25:13: error: 'func' was not declared in this scope 25 | func.Sort(); | ^~~~ a.cc:26:13: error: 'Console' was not declared in this scope 26 | Console.WriteLine((int)func[0]); | ^~~~~~~
s954012079
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,f=114514; cin >>n; for(int i=1;i<(n+2)/2;i++){ if(n%i != 0) continue; int b = n/i; f = max(f,max(to_string(i).size(),to_string(b).size())); } }
a.cc: In function 'int main()': a.cc:10:12: error: no matching function for call to 'max(int&, const long unsigned int&)' 10 | f = max(f,max(to_string(i).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:10:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 10 | f = max(f,max(to_string(i).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:10:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 10 | f = max(f,max(to_string(i).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s594105323
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int F(ll a, ll b) { int x = max(a, b); for(int i = 1; true; i++) { x /= 10; if(x == 0) return i; } } int main() { ll N, t = 11; cin >> N; for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, (ll)(N / i))); cout << t << endl; }
a.cc: In function 'int main()': a.cc:14:57: error: no matching function for call to 'min(ll&, int)' 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, (ll)(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:14:57: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, (ll)(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:14:57: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, (ll)(N / i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~
s942951606
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int F(ll a, ll b) { int x = max(a, b); for(int i = 1; true; i++) { x /= 10; if(x == 0) return i; } } int main() { ll N, t = 11; cin >> N; for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, N / i)); cout << t << endl; }
a.cc: In function 'int main()': a.cc:14:57: error: no matching function for call to 'min(ll&, int)' 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, N / i)); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:14:57: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, N / i)); | ~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:14:57: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 14 | for(ll i = 1; i <= 100000; i++) if(N % i == 0) t = min(t, F(i, N / i)); | ~~~^~~~~~~~~~~~~~~~
s106546055
p03775
C++
#include<iostream> #include<cmath> #include<array> #include<vector> #include<climits> using namespace std; int main() { int n; cin >> n; int res = INT_MAX; for (int i=1; i*i<=n; ++i) { if(n%i == 0) { auto e = max(log10(i), log10(n/i)); res = min(res, e); } } cout << res+1 << endl; }
a.cc: In function 'int main()': a.cc:16:16: error: no matching function for call to 'min(int&, double&)' 16 | res = min(res, e); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:16:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 16 | res = min(res, e); | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
s730159998
p03775
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); Long N = sc.nextLong(); Long sq = (long) Math.floor(sqrt(N)); for(long i = sq; i > 0; i--){ if(N%sq==0){ if(sq>N%sq){ System.out.println(String.valueOf(sq).length()); return; }else{ System.out.println(String.valueOf(N%sq).length()); return; } } } System.out.println(String.valueOf(N).length()); } }
Main.java:7: error: cannot find symbol Long sq = (long) Math.floor(sqrt(N)); ^ symbol: method sqrt(Long) location: class Main 1 error
s486976448
p03775
C++
#include <bits/stdc++.h> #include<iostream> #include<vector> #include <cmath> #include <map> #include <algorithm> #include <string> #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; using namespace std; #define P pair<int, int> unsigned GetDigit(unsigned num){ unsigned digit=0; while(num!=0){ num /= 10; digit++; } return digit; } int main () { ll N ; cin >> N ; ll ki ; ki = pow(N , 0.5) ; ll ans = 1 ; for(lli = 1 ; i < ki ; i++){ if(N % i == 0 && ans < i){ ans = i ; } } ll a , b ; a = GetDigit(ans) ; b = GetDigit(N / ans) ; cout << max(a , b ) << endl; return 0 ; }
a.cc: In function 'int main()': a.cc:27:9: error: 'lli' was not declared in this scope; did you mean 'll'? 27 | for(lli = 1 ; i < ki ; i++){ | ^~~ | ll a.cc:27:19: error: 'i' was not declared in this scope; did you mean 'ki'? 27 | for(lli = 1 ; i < ki ; i++){ | ^ | ki
s645245315
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int ans=10000; for(long long i=1;i*i<=n;i++){ if(n%i==0){ long long b=n/i; long long a=i; int digitsb=0; int digitsa=0; while(b>0){ b/=10; digitsb++; } while(a>0){ a/=10; digitsa++; } int max=max(digitsb,digitsa); if(ans>max)ans=max; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:21:20: error: 'max' cannot be used as a function 21 | int max=max(digitsb,digitsa); | ~~~^~~~~~~~~~~~~~~~~
s761009247
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int ans=10000; for(long long i=1;i*i<=n;i++){ if(n%i==0){ long long b=n/i; long long a=i; int digitsb=0; int digitsa=0; while(b>0){ b/=10 digitsb++; } while(a>0){ a/=10; digitsa++; } int max=max(digitsb,digitsa); if(ans>max)ans=max; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: expected ';' before 'digitsb' 14 | b/=10 | ^ | ; 15 | digitsb++; | ~~~~~~~ a.cc:21:20: error: 'max' cannot be used as a function 21 | int max=max(digitsb,digitsa); | ~~~^~~~~~~~~~~~~~~~~
s935262432
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int ans=10000; for(long long i=1;i*i<=n;i++){ if(n%i==0){ long long b=n/i; long long a=i; int digitsb=0; int digitsa=0; while(b>0){ b/=10 digitsb++; } while(a>0){ a/=10; digitsa++; } int max=max(digitsb,digitsa); if(ans>max)ans=max; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: expected ';' before 'digitsb' 14 | b/=10 | ^ | ; 15 | digitsb++; | ~~~~~~~ a.cc:21:20: error: 'max' cannot be used as a function 21 | int max=max(digitsb,digitsa); | ~~~^~~~~~~~~~~~~~~~~
s409528218
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; int ans=10000; for(long long i=1;i*i<=n;i++){ if(n%i==0){ long long b=n/i; long long a=i; int digitsb=0; int digitsa=0 while(b>0){ b/=10 digitsb++; } while(a>0){ a/=10 digitsa++; } int max=max(digitsb,digitsa); if(ans>max)ans=max; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:9: error: expected ',' or ';' before 'while' 13 | while(b>0){ | ^~~~~ a.cc:18:18: error: expected ';' before 'digitsa' 18 | a/=10 | ^ | ; 19 | digitsa++; | ~~~~~~~ a.cc:21:20: error: 'max' cannot be used as a function 21 | int max=max(digitsb,digitsa); | ~~~^~~~~~~~~~~~~~~~~
s206164213
p03775
C++
#include<bits/stdc++.h> using namespace std; int main() { long long n,min,l=0; cin>>n; for(int i=floor(sqrt(n));i>=1;i--) if(n%i==0) { min=i; break; } } while(min!=0) { min/=10; l++; } cout<<l<<endl; return 0; }
a.cc:14:5: error: expected unqualified-id before 'while' 14 | while(min!=0) | ^~~~~ a.cc:19:5: error: 'cout' does not name a type 19 | cout<<l<<endl; | ^~~~ a.cc:20:5: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s407168929
p03775
C++
#include<bits/stdc++.h> using namespace std; int main() { long long n,min,l=0; cin>>n; for(int i=floor(sqrt(n));i>=1;i--) if(n%i==0) { min=i; break; } } while(min!=0) { min/=10; l++; } cout<<l<<endl; return 0; }
a.cc:14:5: error: expected unqualified-id before 'while' 14 | while(min!=0) | ^~~~~ a.cc:19:5: error: 'cout' does not name a type 19 | cout<<l<<endl; | ^~~~ a.cc:20:5: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^