submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s273823589
p03775
C
#include <bits/stdc++.h> using namespace std; int main(){ long long ans=114514,n,tmp; string s,t; cin >> n; for(int i=1;i<=sqrt(n);i++){ if(n%i==0){ s=to_string(n/i); t=to_string(i); if(s.size()>t.size()){ tmp=s.size(); }else{ tmp=t.size(); } ans=min(ans,tmp); } } cout << ans << endl; return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s715373300
p03775
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #define MAX 100000000 using namespace std; int main (void) { int n,N; cin >> N; n=sqrt(N); int ans=MAX; int b=0; int size1=0, size2=0; for (int i=1; i<=n; i++) { if (N%i==0) { b=N/i; to_string(i); to_string(b); size1=i.size(); size2=b.size(); size3=max(size1,size2); ans=min(ans, size3); } } cout << ans; }
a.cc: In function 'int main()': a.cc:19:16: warning: ignoring return value of 'std::string std::__cxx11::to_string(int)', declared with attribute 'nodiscard' [-Wunused-result] 19 | to_string(i); | ~~~~~~~~~^~~ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:4240:3: note: declared here 4240 | to_string(int __val) | ^~~~~~~~~ a.cc:20:16: warning: ignoring return value of 'std::string std::__cxx11::to_string(int)', declared with attribute 'nodiscard' [-Wunused-result] 20 | to_string(b); | ~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:4240:3: note: declared here 4240 | to_string(int __val) | ^~~~~~~~~ a.cc:21:15: error: request for member 'size' in 'i', which is of non-class type 'int' 21 | size1=i.size(); | ^~~~ a.cc:22:15: error: request for member 'size' in 'b', which is of non-class type 'int' 22 | size2=b.size(); | ^~~~ a.cc:23:7: error: 'size3' was not declared in this scope; did you mean 'size2'? 23 | size3=max(size1,size2); | ^~~~~ | size2
s813721745
p03775
C++
#include<iostream> #include<math.h> using namespace std; int main(){ _int64 n; cin>>n; int b; for(int i =1;i <=sqrt(n);i++){ if(n%i==0){ b=n/i; } } int ans=0; for(;b>0;){ b=b/10; ans++; } cout<<ans; }
a.cc: In function 'int main()': a.cc:5:9: error: '\U0000ff3fint64' was not declared in this scope 5 | _int64 n; | ^~~~~~~ a.cc:6:14: error: 'n' was not declared in this scope; did you mean 'yn'? 6 | cin>>n; | ^ | yn
s677794437
p03775
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; int main(){ long long N; cin >> N; int max = int(sqrt(N)); int fmin_other = 1; for (int i = 2; i < max + 1; i++) { if (N % i == 0) { fmin_other = i; } } int fmin = N / fmin_other; int keta = 0; for (int i = 1; i < N * 10; i = i * 10) { keta++; if (fmin / i == 0) { cout << keta - 1 << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:11:23: error: 'sqrt' was not declared in this scope 11 | int max = int(sqrt(N)); | ^~~~
s036670504
p03775
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; int main(){ long long N; cin >> N; int max = int(sqrt(N)); int fmin_other = 1; for (int i = 2; i < max + 1; i++) { if (N % i == 0) { fmin_other = i; } } int fmin = N / fmin_other; int keta = 0; for (int i = 1; i < N * 10; i = i * 10) { keta++; if (fmin / i == 0) { cout << keta - 1 << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:11:23: error: 'sqrt' was not declared in this scope 11 | int max = int(sqrt(N)); | ^~~~
s903999926
p03775
C++
#include<iostream> #include<stdio.h> #include<algorithm> #include<string> #include<cmath> #include<vector> #include<functional> #include<stack> #include<utility> #include<map> #include<queue> using namespace std; int main() { long long n,fmin=100000000000; cin >> n; for (long long i = 1; i*i <= n; i++) { if (n%i == 0) { fmin = min(fmin, max(long long(log10(i))+1, long long(log10(n / i))+1)); } } cout << fmin << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:46: error: expected primary-expression before 'long' 20 | fmin = min(fmin, max(long long(log10(i))+1, long long(log10(n / i))+1)); | ^~~~ a.cc:20:69: error: expected primary-expression before 'long' 20 | fmin = min(fmin, max(long long(log10(i))+1, long long(log10(n / i))+1)); | ^~~~
s286223649
p03775
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 using namespace std; // int main(){ long long N,cnt=0; cin>>N; for(int i=sqrt(N);i>0;i--){ if(N%i==0){ int A=max(i,N/i); while(A/10){ cnt++; A/=10; } cout<<cnt+1<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:30:16: error: no matching function for call to 'max(int&, long long int)' 30 | int A=max(i,N/i); | ~~~^~~~~~~ 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: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:30:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 30 | int 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, from a.cc:3: /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:30:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 30 | int A=max(i,N/i); | ~~~^~~~~~~
s514489298
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main () { ll N; cin >> N; ll ans = INT_MAX; for(int i=2; i*i<=N; i++) { if( N%i == 0 ) { ans = min(ans,max(log10(i),log10(N/i))); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:22: error: no matching function for call to 'min(ll&, 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:22: 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:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 12 | ans = min(ans,max(log10(i),log10(N/i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s757498334
p03775
C++
#include <iostream> #include "string.h" #include <vector> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> #include <map> #include <stack> #include <queue> #include <set> using namespace std; #define MAX_N 2000000 #define ll long long ll N; unsigned long long gcd(unsigned long long a,unsigned long long b){ if(b == 0) return a; return gcd(b,a % b); } unsigned long long lcm(unsigned long long a,unsigned long long b){ if(a == b) return a; return a / gcd(a,b) * b; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> N; int ans = INT_MAX; for(ll i = 1LL;i*i <= N;++i){ if(N % i == 0){ string aa = to_string(N / i); string bb = to_string(i); int a = aa.length(); int b = bb.length(); ans = min(ans,max(a,b)); cout << ans << endl; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:19: error: 'INT_MAX' was not declared in this scope 34 | int ans = INT_MAX; | ^~~~~~~ a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <set> +++ |+#include <climits> 12 |
s720607147
p03775
C++
using namespace std; size_t max_len(uint64_t a, uint64_t b) { return max(to_string(a).size(), to_string(b).size()); } int32_t main() { uint64_t N; cin >> N; uint64_t n = (uint64_t)sqrt(N); uint64_t m = 0; for (uint64_t i = 1; i <= n; i++) { if ((N % i) == 0) { m = max(m, max_len(i, N / i)); } } cout << m << endl; return 0; }
a.cc:3:1: error: 'size_t' does not name a type 3 | size_t max_len(uint64_t a, uint64_t b) | ^~~~~~ a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | using namespace std; a.cc:8:1: error: 'int32_t' does not name a type 8 | int32_t main() | ^~~~~~~ a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' +++ |+#include <cstdint> 1 | using namespace std;
s448160549
p03775
C
#include <stdio.h> int main() { long n, a, b, i, result; scanf("%ld", &N); for(a = 1; a*a <= n; a++) { if(n%a == 0) { b = n/a; i = 0; while(b > 0) { b /= 10; i++; } if(i < n) { result = i; } } } printf("%ld\n", result); return 0; }
main.c: In function 'main': main.c:5:21: error: 'N' undeclared (first use in this function) 5 | scanf("%ld", &N); | ^ main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
s999557983
p03775
C
#include <stdio.h> //#define BUFSIZE 100 int f(long int x, long int y); int main() { long int n, a, b int min, r; scanf("%ld",&n); if(n<1 || n>10000000000){ printf("error\n"); return 1; } a = 1; b = n; min = f(a,b); while(a <= b){ do{ a++; }while(n % a != 0); b = n / a; r = f(a,b); if(r < min) min = r; } printf("%d",min); return 0; } int f(long int x, long int y){ /*char buf[BUFSIZE]; if(x >= y) return sprintf(buf,"%ld",x); else return sprintf(buf,"%ld",y);*/ int c = 0; if(x >= y){ while(x>0){ x = x / 10; c++; } } else{ while(y>0){ y = y / 10; c++; } } return c; }
main.c: In function 'main': main.c:8:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' 8 | int min, r; | ^~~ main.c:15:17: error: 'b' undeclared (first use in this function) 15 | b = n; | ^ main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in main.c:16:17: error: 'min' undeclared (first use in this function); did you mean 'main'? 16 | min = f(a,b); | ^~~ | main main.c:22:25: error: 'r' undeclared (first use in this function) 22 | r = f(a,b); | ^
s065668448
p03775
C
#include <stdio.h> //#define BUFSIZE 1024 int f(int x, int y); int main() { int n, a, b, min, r; scanf("%d",&n); if(n<1 || n>10000000000){ printf("error\n"); return 1; } a = 1; b = n; min = f(a,b); while(a < b){ do{ a++; }while(n % a != 0); b = n / a; r = f(a,b); if(r < min) min = r; } printf("%d",min); return 0; } int f(int x, int y){ /*char buf[BUFSIZE]; if(x >= y) return sprintf(buf,"%u",x); else return sprintf(buf,"%u",y);*/ int c = 0; if(x >= y){ while(x>0){ x = x / 10; c++; } } else{ while(y>0){ y = y / 10; c++; } } return c;
main.c: In function 'f': main.c:45:17: error: expected declaration or statement at end of input 45 | return c; | ^~~~~~
s090232422
p03775
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> #include<cmath> using namespace std; int main(void) { long long N; cin >> N; unsigned int ret = to_string(N).size(); for(long long i=2; i<sqrt(N)+1; i++) { if(N%i != 0) continue; ret = min(ret, max(to_string(i).size(), to_string(N/i).size())); } cout << ret << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:26: error: no matching function for call to 'min(unsigned int&, const long unsigned int&)' 19 | ret = min(ret, max(to_string(i).size(), to_string(N/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:19:26: note: deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'long unsigned int') 19 | ret = min(ret, 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
s388846395
p03775
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int digit (long long a) { int d; for(d=0; a; d++){ a /= 10; } return d; } int main() { long long n; cin >> n; int dig = 0; for(long long i=1; i<=sqrt(n)+1; i++){ if(n % i == 0){ dig = max(digit(i), digit(n/i)); ans = min(ans, dig); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 27 | ans = min(ans, dig); | ^~~ | abs a.cc:31:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 31 | cout << ans << endl; | ^~~ | abs
s237697803
p03775
C
#include <stdio.h> #include <stdlib.h> #include <math.h> long int digit(long int num){ long int dig=0; while (num!=0) { dig++; num/=10; } return dig; } int main() { int j=0; long int N,i,flag,a=1,b=1; scanf("%ld",&N); flag=N; for(i=2;i<=(long int)sqrt(N);i++){ while (flag%i==0) { a<b?(a*=i):(b*=i); flag/=i; } if(flag==1) break; } if(flag==N){ flag=digit(flag); printf("%ld\n",flag); } else if(flag==1){ printf("%ld\n",a<b?digit(b):digit(a)); } else{ if(a<flag&&b<flag){ a<b?(a*=flag):(b*=flag); a*=b; b=flag; } else a<b?(a*=flag):(b*=flag); printf("%ld\n",a<b?digit(b):digit(a)); } free(box); return 0; }
main.c: In function 'main': main.c:43:10: error: 'box' undeclared (first use in this function) 43 | free(box); | ^~~ main.c:43:10: note: each undeclared identifier is reported only once for each function it appears in
s488726850
p03775
C++
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; bool IsPrime(long long num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } int main(){ long long n; cin >> n; if(IsPrime(n)==true){ cout << to_string(n).length() << endl; } else{ int max[2]; for(int i=2; i<=n/2; i++){ for(int k=1; k<n; k++){ if(i*k==n){ max[0]=i; max[1]=k; break; } } } cout << max(to_string(max[0]).length(),to_string(max[1]).length()) << endl; } }
a.cc: In function 'int main()': a.cc:42:28: error: 'max' cannot be used as a function 42 | cout << max(to_string(max[0]).length(),to_string(max[1]).length()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s723472218
p03775
C++
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; bool IsPrime(long long num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } int main(){ long long n; cin >> n; if(IsPrime(n)==true){ cout << to_string(n).length << endl; } else{ int max[2]; for(int i=2; i<=n/2; i++){ for(int k=1; k<n; k++){ if(i*k==n){ max[0]=i; max[1]=k; break; } } } cout << max(to_string(max[0]).length,to_string(max[1]).length) << endl; } }
a.cc: In function 'int main()': a.cc:29:22: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 29 | cout << to_string(n).length << endl; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:1083:7: note: declared here 1083 | length() const _GLIBCXX_NOEXCEPT | ^~~~~~ a.cc:42:28: error: 'max' cannot be used as a function 42 | cout << max(to_string(max[0]).length,to_string(max[1]).length) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s669370856
p03775
Java
import java.util.Scanner; public class Main2{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextInt(); double sqrtN = Math.sqrt(n); int min = String.valueOf(n).length(); for(int i=1; i <= sqrtN; i++){ if(n % i == 0) min = Math.min(min, String.valueOf(n / i).length()); } System.out.println(min); } }
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2{ ^ 1 error
s658148663
p03775
C++
#include<iostream> #include <cstdlib> #include<list> #include<stdio.h> #include<vector> #include<algorithm> #include<string> #include<stack> using namespace std; int main() { //cout << 1 / 10 << endl; long long n; cin >> n; bool zz = false; long long mini=100000000; long long hh = sqrt(n) + 1; for (long long i =hh; i >=1; i--) { if (n%i==0) {long long count = 0,zz=0; long long d = n / i; while (d != 0) { //cout << d <<"d"<< endl; d = d / 10; count++; } long long z = i; while (z != 0) { // cout << z << "s" << endl; z =z/10; zz++; }//cout << count << endl; cout << max(zz, count) << endl; zz = true; break; } if (zz) { break; } } return 0; }
a.cc: In function 'int main()': a.cc:14:24: error: 'sqrt' was not declared in this scope 14 | long long hh = sqrt(n) + 1; | ^~~~
s959589467
p03775
C++
#include<iostream> #include <cstdlib> #include<list> #include<stdio.h> #include<vector> #include<algorithm> #include<string> #include<stack> using namespace std; int main() { //cout << 1 / 10 << endl; long long n; cin >> n; bool zz = false; long long mini=100000000; long long hh = sqrt(n) + 1; for (long long i =hh; i >=1; i--) { if (n%i==0) {long long count = 0,zz=0; long long d = n / i; while (d != 0) { //cout << d <<"d"<< endl; d = d / 10; count++; } long long z = i; while (z != 0) { // cout << z << "s" << endl; z =z/10; zz++; }//cout << count << endl; cout << max(zz, count) << endl; zz = true; break; } if (zz) { break; } } }
a.cc: In function 'int main()': a.cc:14:24: error: 'sqrt' was not declared in this scope 14 | long long hh = sqrt(n) + 1; | ^~~~
s106558632
p03775
C++
#include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main(void) { unsigned long long n, max, ans = 999999999; cin >> n; max = sqrt((double)n); for (unsigned long long i = 1; i <= max; i++) { if ((n % i) == 0 && ans > (log10(double(n / i)) + 1)) ans = log10(double(n / i)) + 1; } cout << ans << endl; r\\eturn 0; }
a.cc:17:18: error: stray '\' in program 17 | r\\eturn 0; | ^ a.cc:17:19: error: stray '\' in program 17 | r\\eturn 0; | ^ a.cc: In function 'int main()': a.cc:17:17: error: 'r' was not declared in this scope 17 | r\\eturn 0; | ^
s418286125
p03775
C++
#include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main(void) { unsinged long long n, max, ans = 999999999; cin >> n; max = sqrt((double)n); for (int i = 1; i <= max; i++) { if ((n % i) == 0 && ans > (log10(n / i) + 1)) ans = log10(n / i) + 1; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'? 8 | unsinged long long n, max, ans = 999999999; | ^~~~~~~~ | unsigned a.cc:9:8: error: 'n' was not declared in this scope; did you mean 'yn'? 9 | cin >> n; | ^ | yn a.cc:11:35: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<=' 11 | for (int i = 1; i <= max; i++) | ~~^~~~~~ a.cc:13:37: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | if ((n % i) == 0 && ans > (log10(n / i) + 1)) ans = log10(n / i) + 1; | ^~~ | abs a.cc:15:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | cout << ans << endl; | ^~~ | abs
s497262179
p03775
C++
#include <iostream> #include <stdlib> #include <cmath> using namespace std; int main(void) { int n, a, b, max, ans = 9999999999999; max = sqrt((double)n); for (int i = 1; i <= max; i++) if (n % i) ans = min(ans, log10(n / i) + 1); cout << ans << endl; return 0; }
a.cc:2:14: fatal error: stdlib: No such file or directory 2 | #include <stdlib> | ^~~~~~~~ compilation terminated.
s106124082
p03775
C++
#include <iostream> #include <stdlib> #include <cmath> using namespace std; int main(void) { int n, a, b, max, ans = 9999999999999; max = sqrt((double)n); for (int i = 1; i <= MAX; i++) if (n % i) ans = min(ans, log10(N / i) + 1); cout << ans << endl; return 0; }
a.cc:2:10: fatal error: stdlib: No such file or directory 2 | #include <stdlib> | ^~~~~~~~ compilation terminated.
s913009069
p03775
C++
#include <iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<string> #include<stack> #include <queue> #include<algorithm> typedef long long int ll; using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define REP(i,n) for (int i=0;i<(n);i++) #define EREP(i,n) for (int i=1;i<=(n);i++) const ll MOD = 1000000007; ll N,sum=0,ans,c; int main(){ ios_base::sync_with_stdio(false); cin>>N; ll MAX=sqrt(double(N)); EREP(i,MAX){ if(N%i==0){ ll A=max((ll)N,(ll)N/i); ans=min(log10(A)+1,ans); } } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:25:16: error: no matching function for call to 'min(__gnu_cxx::__enable_if<true, double>::__type, ll&)' 25 | ans=min(log10(A)+1,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:25:16: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'll' {aka 'long long int'}) 25 | ans=min(log10(A)+1,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:9: /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:25:16: note: mismatched types 'std::initializer_list<_Tp>' and 'double' 25 | ans=min(log10(A)+1,ans); | ~~~^~~~~~~~~~~~~~~~
s543632061
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, l, m = 9999999999999; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if((N % i)==0 ){ l = ten(N/i); if(l < m) m = l; } } cout << m; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:24:20: error: 'in' was not declared in this scope; did you mean 'i'? 24 | if(in == 0) break; | ^~ | i
s274107680
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, l, max = 9999999999999; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if((N % i)==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:14:32: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:14:37: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:17:17: error: reference to 'max' is ambiguous 17 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:24:20: error: 'in' was not declared in this scope; did you mean 'i'? 24 | if(in == 0) break; | ^~ | i
s872214626
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, l, max = 9999999999999; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:14:32: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:14:37: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:17:17: error: reference to 'max' is ambiguous 17 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:34: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:24:20: error: 'in' was not declared in this scope; did you mean 'i'? 24 | if(in == 0) break; | ^~ | i
s850321245
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, l, max = 9999999999999; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:14:32: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:14:37: error: reference to 'max' is ambiguous 14 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:17:17: error: reference to 'max' is ambiguous 17 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:24:20: error: 'in' was not declared in this scope; did you mean 'i'? 24 | if(in == 0) break; | ^~ | i
s120744864
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, l, max = 9999999999999; int l; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc:7:5: error: conflicting declaration 'int l' 7 | int l; | ^ a.cc:6:27: note: previous declaration as 'long long unsigned int l' 6 | unsigned long long int N, l, max = 9999999999999; | ^ a.cc: In function 'int main()': a.cc:15:32: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:15:37: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:30: note: 'long long unsigned int max' 6 | unsigned long long int N, l, max = 9999999999999; | ^~~ a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:25:20: error: 'in' was not declared in this scope; did you mean 'i'? 25 | if(in == 0) break; | ^~ | i
s441613264
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, max = 9999999999999, l; int l; unsigned long long int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } unsigned long long int ten(unsigned long long int ou){ unsigned long long int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc:7:5: error: conflicting declaration 'int l' 7 | int l; | ^ a.cc:6:48: note: previous declaration as 'long long unsigned int l' 6 | unsigned long long int N, max = 9999999999999, l; | ^ a.cc: In function 'int main()': a.cc:15:32: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999, l; | ^~~ a.cc:15:37: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999, l; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999, l; | ^~~ a.cc: In function 'long long unsigned int ten(long long unsigned int)': a.cc:25:20: error: 'in' was not declared in this scope; did you mean 'i'? 25 | if(in == 0) break; | ^~ | i
s695251453
p03775
C++
#include<iostream> #include<cmath> using namespace std; unsigned long long int N, max = 9999999999999; int l; int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int ou){ int i; for(i = 1; ;i++){ ou /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:15:32: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:15:37: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:27: note: 'long long unsigned int max' 6 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc: In function 'int ten(long long unsigned int)': a.cc:25:20: error: 'in' was not declared in this scope; did you mean 'i'? 25 | if(in == 0) break; | ^~ | i
s235955889
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; unsigned long long int N, max = 9999999999999; int l; int ten(unsigned long long int ou); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int ou){ int i; for(i = 1; ;i++){ in /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:16:32: error: reference to 'max' is ambiguous 16 | if(l < max) max = l; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ 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:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:16:37: error: reference to 'max' is ambiguous 16 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:19:17: error: reference to 'max' is ambiguous 19 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc: In function 'int ten(long long unsigned int)': a.cc:25:17: error: 'in' was not declared in this scope; did you mean 'i'? 25 | in /= 10; | ^~ | i
s442678938
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; unsigned long long int N, max = 9999999999999; int l; int ten(unsigned long long int in); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int in){ int i; for(i = 1; ;i++){ in /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:16:32: error: reference to 'max' is ambiguous 16 | if(l < max) max = l; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ 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:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:16:37: error: reference to 'max' is ambiguous 16 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~ a.cc:19:17: error: reference to 'max' is ambiguous 19 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999; | ^~~
s710455175
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; unsigned long long int N, max = 9999999999999, l; int ten(unsigned long long int in); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int in){ int i; for(i = 1; ;i++){ in /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:15:32: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ 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:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999, l; | ^~~ a.cc:15:37: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999, l; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max = 9999999999999, l; | ^~~
s484092324
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; unsigned long long int N, max= 0, l; int ten(unsigned long long int in); int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int in){ int i; for(i = 1; ;i++){ in /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:15:32: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ 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:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max= 0, l; | ^~~ a.cc:15:37: error: reference to 'max' is ambiguous 15 | if(l < max) max = l; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max= 0, l; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:27: note: 'long long unsigned int max' 7 | unsigned long long int N, max= 0, l; | ^~~
s258483514
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> unsigned long long int N, max= 0, l; int main(){ for(unsigned long long int i ;i < sqrt(N); i++){ if(N % i==0 ){ l = ten(N/i); if(l < max) max = l; } } cout << max; } int ten(unsigned long long int in){ int i; for(i = 1; ;i++){ in /= 10; if(in == 0) break; } return i; }
a.cc: In function 'int main()': a.cc:10:29: error: 'ten' was not declared in this scope; did you mean 'tan'? 10 | l = ten(N/i); | ^~~ | tan a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << max; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s652203866
p03775
Java
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(system.in); long test = sc.nextLong(); long result = Long.MAX_VALUE; for(int i = 1; i < Math.sqrt(test); i++) { if(test % i == 0) { long digit = Math.max(i, test/i); result = Math.min(result, digit); } } String str = result+""; System.out.println(str.length()); } }
Main.java:12: error: cannot find symbol Scanner sc = new Scanner(system.in); ^ symbol: variable system location: class Main 1 error
s406871076
p03775
C++
typedef vector<P> vp; const int MX = 100005, INF = 1001001001; const ll LINF = 1e18; const double eps = 1e-10; ll n; int main(){ cin >> n; ll ans; rrep(i, (int)sqrt(n)) if(n % i == 0) ans = n / i; int digit = 0; while(ans > 0){ ans /= 10; digit++; } cout << digit << endl; return 0; }
a.cc:1:9: error: 'vector' does not name a type 1 | typedef vector<P> vp; | ^~~~~~ a.cc:3:7: error: 'll' does not name a type 3 | const ll LINF = 1e18; | ^~ a.cc:6:1: error: 'll' does not name a type 6 | ll n; | ^~ a.cc: In function 'int main()': a.cc:9:3: error: 'cin' was not declared in this scope 9 | cin >> n; | ^~~ a.cc:9:10: error: 'n' was not declared in this scope 9 | cin >> n; | ^ a.cc:10:3: error: 'll' was not declared in this scope 10 | ll ans; | ^~ a.cc:11:8: error: 'i' was not declared in this scope 11 | rrep(i, (int)sqrt(n)) if(n % i == 0) ans = n / i; | ^ a.cc:11:16: error: 'sqrt' was not declared in this scope 11 | rrep(i, (int)sqrt(n)) if(n % i == 0) ans = n / i; | ^~~~ a.cc:11:3: error: 'rrep' was not declared in this scope 11 | rrep(i, (int)sqrt(n)) if(n % i == 0) ans = n / i; | ^~~~ a.cc:13:9: error: 'ans' was not declared in this scope 13 | while(ans > 0){ | ^~~ a.cc:17:3: error: 'cout' was not declared in this scope 17 | cout << digit << endl; | ^~~~ a.cc:17:20: error: 'endl' was not declared in this scope 17 | cout << digit << endl; | ^~~~
s092636792
p03775
C++
#include <iostream> #include <math.h> int main(){ int N,ans,a,b; cin >> N; for(int i=0;i*i<=N;i++){ if(N%i==0){ a=i; b=N/i; } } if(a>b){ ans=log10(a)+1; }else{ ans=log10(b)+1; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | 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:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 17 | 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:17:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 17 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s652138265
p03775
C++
#include <iostream> #include <cmath> using namespace std; int digits(int n){ for(int i = 0; n < 1; i++) n /= 10; return i; } int min(int a, int b){ return a < b ? a : b; } int main(void){ int n; int ans = 6; cin >> n; for(int i = 1; i < sqrt(n); i++){ if(n % i == 0) ans = min(ans, digits(n / i)); } cout << ans << endl; return 0; }
a.cc: In function 'int digits(int)': a.cc:10:10: error: 'i' was not declared in this scope 10 | return i; | ^
s796796977
p03775
C++
int main(){ long N = 0; cin >> N; double FN = double(N); int minVal = 1000000000; int harf = N/2 + 1; for(int i = 0; i < harf + 1; i++){ float x = FN / i; long ix = long(x); if(ix * i == N){ int val = max(log10(ix) + 1, log10(i) + 1); minVal = val < minVal ? val : minVal; } } cout << minVal << endl; }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> N; | ^~~ a.cc:13:27: error: 'log10' was not declared in this scope 13 | int val = max(log10(ix) + 1, log10(i) + 1); | ^~~~~ a.cc:13:23: error: 'max' was not declared in this scope 13 | int val = max(log10(ix) + 1, log10(i) + 1); | ^~~ a.cc:17:5: error: 'cout' was not declared in this scope 17 | cout << minVal << endl; | ^~~~ a.cc:17:23: error: 'endl' was not declared in this scope 17 | cout << minVal << endl; | ^~~~
s348121421
p03775
Java
import java.util.*; class Main{ public static void main(String[]args){ Scanner cin=new Scanner(System.in); long input; long larger; ArrayList<int> value = new ArrayList<Integer>(); input=cin.nextInt(); for(long i=1;i*i<=input;i++){ if(input%i==0){ larger=(long)input/i; value.add(String.valueOf(larger).length()); } } Collections.sort(value); System.out.println(value.get(0)); } }
Main.java:7: error: unexpected type ArrayList<int> value = new ArrayList<Integer>(); ^ required: reference found: int 1 error
s478953230
p03775
Java
import java.util.*; class Main{ public static void main(String[]args){ Scanner cin=new Scanner(System.in); int input; int mini; int minj; ArrayList<Integer> value = new ArrayList<Integer>(); input=cin.nextInt(); for(int i=1;i*i<=input;i++){ for(int j=1;j*j<=input;j++){ if(i*j==input){ mini = String.ValueOf(i).length(); minj = String.ValueOf(j).length(); if(mini>minj){ value.add(mini); }else{ value.add(minj); } } } } Collections.sort(value); System.out.println(value.get(0)); } }
Main.java:13: error: cannot find symbol mini = String.ValueOf(i).length(); ^ symbol: method ValueOf(int) location: class String Main.java:14: error: cannot find symbol minj = String.ValueOf(j).length(); ^ symbol: method ValueOf(int) location: class String 2 errors
s384994124
p03775
C++
#include<vector> using namespace std; int num_dig(int64_t x) { int dig = 0; while (x > 0) { x /= 10; dig++; } return dig; } int main() { int64_t n; cin >> n; int ans = 11; for (int64_t i = 1; i < n/2; i++) { if (n % i == 0) { int tmp = max(num_dig(n / i), num_dig(i)); if (ans > tmp) ans = tmp; } } cout << ans << endl; }
a.cc:4:13: error: 'int64_t' was not declared in this scope 4 | int num_dig(int64_t x) { | ^~~~~~~ a.cc:2:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 1 | #include<vector> +++ |+#include <cstdint> 2 | using namespace std; a.cc: In function 'int main()': a.cc:11:9: error: 'int64_t' was not declared in this scope 11 | int64_t n; | ^~~~~~~ a.cc:11:9: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:12:9: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<vector> +++ |+#include <iostream> 2 | using namespace std; a.cc:12:16: error: 'n' was not declared in this scope 12 | cin >> n; | ^ a.cc:15:21: error: expected ';' before 'i' 15 | for (int64_t i = 1; i < n/2; i++) { | ^~ | ; a.cc:15:29: error: 'i' was not declared in this scope 15 | for (int64_t i = 1; i < n/2; i++) { | ^ a.cc:17:52: error: 'num_dig' cannot be used as a function 17 | int tmp = max(num_dig(n / i), num_dig(i)); | ^ a.cc:17:62: error: 'num_dig' cannot be used as a function 17 | int tmp = max(num_dig(n / i), num_dig(i)); | ~~~~~~~^~~ a.cc:22:9: error: 'cout' was not declared in this scope 22 | cout << ans << endl; | ^~~~ a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:22:24: error: 'endl' was not declared in this scope 22 | cout << ans << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<vector> +++ |+#include <ostream> 2 | using namespace std;
s371463081
p03775
C++
#include <iostream> #include <algorithm> using namespace std; using ll=long long; int CountDigit(ll num); int main() { ll N; cin >> N; int ans = CountDigit(N); for (ll A = 1LL; A * A =< N; A++) { if (N % A != 0) continue; int cur; ll B = N / A; cur = max(CountDigit(A), CountDigit(B)); if (cur < ans) ans = cur; } cout << ans << endl; return 0; } int CountDigit(ll num) { int cnt = 0; while (num != 0) { num /= 10; cnt++; } return cnt; }
a.cc: In function 'int main()': a.cc:15:29: error: expected primary-expression before '<' token 15 | for (ll A = 1LL; A * A =< N; A++) | ^
s225727503
p03775
C++
#include <iostream> #include <algorithm> using namespace std; using ll=long long; int CountDigit(ll num); int main() { ll N; cin >> N; int ans = CountDigit(N); for (ll A = 1LL; A * A= < N; A++) { if (N % A != 0) continue; int cur; ll B = N / A; cur = max(CountDigit(A), CountDigit(B)); if (cur < ans) ans = cur; } cout << ans << endl; return 0; } int CountDigit(ll num) { int cnt = 0; while (num != 0) { num /= 10; cnt++; } return cnt; }
a.cc: In function 'int main()': a.cc:15:29: error: expected primary-expression before '<' token 15 | for (ll A = 1LL; A * A= < N; A++) | ^
s240055782
p03775
C++
#include <iostream> #include <algorithm> using namespace std; using ll=long long; int CountDigit(ll num); int main() { ll N; int ans = CountDigit(N); cin >> N; for (ll A = 1LL; A * A < N; A++) { int cur; ll B = N / A; cur = max(CountDigit(A), CountDigit(B)); if (cur < ans) ans = cur; } } cout << ans << endl; return 0; } int CountDigit(ll num) { int cnt = 0; while (num != 0) { num /= 10; cnt++; } return cnt; }
a.cc:22:5: error: 'cout' does not name a type 22 | cout << ans << endl; | ^~~~ a.cc:24:5: error: expected unqualified-id before 'return' 24 | return 0; | ^~~~~~ a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s553291478
p03775
Java
import java.util.*; public class DigitsinMultiplication { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); long N=s.nextLong(); int F=0; String a,b; int i=0; int min=100; for(i=1;i*i<=N;i++){ if(N%i!=0)continue; else{ a=String.valueOf(i); b=String.valueOf(N/i); if(a.length()<=b.length())F=b.length(); if(a.length()>b.length())F=a.length(); if(min>F)min=F; } } System.out.print(min); } }
Main.java:3: error: class DigitsinMultiplication is public, should be declared in a file named DigitsinMultiplication.java public class DigitsinMultiplication { ^ 1 error
s509927871
p03775
C
#include<stdio.h> #include<math.h> #include<stdlib.h> #include<string.h> int main(void) { int i, num, rem,min,len; double lim; char wln[13]; //整数Nの入力 scanf("%d", &num); lim = sqrt(num)-1.0; min = 11; for (i = num; i >lim; i--) { rem = num%i; if (rem == 0) { itoa(i, wln, 10); len= strlen(wln); if (len < min) { min = len; } } } printf("%d", min); return 0; }
main.c: In function 'main': main.c:21:25: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration] 21 | itoa(i, wln, 10); | ^~~~
s667380655
p03775
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long A,B,C,N,X=0,MINI=10; cin >> N; B=N; for(long long A=1;A<max(N,100000);A++){ if(N%A==0){ B=C=N/A; while(C!=0){ C/=10; X++; } if(MINI>X){ MINI=X; } X=0; } } if(N==1){cout << 1 << endl;} else{cout << MINI << endl;} return 0; }
a.cc: In function 'int main()': a.cc:8:26: error: no matching function for call to 'max(long long int&, int)' 8 | for(long long A=1;A<max(N,100000);A++){ | ~~~^~~~~~~~~~ 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:8:26: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 8 | for(long long A=1;A<max(N,100000);A++){ | ~~~^~~~~~~~~~ /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:8:26: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | for(long long A=1;A<max(N,100000);A++){ | ~~~^~~~~~~~~~
s911845321
p03775
C++
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); int sq = (int)(Math.sqrt(n)); int ans = 0, i; for(i = 1; i < sq; i++){ ans = (int)(Math.log10(n / i)) + 1; } System.out.println(ans); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s798323768
p03775
C++
#include <iostream> #include <sstream> using namespace std; int calc_digit(int n){ stringstream ss; ss << n; return ss.str().size(); } int main(void){ long long n;cin >> n; int a=2,d=1; int res=1; while(true){ if(a>=n) break; if(n%a==0){ res=max(res,calc_digit(n/a)); a = pow(10,++d); } } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:29: error: 'pow' was not declared in this scope 19 | a = pow(10,++d); | ^~~
s376394254
p03775
C++
#include <bits/stdc++.h> using namespace std; // 正の数の桁数を取得 int GetDigit( const __int64 iNum ) { // 入力チェック if( iNum < 0 ) return - 1; // エラー else if( iNum == 0 ) return 0; else if( iNum < 10 ) return 1; else if( iNum < 100 ) return 2; else if( iNum < 1000 ) return 3; else if( iNum < 10000 ) return 4; else if( iNum < 100000 ) return 5; else if( iNum < 1000000 ) return 6; else if( iNum < 10000000 ) return 7; else if( iNum < 100000000 ) return 8; else if( iNum < 1000000000 ) return 9; else if( iNum < 10000000000 ) return 10; else if( iNum < 100000000000 ) return 11; else if( iNum < 1000000000000 ) return 12; else if( iNum < 10000000000000 ) return 13; else if( iNum < 100000000000000 ) return 14; else if( iNum < 1000000000000000 ) return 15; else if( iNum < 10000000000000000 ) return 16; else if( iNum < 100000000000000000 ) return 17; else if( iNum < 1000000000000000000 ) return 18; else if( iNum < 1000000000000000000 ) return 19; else return 20; } int main( int argc, char *argv[] ) { __int64 i; __int64 N; double dblRoot; // 平方根 __int64 iVal; // 平方根以上の値である最小の約数 // N を取得 cin >> N; if( N < 1 || N > 10000000000 ) return 0; // 平方根 dblRoot = sqrt( N ); // Ti を取得 iVal = 0; for( i = (int) dblRoot; i > 1; i-- ) { if( N % i == 0 ) { iVal = N / i; break; } } // 素数の場合 if( iVal == 0 ) iVal = N; // 表示 cout << GetDigit( iVal ) << endl; return 0; }
a.cc:5:21: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | int GetDigit( const __int64 iNum ) | ^~~~~~~ | __int64_t a.cc: In function 'int main(int, char**)': a.cc:56:1: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 56 | __int64 i; | ^~~~~~~ | __ynf64 a.cc:57:8: error: expected ';' before 'N' 57 | __int64 N; | ^~ | ; a.cc:59:8: error: expected ';' before 'iVal' 59 | __int64 iVal; // 平方根以上の値である最小の約数 | ^~~~~ | ; a.cc:62:16: error: 'N' was not declared in this scope 62 | cin >> N; | ^ a.cc:69:9: error: 'iVal' was not declared in this scope 69 | iVal = 0; | ^~~~ a.cc:70:14: error: 'i' was not declared in this scope 70 | for( i = (int) dblRoot; i > 1; i-- ) | ^
s012802646
p03775
C++
#include <iostream> #include <cmath> using namespace std; int main(){ long long n, ans = 1e9; cin >> n; for(long long a = 1; a * a <= n; a++) if(n % a == 0){ ans = min(ans, to_string(n / a).size()); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:26: error: no matching function for call to 'min(long long int&, std::__cxx11::basic_string<char>::size_type)' 9 | ans = min(ans, to_string(n / a).size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:9:26: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 9 | ans = min(ans, to_string(n / 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
s072366779
p03775
C++
#include<iostream> using namespace std; int F(long long int a, long long int b); int main(){ long long int N; int max = INT_MAX; cin >> N; for(long long int i = 1; i <= sqrt((double)N); i++){ if(N % i == 0){ if(max > F(N / i, i)){ max = F(N / i, i); } } } cout << max << endl; return 0; } int F(long long int a, long long int b){ if(a >= b){ return ((int)log10((double)a) + 1); }else{ return ((int)log10((double)a) + 1); } }
a.cc: In function 'int main()': a.cc:9:19: error: 'INT_MAX' was not declared in this scope 9 | int max = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include<iostream> +++ |+#include <climits> 2 | a.cc:11:39: error: 'sqrt' was not declared in this scope 11 | for(long long int i = 1; i <= sqrt((double)N); i++){ | ^~~~ a.cc: In function 'int F(long long int, long long int)': a.cc:24:30: error: 'log10' was not declared in this scope 24 | return ((int)log10((double)a) + 1); | ^~~~~ a.cc:26:30: error: 'log10' was not declared in this scope 26 | return ((int)log10((double)a) + 1); | ^~~~~
s351049474
p03775
C++
#include<iostream> using namespace std; int F(long long int a, long long int b); int main(){ long long int N; int max = INT_MAX; cin >> N; for(long long int i = 1; i <= sqrt((double)N); i++){ if(N % i == 0){ if(max > F(N / i, i)){ max = F(N / i, i); } } } cout << max << endl; return 0; } int F(long long int a, long long int b){ if(a >= b){ return (log10((double)a) + 1); }else{ return (log10((double)a) + 1); } }
a.cc: In function 'int main()': a.cc:9:19: error: 'INT_MAX' was not declared in this scope 9 | int max = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include<iostream> +++ |+#include <climits> 2 | a.cc:11:39: error: 'sqrt' was not declared in this scope 11 | for(long long int i = 1; i <= sqrt((double)N); i++){ | ^~~~ a.cc: In function 'int F(long long int, long long int)': a.cc:24:25: error: 'log10' was not declared in this scope 24 | return (log10((double)a) + 1); | ^~~~~ a.cc:26:25: error: 'log10' was not declared in this scope 26 | return (log10((double)a) + 1); | ^~~~~
s250861438
p03775
Java
import java.util.Scanner; public class ABC057C { public static void main(String[] args) { ABC057CSolve solve = new ABC057CSolve(); solve.main(); } } class ABC057CSolve { long N; ABC057CSolve() { Scanner cin = new Scanner(System.in); this.N = cin.nextLong(); } void main() { long min = Long.MAX_VALUE / 2; if (N == 1) { System.out.println(1); return; } for (int i = 1; i <= N / 2; i++) { if (N % i == 0) { long a = i; long b = N / i; if (a > b) { break; } long f = F(a, b); min = Math.min(min, f); } } System.out.println(min); } int F(long a, long b) { int aCount = String.valueOf(a).length(); int bCount = String.valueOf(b).length(); return aCount > bCount ? aCount : bCount; } }
Main.java:2: error: class ABC057C is public, should be declared in a file named ABC057C.java public class ABC057C { ^ 1 error
s082590562
p03775
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.math.*; public class Main { public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); long n = Long.parseLong(br.readLine()); int f = Integer.MAX_VALUE; for(long i = 100000; i > 0; i--){ if(n%i==0){ long a = n/i; int f = Math.min(f,Math.max(String.valueOf(a).length(),String.valueOf(i).length())); } } System.out.println(f); } }
Main.java:16: error: variable f is already defined in method main(String[]) int f = Math.min(f,Math.max(String.valueOf(a).length(),String.valueOf(i).length())); ^ 1 error
s930343500
p03775
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ABC57C { public static void main(String[] args) throws IOException { // TODO 自動生成されたメソッド・スタブ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long N = Long.parseLong(br.readLine()); int i = 10000000; long O = 0; long T = 0; int o = 0; int t = 0; for(long l = 1; l < (long)Math.sqrt(N) + 10; l++) { if(N % l == 0) { O = l; T = N / l; o = (int) Math.log10(O) + 1; t = (int) Math.log10(T) + 1; if(i > (o > t ? o : t)) i = (o > t ? o : t); } } System.out.println(i); } }
Main.java:5: error: class ABC57C is public, should be declared in a file named ABC57C.java public class ABC57C ^ 1 error
s493448555
p03775
C++
#include<bits/stdc++.h> using namespace std; #define ll long long ll n; int main(void){ cin >> n; int ans = 100; for(ll i=1;i*i<=n;i++){ if (n%i==0) ans = min(ans, to_string(max(n, n/i)).size()); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)' 9 | if (n%i==0) ans = min(ans, to_string(max(n, 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:9:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 9 | if (n%i==0) ans = min(ans, to_string(max(n, 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:9:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 9 | if (n%i==0) ans = min(ans, to_string(max(n, n/i)).size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s397576440
p03775
C++
#include <iostream> #include <math.h> #include <vector> using namespace std;; using ll=long long; int cnt_digits(int N){ int digits=0; while(N > 0){ N/=10; digits++; } return digits; } int main(){ ll N; cin >> N; int ans=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; } } return 0; }
a.cc: In function 'int main()': a.cc:28:38: error: 'A_' was not declared in this scope; did you mean 'A'? 28 | const int cur=max(cnt_digits(A_, cnt_digits(B))); | ^~ | A
s710871207
p03775
Java
public class Main { public static int getDigitsNum(long x){ return String.valueOf(x).length(); } public static void main(String[] args) { long N; Scanner scanner = new Scanner(System.in); N = scanner.nextLong(); scanner.close(); long maxDivisor = (long)Math.sqrt(N); long divisor = 2; int minNum = getDigitsNum(N); int num; while(divisor <= maxDivisor){ if(N % divisor == 0){ num = Math.max(getDigitsNum(divisor),getDigitsNum(N / divisor)); if(num < minNum){ minNum = num; } } divisor++; } System.out.println(minNum); } }
Main.java:11: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:11: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s715477738
p03775
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <cassert> #include <cstddef> #include <iomanip> #include <numeric> #include <tuple> #include <sstream> #include <fstream> #include <chrono> using namespace std; #define REP(i, n) for (int (i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++) #define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--) #define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--) #define DEBUG(C) cerr << #C << " = " << C << endl; using LL = long long; using VI = vector<int>; using VVI = vector<VI>; using VL = vector<LL>; using VVL = vector<VL>; using VD = vector<double>; using VVD = vector<VD>; using PII = pair<int, int>; using PDD = pair<double, double>; using PLL = pair<LL, LL>; using VPII = vector<PII>; template<typename T> using VT = vector<T>; #define ALL(a) begin((a)), end((a)) #define RALL(a) rbegin((a)), rend((a)) #define SORT(a) sort(ALL((a))) #define RSORT(a) sort(RALL((a))) #define REVERSE(a) reverse(ALL((a))) #define MP make_pair #define FORE(a, b) for (auto &&a : (b)) #define FIND(s, e) ((s).find(e) != (s).end()) #define EB emplace_back template<typename T>inline bool chmax(T &a, T b){return (a < b ? a = b, true : false);} template<typename T>inline bool chmin(T &a, T b){return (a > b ? a = b, true : false);} const int INF = 1e9; const int MOD = INF + 7; const LL LLINF = 1e18; const long double EPS = 1e-9; LL N; int f(LL a, LL b) { int ca = 0, cb = 0; do { ++ca; } while (a /= 10); do { ++cb; } while (b /= 10); return max(ca, cb); } int main() { cin >> N; int ans = INF; for (LL i = 1; i * i <= N; ++i) { if (N % i == 0) { chmin(ans, max(to_string(N / i).size(), to_string(i).size())); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:83:30: error: no matching function for call to 'chmin(int&, const long unsigned int&)' 83 | chmin(ans, max(to_string(N / i).size(), to_string(i).size())); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:58:33: note: candidate: 'template<class T> bool chmin(T&, T)' 58 | template<typename T>inline bool chmin(T &a, T b){return (a > b ? a = b, true : false);} | ^~~~~ a.cc:58:33: note: template argument deduction/substitution failed: a.cc:83:30: note: deduced conflicting types for parameter 'T' ('int' and 'long unsigned int') 83 | chmin(ans, max(to_string(N / i).size(), to_string(i).size())); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s390530455
p03775
C++
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <math.h> #define INF (int)1e9 #define pb push_back using namespace std; int keta(long long int n){ int i=1; while(n>9){ i++; n/=10; } return i; } int main(void){ long long int n,nn; cin>>n; long long int i; long long int maxn=sqrt(n)+1; int tmp,res; res=keta(n); for(i=2;i<=maxn;i++){ if(n%i==0){ a=i; b=n/i; tmp=max(keta(a),keta(b)); if(tmp<res) res=tmp; } } cout<<res<<endl; return 0; }
a.cc: In function 'int main()': a.cc:29:7: error: 'a' was not declared in this scope 29 | a=i; | ^ a.cc:30:7: error: 'b' was not declared in this scope 30 | b=n/i; | ^
s944764230
p03775
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); double a=0; boolean warikire = false; for(int i=2; i<=Math.sqrt(n); i++){ if( n%i == 0 ){ a = i; warikire = true; } } if(warikire){ System.out.println( keta(n/a) ); }else{ System.out.println( keta(n) ); } return; } public static int keta( long a ){ int ans = 1; while( a/10 != 0 ){ a /= 10; ans++; } return ans; } }
Main.java:18: error: incompatible types: possible lossy conversion from double to long System.out.println( keta(n/a) ); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s250315323
p03775
C++
1.#include<stdio.h> #include<math.h> int main() { int N; scanf("%d",&N); int A,B,i,least,f; for(A=1;A<=N;A++) { if(N%A) continue; else B=N/A; if(A>=B) { while(A/pow(10,i)>1) i++; f=(int)(A/pow(10,i)); } else { while(B/pow(10,i)>1) i++; f=(int)(B/pow(10,i)); } if(least>f) least=f; } printf("%d",least); return 0; }
a.cc:2:3: error: stray '#' in program 2 | 1.#include<stdio.h> | ^ a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1.#include<stdio.h> | ^~ In file included from /usr/include/c++/14/cmath:45, from /usr/include/c++/14/math.h:36, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/stdlib.h:32, from /usr/include/c++/14/bits/std_abs.h:38, from /usr/include/c++/14/cmath:49: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file inc
s360543248
p03775
C++
#include<stdio.h> #include<math.h> int main() { int N; scanf("%d",&N); int A,B,i,least,f; for(A=1;A<=N;A++) { if(N%A) continue; else B=N/A; if(A>=B) { while(A/pow(10,i)>1) i++; f=(int)(A/pow(10,i); } else { while(B/pow(10,i)>1) i++; f=(int)(B/pow(10,i); } if(least>f) least=f; } printf("%d",least); return 0; }
a.cc: In function 'int main()': a.cc:18:26: error: expected ')' before ';' token 18 | f=(int)(A/pow(10,i); | ~ ^ | ) a.cc:24:26: error: expected ')' before ';' token 24 | f=(int)(B/pow(10,i); | ~ ^ | )
s979586785
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<cstdlib> int num(int x){ char s[10]; itoa(x,s,10); return strlen(s); } int F(int a,int b){ if (num(a)>=num(b) ) return num(a); else return num(b); } using namespace std; int main() { int n; cin>>n; int minF=11; for(int i=1;i<=floor(sqrt(n)+0.5);i++) { if(n%i!=0) continue; else minF=min(minF,F(i,n/i)); } cout<<minF<<endl; return 0; }
a.cc: In function 'int num(int)': a.cc:8:9: error: 'itoa' was not declared in this scope 8 | itoa(x,s,10); | ^~~~
s662979772
p03775
C++
#include<iostream> #include<algorithm> #include<cmath> #include<cstring> int num(int x){ char s[10]; itoa(x,s,10); return strlen(s); } int F(int a,int b){ if (num(a)>=num(b) ) return num(a); else return num(b); } using namespace std; int main() { int n; cin>>n; int minF=11; for(int i=1;i<=floor(sqrt(n)+0.5);i++) { if(n%i!=0) continue; else minF=min(minF,F(i,n/i)); } cout<<minF<<endl; return 0; }
a.cc: In function 'int num(int)': a.cc:7:9: error: 'itoa' was not declared in this scope 7 | itoa(x,s,10); | ^~~~
s209399434
p03775
C++
#include <iostream> #include <math.h> using namespace std; int main(){ int n,a,b,c,d; cin >> n; a = sqrt(n); if (n%2!=0){ if (a%2==0){a+=1;} while (n%a!=0){a+=2;} } else{ while (n%a!=0){a+=1;} } b = n/a; c=string(a).length d=string(b).length cout << max(c,d) << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 17 | c=string(a).length | ^ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:17:14: note: cannot convert 'a' (type 'int') to type 'const char*' 17 | c=string(a).length | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14
s954101375
p03775
C++
#include <iostream> #include <algorithm> using namespace std; long N; long GetDigit(long num) { return log10(num) + 1; } void solve() { long A = 1; long d = GetDigit(N); for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { if (N % A == 0) { d = min(d, GetDigit(N / A)); } } } cout << d << endl; } int main() { // 入力 cin >> N; solve(); return 0; }
a.cc: In function 'long int GetDigit(long int)': a.cc:8:16: error: 'log10' was not declared in this scope 8 | return log10(num) + 1; | ^~~~~
s927436523
p03775
C++
#include <iostream> #include <math.h> using namespace std; int main(){ int n,a,b,c,d; cin >> n; a = sqrt(n); if (n%2!=0){ if (a%2==0){a+=1;} while (n%a!=0){a+=2;} } else{ while (n%a!=0){a+=1;} } b = n/a; c=a.length d=b.length cout << max(c,d) << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: request for member 'length' in 'a', which is of non-class type 'int' 17 | c=a.length | ^~~~~~
s979112687
p03775
C++
#include "stdafx.h" #include <iostream> #include <algorithm> using namespace std; long N; long GetDigit(long num) { return log10(num) + 1; } void solve() { long A = 1; long d = GetDigit(N); for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { if (N % A == 0) { d = min(d, GetDigit(N / A)); } } } cout << d << endl; } int main() { // 入力 cin >> N; solve(); return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s490043626
p03775
C++
#include <bits/stdc++.h> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = (int) x; i < (int)n; i++) #define rep(i,n) REP(i,0,n) #define RREP(i, x, n) for(int i = (int) n; i > (int)x; i--) #define rrep(i,n) RREP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back #define SZ(x) ((int)(x).size()) typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int,int> pii; typedef pair<long,long> pll; typedef long long ll; int main (){ ll n; cin >> n; ll j=99999999999; // for(int i=1;i*i<=n;i++){ //if(n%i==0){ // if(i>n/i)break; // printf("%d, %d\n",i,n/i); int a=log10(n/i)+1; // printf("aa %d\n",a); // if(a<j) j=a; // } // P("A"); // } P(j); return 0; }
a.cc: In function 'int main()': a.cc:35:25: error: 'i' was not declared in this scope 35 | int a=log10(n/i)+1; | ^
s183194904
p03775
C++
#include "stdafx.h" #include <iostream> #include <algorithm> using namespace std; long N; long GetDigit(long num) { return log10(num) + 1; } void solve() { long A = 1; for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { if (N % A == 0) { long d = min(d, GetDigit(N / A)); } } } cout << d << endl; } int main() { // 入力 cin >> N; solve(); return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s465392918
p03775
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { long long N; cin >> N; vector<long long> v; v.push_back(1LL); long long a = sqrt(N); long long i = 2, j = 1, t; int n; while (i < a) { if (0LL == N % i) { N /= i; n = v.size(); t = pow(i, j); for (int k=0; k<n; ++k) { v.push_back(v[k] * t); } ++j; } else { ++i; j=1; } } long long b = 1000000000000; n = v.size(); for (int k=n-1; k>=0; --k) { if (k=>a && b > v[k]) { b = v[k]; } } int c = 0; while (b > 0) { b /= 10; ++c; } cout << c << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:11: error: expected primary-expression before '>' token 39 | if (k=>a && b > v[k]) | ^
s051836114
p03775
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { long long N; cin >> N; vector<long long> v; v.push_back(1LL); long long a = sqrt(N); long long i = 2, j = 1, t; int n; while (i < a) { if (0LL == N % i) { N /= i; n = v.size(); t = pow(i, j); for (int k=0; k<n; ++k) { v.push_back(v[k] * t); } ++j; } else { ++i; j=1; } } long long b = 1000000000000; n = v.size(); for (int k=n-1; k>=0; --k) { if (k=>a && b > v[k]) { b = v[k]; } } cout << b << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:11: error: expected primary-expression before '>' token 39 | if (k=>a && b > v[k]) | ^
s188533205
p03775
C++
#include <iostream> #include <vector> #include <math> using namespace std; int main() { long long N; cin >> N; vector<long long> v; v.push_back(1LL); long long a = sqrt(N); long long i = 2, j = 1, t; int n; while (i < a) { if (0LL == N % i) { N /= i; n = v.size(); t = pow(i, j); for (int k=0; k<n; ++k) { v.push_back(v[k] * t); } ++j; } else { ++i; j=1; } } long long b = 1000000000000; n = v.size(); for (int k=n-1; k>=0; --k) { if (k=>a && b > v[k]) { b = v[k]; } } cout << b << endl; return 0; }
a.cc:3:10: fatal error: math: No such file or directory 3 | #include <math> | ^~~~~~ compilation terminated.
s675787364
p03775
C++
#include <iostream> #include <vector> using namespace std; int main() { long long N; cin >> N; vector<long long> v; v.push_back(1LL); long long a = sqrt(N); long long i = 2, j = 1, t; int n; while (i < a) { if (0LL == N % i) { N /= i; n = v.size(); t = pow(i, j); for (int k=0; k<n; ++k) { v.push_back(v[k] * t); } ++j; } else { ++i; j=1; } } long long b = 1000000000000; n = v.size(); for (int k=n-1; k>=0; --k) { if (k=>a && b > v[k]) { b = v[k]; } } cout << b << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'sqrt' was not declared in this scope 11 | long long a = sqrt(N); | ^~~~ a.cc:20:11: error: 'pow' was not declared in this scope 20 | t = pow(i, j); | ^~~ a.cc:38:11: error: expected primary-expression before '>' token 38 | if (k=>a && b > v[k]) | ^
s866417877
p03775
C++
#include<cstdio> #include<algorithm> using namespace std; typedef long long int lli; lli N, ans = 9999999999, ou1, ou2, ou, rN; lli keta(lli in); int main(){ scanf("%lld", &N); rN = sqrt(N); for(int l = 1; l <= rN; l++){ if((N % l) == 0){ ou1=keta(l); ou2 = keta(N/l); ou = max(ou1, ou2); //printf("%lld %llld\n", ou1, ou2); if(ans > ou) ans = ou; if(ou1 == ou2){ break; }else if(ou1 > ou2){ break; } } } printf("%lld", ans); return 0; } lli keta(lli in){ int l = 1; while(in >= 10){ in /= 10; //printf("%lld\n", in); l++; } return l; }
a.cc: In function 'int main()': a.cc:14:8: error: 'sqrt' was not declared in this scope 14 | rN = sqrt(N); | ^~~~
s891960300
p03775
C++
#include <cstdio> #include <cmath> #include <random> #define REP(i,n) for (int i=0;i<(n);i++) int F(double,double); int main(){ long long N; scanf("%lld",&N); int num=1145141919; for(int i=1;i<=100000;i++){ if(N%i==0 && num>F(N/i,i)){ num=F(N/i,i); } } printf("%d",num); return 0; }
/usr/bin/ld: /tmp/ccxgFMdF.o: in function `main': a.cc:(.text+0x80): undefined reference to `F(double, double)' /usr/bin/ld: a.cc:(.text+0xc9): undefined reference to `F(double, double)' collect2: error: ld returned 1 exit status
s882759270
p03775
C++
#include <cstdio> #include <math.h> #include <algorithm> #include <vector> #include <iostream> #include <sstream> #include <string> #include <iomanip> #include <set> #include <map> using namespace std; #define EPS 1e-14 #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define REP(i,n) FOR(i, 0, n) #define PI 2*acos(0.0) #define ALL(a) (a).begin(),(a).end() #define DEBUG(x) cout<<#x <<": "<< x << "\n" #define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; } const int VX[] = { 0, 1, 0, -1 }; const int VY[] = { 1, 0, -1, 0 }; const long MOD = 1000000007; int main() { // --- I/O 高速化 --- cin.tie(0); ios::sync_with_stdio(false); // --- ここまで --- long long N; cin >> N; int min = INT_MAX; for (long long i = 1; i < sqrt(N); i++) { if (N % i == 0) { long long A = i; long long B = N / i; if (max(floor(log10(A)) + 1, floor(log10(B)) + 1) < min) { min = max(floor(log10(A)) + 1, floor(log10(B)) + 1); } else if (max(floor(log10(A)) + 1, floor(log10(B)) + 1) > min) { break; } } } cout << min << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:19: error: 'INT_MAX' was not declared in this scope 34 | int min = INT_MAX; | ^~~~~~~ a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 10 | #include <map> +++ |+#include <climits> 11 |
s966099233
p03775
C++
#include <iostream> #include <sstream> #include <algorithm> #include <cmath> using namespace std; int main(void) { __int64 N; cin >> N; int a, b; for (__int64 i = 1; i < sqrt(N) + 1; ++i) { if (N % i == 0) { a = i; b = N / i; } } stringstream ss1; ss1 << a; stringstream ss2; ss2 << b; cout << max(ss1.str().length(), ss2.str().length()) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 9 | __int64 N; | ^~~~~~~ | __ynf64 a.cc:10:16: error: 'N' was not declared in this scope 10 | cin >> N; | ^ a.cc:14:21: error: expected ';' before 'i' 14 | for (__int64 i = 1; i < sqrt(N) + 1; ++i) { | ^~ | ; a.cc:14:29: error: 'i' was not declared in this scope 14 | for (__int64 i = 1; i < sqrt(N) + 1; ++i) { | ^
s372679318
p03775
C++
#include <iostream> #include <sstream> #include <algorithm> using namespace std; int main(void) { __int64 N; cin >> N; int a, b; for (__int64 i = 1; i < sqrt(N) + 1; ++i) { if (N % i == 0) { a = i; b = N / i; } } stringstream ss1; ss1 << a; stringstream ss2; ss2 << b; cout << max(ss1.str().length(), ss2.str().length()) << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 8 | __int64 N; | ^~~~~~~ | __int64_t a.cc:9:16: error: 'N' was not declared in this scope 9 | cin >> N; | ^ a.cc:13:21: error: expected ';' before 'i' 13 | for (__int64 i = 1; i < sqrt(N) + 1; ++i) { | ^~ | ; a.cc:13:29: error: 'i' was not declared in this scope 13 | for (__int64 i = 1; i < sqrt(N) + 1; ++i) { | ^ a.cc:13:33: error: 'sqrt' was not declared in this scope 13 | for (__int64 i = 1; i < sqrt(N) + 1; ++i) { | ^~~~
s673900080
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vint; typedef pair<int,int> pint; typedef vector<pint> vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,n) for(int i=n-1;i>=(0);i--) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) #define all(v) (v).begin(),(v).end() #define eall(v) unique(all(v), v.end()) #define pb push_back #define mp make_pair #define fi first #define se second #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) const int MOD = 1e9 + 7; const int INF = 1e9; const ll INFF = 1e18; #define int long long std::pair<std::vector<ll>, std::vector<ll>> prime_factor_decomp(ll n) { std::vector<ll> p, e; ll m = n; for (ll i = 2; i * i <= n; i++) { if (m % i != 0) continue; int c = 0; while (m % i == 0) c++, m /= i; p.push_back(i); e.push_back(c); } if (m > 1) { p.push_back(m); e.push_back(1); } return std::make_pair(p, e); } signed main(void){ ll n; cin >> n; auto ret = prime_factor_decomp_fast(n); auto v = ret.fi, u = ret.se; ll a = 1, b = 1; for (int i = v.size() - 1; i >= 0; --i){ ll x = v[i], k = u[i]; // x^k /* printf("%lld %lld\n", x, k); if(k % 2){ if(a > b) a *= pow(x, k / 2), b *= pow(x, k / 2 + 1); else a *= pow(x, k / 2 + 1), b *= pow(x, k / 2); }else{ a *= pow(x, k / 2); b *= pow(x, k / 2); } */ rep(i, k){ if(a > b) b *= x; else a *= x; } // printf("ab %lld %lld\n", a, b); } string sa = to_string(a), sb = to_string(b); // cout << sa << " " << sb << endl; int size = max((int)sa.size(), (int)sb.size()); printf("%d\n", size); return 0; }
a.cc: In function 'int main()': a.cc:43:20: error: 'prime_factor_decomp_fast' was not declared in this scope; did you mean 'prime_factor_decomp'? 43 | auto ret = prime_factor_decomp_fast(n); | ^~~~~~~~~~~~~~~~~~~~~~~~ | prime_factor_decomp a.cc:58:24: error: 'k' was not declared in this scope 58 | rep(i, k){ | ^ a.cc:7:33: note: in definition of macro 'rep' 7 | #define rep(i,n) for(int i=0;i<(n);i++) | ^
s374155015
p03775
C++
#include<cstdio> #include<conio.h> #include<math.h> #include<algorithm> using namespace std; int main(){ long long int n,x,y,i; scanf("%lld",&n); for(i=sqrt(n);i>0;i--){ if(n%i==0) break; } x=i; y=n/x; i=0; while(x!=0){ x=x/10; i++; } x=i; i=0; while(y!=0){ y=y/10; i++; } y=i; printf("%lld",max(x,y)); return 0; }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s091842573
p03775
C++
#include <iostream> #include <cstdio> #include <map> #include <set> #include <vector> #include <queue> #include <stack> #include <cmath> #include <algorithm> #include <cstring> #include <string> using namespace std; #define INF 0x3f3f3f3f typedef long long LL; double PI=acos(-1); LL n; int f(LL s) { int i=0; while(s>=1){ i++; s/=10; } return i; } int main() { while(cin>>n){ int s=sqrt(n*1.0); ss=s; while(ss<=n){ if(n%ss==0){ break; } ss++; if(ss-s>10000){ break; } } if(ss-s>1000){ cout<<f(n)<<endl; }else{ cout<<f(s)<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:34:9: error: 'ss' was not declared in this scope; did you mean 's'? 34 | ss=s; | ^~ | s
s620017524
p03775
C++
//#include <bits/stdc++.h> #include <iostream> #include <string> #include <sstream> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> #include <unordered_map> #include <queue> #include <stack> #include <iomanip> using namespace std; #define PI 3.141592653589793238462643383279502884 #define Max 100005 #define ll long long #define mod 2 #define EPS 1E-9 vector< pair<int, int> >v; void get_div(ll n) { for (int i = 1; i <= sqrt(n); i++) { if (n%i == 0) { if (i*i != n) v.push_back(make_pair(i, (n / i))); else v.push_back(make_pair(i, i)); } } } int get_max_sz(string s1, string s2) { return max(s1.size(), s2.size()); } int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n; cin >> n; get_div(n); string tmp1, tmp2; int mn = INT_MAX; int res; for (int i = 0; i<v.size(); i++) { tmp1 = to_string(v[i].first); tmp2 = to_string(v[i].second); res = get_max_sz(tmp1, tmp2); if (res<mn) mn = res; } cout << mn << endl; return 0; }
a.cc: In function 'int main()': a.cc:55:18: error: 'INT_MAX' was not declared in this scope 55 | int mn = INT_MAX; | ^~~~~~~ a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 13 | #include <iomanip> +++ |+#include <climits> 14 |
s232053904
p03775
C
#include<stdio.h> int degits(long long a){ if(a<10) return 1; return 1+degits(a/10); } int F(long long a,long long b){ int ad,bd; ad=degits(a); bd=degits(b); return ((ad>bd)?ad:bd); } int main(int argc, char const *argv[]){ long long n,i; int min; scanf("%lld",&n); min=degits(n); for(i=2;i*i<=n;i++){ if(n%i==0){ min=(F(i,n/i)<min)?F(i,n/i):min; } } printf("%d",min) return 0; }
main.c: In function 'main': main.c:25:25: error: expected ';' before 'return' 25 | printf("%d",min) | ^ | ; 26 | return 0; | ~~~~~~
s316231532
p03775
C
#include<stdio.h> int degits(long long a){ if(a<10) return 1; return 1+degit(a/10); } int F(long long a,long long b){ int ad,bd; ad=degits(a); bd=degits(b); return ((ad>bd)?ad:bd); } int main(int argc, char const *argv[]){ long long n,i; int min; scanf("%lld",&n); min=degit(n); for(i=2;i*i<=n;i++){ if(n%i==0){ min=(F(i,n/i)<min)?F(i,n/i):min; } } printf("%d",min) return 0; }
main.c: In function 'degits': main.c:5:18: error: implicit declaration of function 'degit'; did you mean 'degits'? [-Wimplicit-function-declaration] 5 | return 1+degit(a/10); | ^~~~~ | degits main.c: In function 'main': main.c:25:25: error: expected ';' before 'return' 25 | printf("%d",min) | ^ | ; 26 | return 0; | ~~~~~~
s998461728
p03775
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; int digit(ll x) { int c = 0; while (x >= 1) { x /= 10; c++; } return c; } int main() { ll n; int ans; cin >> n; for (int i = 1; pow(i,2) <= n; i++) { if (n%i == 0)ans = digit(max(n/i,(ll)i)); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:19:25: error: 'pow' was not declared in this scope 19 | for (int i = 1; pow(i,2) <= n; i++) { | ^~~
s490128117
p03775
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; int digit(ll x) { int c = 0; while (x >= 1) { x /= 10; c++; } return c; } int main() { ll n; int ans; cin >> n; for (int i = 1; pow(i,2) <= n; i++) { if (n%i == 0)ans = digit(max(n/i,(ll)i)); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:19:25: error: 'pow' was not declared in this scope 19 | for (int i = 1; pow(i,2) <= n; i++) { | ^~~
s395210840
p03775
C++
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <map> #include <unordered_map> #include <set> #include <climits> using namespace std; vector<long long> divisor(long long n) { vector<long long> res; for (long long i = 1; i * i <= n; i++) { if (n % i == 0) { res.push_back(i); if (i != n / i) res.push_back(n / i); } } return res; } int main(){ cin.tie(0); ios::sync_with_stdio(false); long long N; cin >> N; vector<long long> div = divisor(N); int ans = 100; for(auto d : div){ int tmp1 = static_cast<int>(log10(d)+1); int tmp2 = static_cast<int>(log10(N/d)+1); ans = min(ans, max(tmp1, tmp2)); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:37: error: 'log10' was not declared in this scope 31 | int tmp1 = static_cast<int>(log10(d)+1); | ^~~~~
s497812275
p03775
C++
#include <iostream> #include <string> #include <list> #include <vector> #include <queue> #include <algorithm> #include <climits> #include <cstring> #define int long long #define uint unsigned long long #define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end()) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) #define ARY_SORT(a, size) sort((a), (a)+(size)) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) using namespace std; signed main() { int N; cin >> N; int min = INT_MAX; for (int i = 1; i <= (int)sqrt(N); i++) { if (N % i == 0) { int a = MAX(i, N / i); int k = 0; while (a > 0) { k++; a /= 10; } if (k < min) { min = k; } } } cout << min << endl;; }
a.cc: In function 'int main()': a.cc:25:35: error: 'sqrt' was not declared in this scope 25 | for (int i = 1; i <= (int)sqrt(N); i++) | ^~~~
s536280413
p03775
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long ans = 100; for(long i=1; i*i<=N; i++) { if(N%i==0) { ans = Math.min(ans, getDigits(N/i)); } } System.out.println(ans); sc.close(); } static int getDigits(long x) { int ans = 0; while(x>0) { x /= 10; ans++; } return ans; } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s332843360
p03775
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include <iomanip> #include <numeric> #define in std::cin #define out std::cout int64_t N; int main() { using std::endl; in.sync_with_stdio(false); out.sync_with_stdio(false); in >> N; int32_t min = 11; for (int64_t i = 1, end = std::sqrt(N)+1; i <= end; i++) { if (N%i == 0) { int32_t count = 0; int32_t tmp = N / i; while (tmp>0) { ++count; tmp /= 10; } min = std::min(min, count); } } out << min << endl; return 0; } #endif
a.cc: In function 'int main()': a.cc:35:40: error: 'sqrt' is not a member of 'std'; did you mean 'sort'? 35 | for (int64_t i = 1, end = std::sqrt(N)+1; i <= end; i++) | ^~~~ | sort
s562615545
p03776
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; using long long = ll; #define rep(i, n) for (int i=0; i<(int)(n); i++) ll comb(ll n, ll r){ ll x = 1, y= 1; rep(i,r){ x *= n - i; y *= r - i; } cout << x/y; } int main(){ double N, A, B; cin >> N >> A >> B; vector<ll> v(N); rep(i,N){ cin >> v.at(i); } sort(v.begin(), v.end(), greater<long long>()); ll sum = 0; rep(i,A){ sum += v.at(i); } ll num = 0; ll chosen = 0; bool all_equal = true; rep(i,N){ if(v.at(i)==v.at(A-1)){ num++; if(i<A) chosen++; } if(v.at(i)!=v.at(0)) all_equal = false; } ll mtd = 0; if(all_equal){ for(int i=A; i<=B; i++){ mtd += comb(num,i); } }else{ mtd += comb(num,chosen); } cout << sum/A << endl; cout << mtd; return 0; }
a.cc:5:7: error: expected nested-name-specifier before 'long' 5 | using long long = ll; | ^~~~ a.cc:8:1: error: 'll' does not name a type 8 | ll comb(ll n, ll r){ | ^~ a.cc: In function 'int main()': a.cc:20:10: error: 'll' was not declared in this scope 20 | vector<ll> v(N); | ^~ a.cc:20:12: error: template argument 1 is invalid 20 | vector<ll> v(N); | ^ a.cc:20:12: error: template argument 2 is invalid a.cc:22:14: error: request for member 'at' in 'v', which is of non-class type 'int' 22 | cin >> v.at(i); | ^~ a.cc:24:10: error: request for member 'begin' in 'v', which is of non-class type 'int' 24 | sort(v.begin(), v.end(), greater<long long>()); | ^~~~~ a.cc:24:21: error: request for member 'end' in 'v', which is of non-class type 'int' 24 | sort(v.begin(), v.end(), greater<long long>()); | ^~~ a.cc:25:5: error: expected ';' before 'sum' 25 | ll sum = 0; | ^~~~ | ; a.cc:27:5: error: 'sum' was not declared in this scope 27 | sum += v.at(i); | ^~~ a.cc:27:14: error: request for member 'at' in 'v', which is of non-class type 'int' 27 | sum += v.at(i); | ^~ a.cc:29:5: error: expected ';' before 'num' 29 | ll num = 0; | ^~~~ | ; a.cc:30:5: error: expected ';' before 'chosen' 30 | ll chosen = 0; | ^~~~~~~ | ; a.cc:33:10: error: request for member 'at' in 'v', which is of non-class type 'int' 33 | if(v.at(i)==v.at(A-1)){ | ^~ a.cc:33:19: error: request for member 'at' in 'v', which is of non-class type 'int' 33 | if(v.at(i)==v.at(A-1)){ | ^~ a.cc:34:7: error: 'num' was not declared in this scope; did you mean 'enum'? 34 | num++; | ^~~ | enum a.cc:35:15: error: 'chosen' was not declared in this scope 35 | if(i<A) chosen++; | ^~~~~~ a.cc:37:10: error: request for member 'at' in 'v', which is of non-class type 'int' 37 | if(v.at(i)!=v.at(0)) all_equal = false; | ^~ a.cc:37:19: error: request for member 'at' in 'v', which is of non-class type 'int' 37 | if(v.at(i)!=v.at(0)) all_equal = false; | ^~ a.cc:39:5: error: expected ';' before 'mtd' 39 | ll mtd = 0; | ^~~~ | ; a.cc:42:7: error: 'mtd' was not declared in this scope; did you mean 'std'? 42 | mtd += comb(num,i); | ^~~ | std a.cc:42:19: error: 'num' was not declared in this scope; did you mean 'enum'? 42 | mtd += comb(num,i); | ^~~ | enum a.cc:42:14: error: 'comb' was not declared in this scope; did you mean 'wctomb'? 42 | mtd += comb(num,i); | ^~~~ | wctomb a.cc:45:5: error: 'mtd' was not declared in this scope; did you mean 'std'? 45 | mtd += comb(num,chosen); | ^~~ | std a.cc:45:17: error: 'num' was not declared in this scope; did you mean 'enum'? 45 | mtd += comb(num,chosen); | ^~~ | enum a.cc:45:21: error: 'chosen' was not declared in this scope 45 | mtd += comb(num,chosen); | ^~~~~~ a.cc:45:12: error: 'comb' was not declared in this scope; did you mean 'wctomb'? 45 | mtd += comb(num,chosen); | ^~~~ | wctomb a.cc:47:11: error: 'sum' was not declared in this scope 47 | cout << sum/A << endl; | ^~~ a.cc:48:11: error: 'mtd' was not declared in this scope; did you mean 'std'? 48 | cout << mtd; | ^~~ | std
s172319090
p03776
Java
package contest; import java.util.*; import java.io.*; public class A { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public Reader(String file_name) throws IOException { din = new DataInputStream(new FileInputStream(file_name)); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String readLine() throws IOException { byte[] buf = new byte[64]; // line length int cnt = 0, c; while ((c = read()) != -1) { if (c == '\n') break; buf[cnt++] = (byte) c; } return new String(buf, 0, cnt); } public int nextInt() throws IOException { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long nextLong() throws IOException { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public double nextDouble() throws IOException { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (c == '.') { while ((c = read()) >= '0' && c <= '9') { ret += (c - '0') / (div *= 10); } } if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() throws IOException { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } public void close() throws IOException { if (din == null) return; din.close(); } } private static final int mod =(int)1e9+7; public static void main(String[] args) throws Exception { Reader sc=new Reader(); PrintWriter out=new PrintWriter(System.out); int n=sc.nextInt(); int a=sc.nextInt(); int b=sc.nextInt (); long arr[]=new long[n]; for(int i=0;i<n;i++) { arr[i]=sc.nextLong(); } Arrays.sort(arr); long ans=0; for(int i=n-1;i>n-a-1;i--) { ans+=arr[i]; } double mean=(double)ans/a; out.format("%.6f",mean); out.println(); int p=0; int q=0; for(int i=0; i<n;i++) { if(arr[i]==arr[n-a]) { p++; if(i>=n-a)q++; } } long ans1=0; if(arr[0]==arr[n-1]) { for(int i=q;i<=Math.min(b,p);i++) { ans1+=combi(p,i); } out.println(ans1); }else { ans1+=combi(p,q); out.println(ans1); } out.flush(); } static int cntd(long n) { int ans=0; while(n!=0) { ans++; n/=10; } return ans; } public static long combi(int n, int m) { int ind=51; long[][] C=new long[51][51]; for(int i=0; i<ind;i++) { C[i][0]=1; } for (int i=2; i<=n+m;i++) { for (int j=1; j<i;j++) { if(j<ind && i-j<ind) { C[j][i-j]=C[j-1][i-j-1]+C[j-1][i-j]; } } } return C[n][m]; } }
Main.java:4: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error