submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s667147866
p03775
C++
#include <bits/stdc++.h> using namespace std; int GetDigit(int num){ int digit=0; while(num!=0){ num /= 10; digit++; } return digit; } int F(int a, int b){ int M = max(a, b); return GetDigit(M); } int main() { int n; cin >> n; int count = 100000000000; double m = sqrt(n) for(int i = 1; i <= m; i++){ if(n % i != 0) continue; else { int j = n / i; if(count > F(i, j)) count = F(i, j); } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:20:15: warning: overflow in conversion from 'long int' to 'int' changes value from '100000000000' to '1215752192' [-Woverflow] 20 | int count = 100000000000; | ^~~~~~~~~~~~ a.cc:22:3: error: expected ',' or ';' before 'for' 22 | for(int i = 1; i <= m; i++){ | ^~~ a.cc:22:18: error: 'i' was not declared in this scope 22 | for(int i = 1; i <= m; i++){ | ^
s403885108
p03775
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); long N = sc.nextLong(); int ans = keta(N); for(long i = 1;i < N / i;i++){ if(N % i == 0){ ans = Math.min(ans,keta(Math.max(N / i,i)); } } System.out.println(ans); } public static int keta(long a){ int count = 1; long buf = a; while(buf / 10 != 0){ count++; buf = buf / 10; } return count; } }
Main.java:9: error: ')' or ',' expected ans = Math.min(ans,keta(Math.max(N / i,i)); ^ 1 error
s076178961
p03775
C++
#include<iostream> #include<vector> using namespace std; int digit(int n) { int num = 1, x = 10; while (true) { if (n >= x / 10 && x < N) { break; } num++; x *= 10; } return num; } int main() { int N; cin >> N; int ans = 10000; for (int i = 1; i <= N / 2; i++) { if (N%i != 0)continue; int tmp = digit(i) + digit(N / i); if (tmp < ans)ans = tmp; } cout << ans << endl; return 0; }
a.cc: In function 'int digit(int)': a.cc:9:40: error: 'N' was not declared in this scope 9 | if (n >= x / 10 && x < N) { | ^
s750661852
p03775
C++
#include <bits/stdc++.h> using namespace std; int dd (int I){ int d = 0; while(I>0){ I/=10; d+=1; } return d; } int main(){ int N; cin >> N; int count = 10000000000; for(int i = 1; i*i < N+1; i++){ int c = 10000000000; if(N%i == 0){ int l = dd(i); int m = dd(N/i); if(l < m){ c = m; } else{ c = l; } } if(count > c){ count = c; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:17:15: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow] 17 | int count = 10000000000; | ^~~~~~~~~~~ a.cc:19:13: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow] 19 | int c = 10000000000; | ^~~~~~~~~~~ a.cc: At global scope: a.cc:38:3: error: 'cout' does not name a type 38 | cout << count << endl; | ^~~~ a.cc:39:1: error: expected declaration before '}' token 39 | } | ^
s310451546
p03775
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int ans = min(N); for(int i=1; i*i<=N; i++){ if(N%i!=0)continue; int b = N/i; int temp = min(Math.max(i, b)); if(temp<ans){ ans=temp; } } System.out.print(ans); } int min(int N){ return String.valueOf(N).length(); } }
Main.java:6: error: non-static method min(int) cannot be referenced from a static context int ans = min(N); ^ Main.java:10: error: non-static method min(int) cannot be referenced from a static context int temp = min(Math.max(i, b)); ^ 2 errors
s945160037
p03775
Java
import java.uti.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int ans = min(N); for(int i=1; i*i<=N; i++){ if(N%i!=0)continue; int b = N/i; int temp = min(Math.max(i, b)); if(temp<ans){ ans=temp; } } System.out.print(ans); } int min(int N){ return String.valueOf(N).length(); } }
Main.java:1: error: package java.uti does not exist import java.uti.*; ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: non-static method min(int) cannot be referenced from a static context int ans = min(N); ^ Main.java:10: error: non-static method min(int) cannot be referenced from a static context int temp = min(Math.max(i, b)); ^ 5 errors
s740650358
p03775
Java
import java.uti.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int ans = min(N); for(int i=1; i*i<=N; i++){ if(N%i!=0)continue; int b = N/i; int temp = min(Math.max(i, b)); if(temp<ans){ ans=temp; } } System.out.print(ans); } int min(int N){ return String.valueOf(N).length(); }
Main.java:20: error: reached end of file while parsing } ^ 1 error
s781343436
p03775
C++
#include<iostream> #include<cmath> using namespace std; int getDigit10(ll i){ int cnt = 0; while(i > 0){i/=10;++cnt;} return cnt; } int main(){ ll N;cin >> N; int ans = getDigit10(N); for(int i = 1;i < int(sqrt(N));++i){ if(N%i != 0)continue; ll j = N / i; if(ans > getDigit10(j)) ans = getDigit10(j); } cout << ans; }
a.cc:5:16: error: 'll' was not declared in this scope 5 | int getDigit10(ll i){ | ^~ a.cc: In function 'int main()': a.cc:12:5: error: 'll' was not declared in this scope 12 | ll N;cin >> N; | ^~ a.cc:12:17: error: 'N' was not declared in this scope 12 | ll N;cin >> N; | ^ a.cc:13:25: error: 'getDigit10' cannot be used as a function 13 | int ans = getDigit10(N); | ~~~~~~~~~~^~~ a.cc:16:11: error: expected ';' before 'j' 16 | ll j = N / i; | ^~ | ; a.cc:17:29: error: 'j' was not declared in this scope 17 | if(ans > getDigit10(j)) | ^ a.cc:17:30: error: 'getDigit10' cannot be used as a function 17 | if(ans > getDigit10(j)) | ^ a.cc:18:29: error: 'getDigit10' cannot be used as a function 18 | ans = getDigit10(j); | ~~~~~~~~~~^~~
s916545765
p03775
C++
#include<iostream> using namespace std; int digit_number(int a){ int res=0; while(a>0){ a/=10; res++;} return res; } int main(){ int N; cin>>N; double B[N]; int A[N]; int min=13; for(int i=1;i<N/2;i++){ B[i]=N/i; A[i]=i; if(B!=(int)B){ B=10000000000; } } for(int i=1;i<N/2;i++){ if(min>digit_number(B[i])){ min=digit_number(B[i]); } } cout<<min; }
a.cc: In function 'int main()': a.cc:19:11: error: cast from 'double*' to 'int' loses precision [-fpermissive] 19 | if(B!=(int)B){ | ^~~~~~ a.cc:19:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 19 | if(B!=(int)B){ | ~^~~~~~~~ a.cc:20:8: error: incompatible types in assignment of 'long int' to 'double [N]' 20 | B=10000000000; | ~^~~~~~~~~~~~
s686237286
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; ll digit(ll a) { ll ans = 1; while (a < 10) { a /= 10; ans++; } return ans; } int main() { ll N; cin >> N; ll rN = sqrt(N); ll res = 0; ll anotherres = 0; for(ll i = rN; i >= 0; i--) { if (N % i == 0) res = i; anotherres = N / i; break; } ans = digit(max(res,anotherres)); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | ans = digit(max(res,anotherres)); | ^~~ | abs
s930489273
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; ll digit(ll a) { ll ans = 1; while (a < 10) { a /= 10; ans++; } return ans; } int main() { ll N; cin >> N; ll rN = sqrt(N); ll res = 0; ll anotherres = 0; for(ll i = rN; i >= 0; i--) { if (N % i == 0) ans = i; anotherans = N / i; } ans = digit(max(res,anotherres)); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:21: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | if (N % i == 0) ans = i; anotherans = N / i; | ^~~ | abs a.cc:20:30: error: 'anotherans' was not declared in this scope; did you mean 'anotherres'? 20 | if (N % i == 0) ans = i; anotherans = N / i; | ^~~~~~~~~~ | anotherres a.cc:22:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | ans = digit(max(res,anotherres)); | ^~~ | abs
s176494253
p03775
C++
#include <math.h> #include <iostream> #include<string> #include <algorithm> #include <bits/stdc++.h> #include <vector> #include <stdlib.h> using namespace std; int main() { double N; cin >> N; int a=0; int j=0; int ans=11; for(int i=1;i<sqrt(N)+1;i++) { a=0; if(N%i==0) { j=max(N/i,i); while(j>0){j/=10;a++;} ans=min(a,ans); } else continue; } cout << ans; }
a.cc: In function 'int main()': a.cc:20:5: error: invalid operands of types 'double' and 'int' to binary 'operator%' 20 | if(N%i==0) | ~^~ | | | | | int | double a.cc:22:6: error: no matching function for call to 'max(double, int&)' 22 | j=max(N/i,i); | ~~~^~~~~~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from /usr/include/c++/14/math.h:36, 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:22:6: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'int') 22 | j=max(N/i,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:4: /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:22:6: note: mismatched types 'std::initializer_list<_Tp>' and 'double' 22 | j=max(N/i,i); | ~~~^~~~~~~
s613103765
p03775
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; string abc="abcdefghijklmnopqrstuvwxyz"; string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; vector<ll>divisor(ll n){ vector<ll>res; for(ll i=1;i*i<=n;i++){ if(n%i==0){ res.push_back(i); res.push_back(n/i); } } return res; } int main(){ ll n;cin>>n; vector<ll>vec=divisor(n); ll MIN=INF; for(int i=0;i<n;i+=2){ string s=to_string(vec[i]); string t=to_string(vec[i+1]); MIN=min(MIN,max(s.size(),t.size())); } cout<<MIN<<endl; }
a.cc: In function 'int main()': a.cc:33:12: error: no matching function for call to 'min(ll&, const long unsigned int&)' 33 | MIN=min(MIN,max(s.size(),t.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:3: /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:33:12: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long unsigned int') 33 | MIN=min(MIN,max(s.size(),t.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:33:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 33 | MIN=min(MIN,max(s.size(),t.size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
s260593672
p03775
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <numeric> #include <map> #include <cmath> #include <math.h> #include <cstdio> #include <iomanip> typedef long long ll; using namespace std; bool is_prime(long long N) { if (N == 1) return false; for (long long i = 2; i * i <= N; ++i) { if (N % i == 0) return false; } return true; } bool is_sosu(ll n){ if ( n <= 1 ) return false; for (ll i = 2; i * i <= n; i++) { if (n % i == 0) return false; } return true; } vector<ll> yakusu(ll n){ vector<ll> res; for (int i = 1; i * i <= n; i++) { if (n % i == 0) {res.push_back(i); if (i != n / i) res.push_back(n / i); } } sort(res.begin(), res.end()); return res; } ll check_digi(ll n){ ll digit = 0; while (n > 0) { digit++; n /= 10; } return digit; } int main(void) { ll n; cin >> n; int ans = INT_MAX; for (ll a = 1; a * a <= n; a++) { if (n % a == 0) { ll b = n / a; int f = max(check_digi(a), check_digi(b)); ans = min(ans, f); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:57:19: error: 'INT_MAX' was not declared in this scope 57 | int ans = INT_MAX; | ^~~~~~~ a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 10 | #include <iomanip> +++ |+#include <climits> 11 | typedef long long ll;
s160444027
p03775
C
#include <stdio.h> #include <math.h> int main(void) { char arr[100]; unsigned long long int n; fgets(arr, sizeof(arr), stdin); sscanf(arr, "%lld", &n); unsigned long long int ans = n; int a; for (a=1; a*a <= n; a++) { if (n % a != 0) { continue; } unsigned long long int b = n/a; if (a > b) { r = a; } else { r = b; } if (ans > r) { ans = r; } } if (a*a == n) { ans = a; } int ans_s=0; for (; ans != 0;) { ans_s++; ans /= 10; } printf("%d", ans_s); return 0; }
main.c: In function 'main': main.c:23:7: error: 'r' undeclared (first use in this function) 23 | r = a; | ^ main.c:23:7: note: each undeclared identifier is reported only once for each function it appears in
s778516425
p03775
C++
#include <iostream> using namespace std; int CDigit(int x){ int i=1; while(x/10){ x = x/10; i++; } return i; } int main (){ int N,m=1; cin >> N; for(int i=1;i<(int)pow(N,0.5);i++){ if(N%i == 0)m = i; } cout << CDigit(m); }
a.cc: In function 'int main()': a.cc:14:22: error: 'pow' was not declared in this scope 14 | for(int i=1;i<(int)pow(N,0.5);i++){ | ^~~
s948288640
p03775
C++
//057 C - Digits in Multiplication 2017/03/26 #include <bits/stdc++.h> #define rep(i ,n) for(int i=0;i<(int)(n);++i) using namespace std; typedef long long int int64; typedef unsigned long long uint64; int f(uint64 a , uint64 b){ int a1=0; int b1=0; do{ ++a1; a/=10; } while(a!=0); do{ ++b1; b/=10; } while(b!=0); return max(a1 , b1); } int main(){ uint64 n;cin >>n; uint64 a,b; int ans=2000000000; for(int a=1;a*a<=n;++a){ if( n%i == 0 ) { b = n/a; int tmp = f( a , b); if( ans > tmp ) ans = tmp; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:28:15: error: 'i' was not declared in this scope 28 | if( n%i == 0 ) { | ^
s131930536
p03775
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define all(v) (v).begin(),(v).end() using namespace std; using ll = long long; using P = pair<int,int>; using G = vector<vector<int>>; nt calc_digit(long long n) { int res = 0; while (n > 0) { ++res; n /= 10; } return res; } int main() { long long N; cin >> N; long long res = INF; for (long long a = 1; a * a <= N; ++a) { if (N % a != 0) continue; long long b = N/a; long long tmp = max(calc_digit(a), calc_digit(b)); res = min(res, tmp); } cout << res << endl; }
a.cc:9:1: error: 'nt' does not name a type; did you mean 'int'? 9 | nt calc_digit(long long n) { | ^~ | int a.cc: In function 'int main()': a.cc:20:21: error: 'INF' was not declared in this scope 20 | long long res = INF; | ^~~ a.cc:24:29: error: 'calc_digit' was not declared in this scope 24 | long long tmp = max(calc_digit(a), calc_digit(b)); | ^~~~~~~~~~
s742565613
p03775
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, s, e) for (long long i = (long long)(s); i <= (long long)(e); i++) #define printYesNo(is_ok) puts(is_ok ? "Yes" : "No"); #define printVector(v) rep(i, v.size()) cout << v[i] << endl; int main() { long long N; cin >> N; int ans = INT32_MAX; FOR(A, 1, sqrt(N)) { if (N % A != 0) continue; long long B = N / A; int digit = max(to_string(A).size(), to_string(B).size()); ans = min(ans, digit); } cout << ans << endl; return 0; }#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, s, e) for (long long i = (long long)(s); i <= (long long)(e); i++) #define printYesNo(is_ok) puts(is_ok ? "Yes" : "No"); #define printVector(v) rep(i, v.size()) cout << v[i] << endl; int main() { long long N; cin >> N; int ans = INT32_MAX; FOR(A, 1, sqrt(N)) { if (N % A != 0) continue; long long B = N / A; int digit = max(to_string(A).size(), to_string(B).size()); ans = min(ans, digit); } cout << ans << endl; return 0; }
a.cc:23:2: error: stray '#' in program 23 | }#include <bits/stdc++.h> | ^ a.cc:23:3: error: 'include' does not name a type 23 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:30:5: error: redefinition of 'int main()' 30 | int main() | ^~~~ a.cc:8:5: note: 'int main()' previously defined here 8 | int main() | ^~~~
s486185862
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll N; cin >> N; ll digit = 1; for (ll i = 2; i <= sqrt(N); i++) { if (N%i == 0) { digit = i; } } cout << to_string(n/digit).length() << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:23: error: 'n' was not declared in this scope 15 | cout << to_string(n/digit).length() << endl; | ^
s879352576
p03775
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); Long a = sc.nextLong(); int b = 0; int c = 1; for(int i=1;i<=Math.sqrt(a);i++){if(a%i==0){c=a/i;} } while(c>0){c/=10; b++; } System.out.println(b); } }
Main.java:8: error: incompatible types: possible lossy conversion from long to int for(int i=1;i<=Math.sqrt(a);i++){if(a%i==0){c=a/i;} ^ 1 error
s865479130
p03775
C++
#include<iostream> #include<vector> #include<utility> #include<map> #include<deque> #include<numeric> #include<algorithm> #include<unordered_map> using namespace std; using ll = long long int; constexpr int INF = 1 << 29; constexpr ll MOD = ll(1e9 + 7); ll n; vector<ll> d; ll f(ll a, ll b) { return ll(max(log10(a), log10(b))) + 1; } ll divisor(ll n) { ll ret = ll(log10(n)) + 1; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ll a = i; if (i * i != n) { ll b = n / i; ll tmp = f(a, b); if (tmp < ret) ret = tmp; } } } return ret; } int main(void) { cin >> n; cout << divisor(n) << endl; return 0; }
a.cc: In function 'll f(ll, ll)': a.cc:19:23: error: 'log10' was not declared in this scope 19 | return ll(max(log10(a), log10(b))) + 1; | ^~~~~ a.cc: In function 'll divisor(ll)': a.cc:23:21: error: 'log10' was not declared in this scope 23 | ll ret = ll(log10(n)) + 1; | ^~~~~
s761700218
p03775
C++
using namespace std; int main(){ int N; cin >>N; int ketamin=11; for (int i=1;i<N/2+1;i++){ if(N%i==0){ ketamin=min(ketamin,max((int)log10(i)+1,(int)log10(N/i)+1)); } } cout<<ketamin<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >>N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:9:36: error: 'log10' was not declared in this scope 9 | ketamin=min(ketamin,max((int)log10(i)+1,(int)log10(N/i)+1)); | ^~~~~ a.cc:9:27: error: 'max' was not declared in this scope 9 | ketamin=min(ketamin,max((int)log10(i)+1,(int)log10(N/i)+1)); | ^~~ a.cc:9:15: error: 'min' was not declared in this scope; did you mean 'main'? 9 | ketamin=min(ketamin,max((int)log10(i)+1,(int)log10(N/i)+1)); | ^~~ | main a.cc:12:3: error: 'cout' was not declared in this scope 12 | cout<<ketamin<<endl; | ^~~~ a.cc:12:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:18: error: 'endl' was not declared in this scope 12 | cout<<ketamin<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s461741596
p03775
C++
#include <bits/stdc++.h> using namespace std; int CountOfDigits(int64_t n) { int sum = 0; while (n > 0) { sum ++; n /= 10; } return sum; } int main() { int N; cin >> N; int ans = CountOfDigits(N); for(int64_t i = 1; i*i <= N; i++){ if(N % i! = 0) continue; const int64_t j = N/i; const int cur = max(CountOfDigits(i),CountOfDigits(j)); if(ans>cur){ ans = cur; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:13: error: expected ')' before '!' token 20 | if(N % i! = 0) continue; | ~ ^ | )
s406231577
p03775
C++
#include <iostream> #include <algorithm> using namespace std; #define rep(i,n) for (int i=0;i<n;i++) #define REP(i,n) for (int i=1;i<=n;i++) #define print(x) cout << x << endl; typedef long long ll; ll ketasu(ll n) { ll count = 1; while (n >= 10) { n /= 10; count++; } return count; } int main() { ll n, ans; cin >> n; ll m = sqrt(n); for (ll i = m; i > 0; i--) { if (n % i == 0) { ans = ketasu(n / i); break; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:16: error: 'sqrt' was not declared in this scope 21 | ll m = sqrt(n); | ^~~~
s358704953
p03775
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <set> #include <vector> #define rep(i,n) for(int i=0; i< (int)(n); ++i) using namespace std; using ll=long long; int cnt_digits(ll n){ int digits = 0; while(n>0){ n/=10; digits ++; } return digits; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; for(ll a=1ll; a*a<n; ++a){ if(n%a!=0) continue; const ll b = n/a; const int cur = max(cnt_digits(a), cnt_digits(b)); if(ans > cur) ans = cur; } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:31:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 31 | if(ans > cur) ans = cur; | ^~~ | abs a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 33 | cout << ans << "\n"; | ^~~ | abs
s898127714
p03775
C++
#include <bits/stdc++.h> using namespace std; int main () { long N; cin >> N; long A, B, count, sub, ans = 1000; for(int i = 1; i <= squrt(N); i++){ if(N % i == 0){ A = N / i; B = i; sub = 0; count = 0; while(A != 0){ sub++; A /= 10; } while(B != 0){ count++; B /= 10; } count = max(sub, count); ans = min(ans, count); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:23: error: 'squrt' was not declared in this scope; did you mean 'sqrt'? 7 | for(int i = 1; i <= squrt(N); i++){ | ^~~~~ | sqrt
s776625631
p03775
Java
import java.util.Scanner; public class Main { static int keta(long n) { int i=0; while(n>0) { i++; n /= 10; } return i; } public static void main(String[] args) throws Exception{ Scanner stdIn = new Scanner(System.in); long N = stdIn.nextLong(); int a=keta(N); for(int i=1; i*i<=N ; i++) { if(N%i != 0) continue; int x = Math.max(keta(i),keta(N/i)); a = Math.min(x, a); } System.out.println(a); }
Main.java:21: error: reached end of file while parsing } ^ 1 error
s165543489
p03775
C++
#include <iostream> #include <cmath> #include <stdio.h> using namespace std; using ll = long long int s = 0; int Digits(ll m){ while (m != 0) { m /= 10; s++; } return s; } int main(){ ll n; cin >> n; int a = sqrt(n); while (n%a != 0){ a++; } int k = n/a; if (k > a){ a = k;; } Digits(a); return 0; }
a.cc:9:4: error: expected ';' before 's' 9 | int s = 0; | ^~ | ; a.cc:10:12: error: 'll' was not declared in this scope 10 | int Digits(ll m){ | ^~ a.cc: In function 'int main()': a.cc:19:5: error: 'll' was not declared in this scope 19 | ll n; | ^~ a.cc:20:12: error: 'n' was not declared in this scope; did you mean 'yn'? 20 | cin >> n; | ^ | yn a.cc:31:7: error: 'Digits' cannot be used as a function 31 | Digits(a); | ~~~~~~^~~
s521591869
p03775
C++
#include<bits/stdc++.h> int main(void){ int best,c,countA,countB,N; cin >> N; for(int i=1;i*i<N;i++){ int A = N/i; int B = i; if(N%A!=0)continue; countA = 0; countB = 0; while(A!=0){ A/=10; countA++; } while(B!=0){ B/=10; countB++; } if(best<countA){ best = countA; } if(best<countB){ best = countB; } } printf("%d",best); 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 /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~
s814097757
p03775
C++
#include<bits/stdc++.h> int main(void){ int best,c,countA,countB,N; for(int i=1;i*i<N;i++){ if(N%A!=0)continue; countA = 0; countB = 0; int A = N/i; int B = i; while(A!=0){ A/=10; countA++; } while(B!=0){ B/=10; countB++; } if(best<countA){ best = countA; } if(best<countB){ best = countB; } } printf("%d",best); return 0; }
a.cc: In function 'int main()': a.cc:6:10: error: 'A' was not declared in this scope 6 | if(N%A!=0)continue; | ^
s337805507
p03775
C++
#include<bits/stdc++.h> int main(void){ int best,c,countA,countB,N; for(int i=1;i*i<N;i++){ countA = 0; countB = 0; int A = N/i; int B = N/A; while(A!=0){ tmp/=10; countA++; } while(B!=0){ tmp/=10; countB++; } if(best<countA){ best = countA; } if(best<countB){ best = countB; } } printf("%d",best); return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'tmp' was not declared in this scope; did you mean 'tm'? 11 | tmp/=10; | ^~~ | tm a.cc:15:7: error: 'tmp' was not declared in this scope; did you mean 'tm'? 15 | tmp/=10; | ^~~ | tm
s204363666
p03775
C++
#include<bits/stdc++.h> int main(void){ int best,c,count,N; for(int i=0;i*i<N;i++){ count = 0; tmp = N/i; while(tmp!=0){ tmp/=10; count++; } if(best<count){ best = count; } } printf("%d",count); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'tmp' was not declared in this scope; did you mean 'tm'? 7 | tmp = N/i; | ^~~ | tm
s804227532
p03775
C++
#include<bits/stdc++.h> int main(void){ int best,c,count,N; for(int i=0;i<N;i++){ count = 0; tmp = N/i; while(tmp!=0){ tmp/=10; count++; } if(best<count){ best = count; } } printf("%d",count); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'tmp' was not declared in this scope; did you mean 'tm'? 7 | tmp = N/i; | ^~~ | tm
s380433312
p03775
C++
#include <bits/stdc++.h> using namespace std; int F(int A, int B){ int k, l; k = 0; l = 0; while(A != 0){ A /= 10; k++; } while(B != 0){ B /= 10; l++; } return max(k, l); } int main(){ int64_t N, ans; cin >> N; ans = 10000000; for(int i = 1; i <= sqrt(N); i++){ double j = N / i; int k = N / i; if(j == k){ int a = F(i, k); ans = min(a, ans); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:29:16: error: no matching function for call to 'min(int&, int64_t&)' 29 | ans = min(a, ans); | ~~~^~~~~~~~ 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:29:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64_t' {aka 'long int'}) 29 | ans = min(a, 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: /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:29:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 29 | ans = min(a, ans); | ~~~^~~~~~~~
s531619508
p03775
C++
//おまじないc++ #include <iostream> #include<cmath> #include<vector> #include <algorithm> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int digit(long int x) { int d = 0; while (x != 0) { x /=10; d++; } return d; } int main() { long int n; cin >> n; long int max = floor(sqrt(n)); int i; for (i = max; i > 0; i--) { if (n % i == 0) { break; } } cout << max({ digit(i), digit(n / i) }); }
a.cc: In function 'int main()': a.cc:30:28: error: 'max' cannot be used as a function 30 | cout << max({ digit(i), digit(n / i) }); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
s104115413
p03775
C++
//おまじないc++ #include <iostream> #include<cmath> #include<vector> #include <algorithm> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int digit(long int x) { int d = 0; while (x != 0) { x /=10; d++; } return d; } int main() { long int n; cin >> n; long int max = floor(sqrt(n)); int i; for (i = max; i > 0; i--) { if (n % i == 0) { break; } } cout << max(digit(i), digit(n / i)); }
a.cc: In function 'int main()': a.cc:30:28: error: 'max' cannot be used as a function 30 | cout << max(digit(i), digit(n / i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~
s490507479
p03775
C++
//おまじないc++ #include <iostream> #include<cmath> #include<vector> #include <algorithm> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int digit(long int x) { int d = 0; while (x != 0) { x /= 0; d++; } return d; } int main() { long int n; cin >> n; long int max = floor(sqrt(n)); int i; for (i = max; i > 0; i--) { if (n % i == 0) { break; } } cout << max(digit(i), digit(n / i)); }
a.cc: In function 'int digit(long int)': a.cc:12:19: warning: division by zero [-Wdiv-by-zero] 12 | x /= 0; | ~~^~~~ a.cc: In function 'int main()': a.cc:30:28: error: 'max' cannot be used as a function 30 | cout << max(digit(i), digit(n / i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~
s511831604
p03775
C++
//おまじないc++ #include <iostream> #include<cmath> #include<vector> #include <algorithm> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int digit(long int x) { int d = 0; while (x != 0) { x /= 0; d++; } } int main() { long int n; cin >> n; long int max = floor(sqrt(n)); int i; for (i = max; i > 0; i--) { if (n % i == 0) { break; } } cout << max(digit(i), digit(n / i)); }
a.cc: In function 'int digit(long int)': a.cc:12:19: warning: division by zero [-Wdiv-by-zero] 12 | x /= 0; | ~~^~~~ a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ a.cc: In function 'int main()': a.cc:29:28: error: 'max' cannot be used as a function 29 | cout << max(digit(i), digit(n / i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~
s825908747
p03775
C++
//おまじないc++ #include <iostream> #include<cmath> #include<vector> #include <algorithm> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int digit(long int x) { int d = 0; while (x != 0) { x /= 0; d++; } int main() { long int n; cin >> n; long int max = floor(sqrt(n)); int i; for (i = max; i > 0; i--) { if (n % i == 0) { break; } } cout << max(digit(i), digit(n / i)); }
a.cc: In function 'int digit(long int)': a.cc:12:19: warning: division by zero [-Wdiv-by-zero] 12 | x /= 0; | ~~^~~~ a.cc:16:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 16 | int main() { | ^~ a.cc:16:17: note: remove parentheses to default-initialize a variable 16 | int main() { | ^~ | -- a.cc:16:17: note: or replace parentheses with braces to value-initialize a variable a.cc:16:20: error: a function-definition is not allowed here before '{' token 16 | int main() { | ^ a.cc:29:10: error: expected '}' at end of input 29 | } | ^ a.cc:9:23: note: to match this '{' 9 | int digit(long int x) { | ^ a.cc:29:10: warning: no return statement in function returning non-void [-Wreturn-type] 29 | } | ^
s733799606
p03775
C++
require 'pp' require 'prime' require 'set' N=gets.chomp.split(' ').map{|n| n.to_i}.first # # if Prime.prime?(N) # puts N-1 # exit # end # # a=0 # b=0 # # mini = 1_000_000_000_000_0 # source = Math.sqrt(N).to_i+1 # 1.upto(source) do |n| # next if N%n!=0 # a=n # b=N/n # if ((a-1 + b-1) < mini) # mini = a-1 + b-1 # end # end # # puts mini # # # # a,b,x=gets.chomp.split(' ').map{|n| n.to_f} def divisors(n) n.prime_division.inject([1]) do |ary, (p, e)| (0..e).map{ |e1| p ** e1 }.product(ary).map{ |a, b| a * b } end.sort end def arc057func(a,b) [a.to_s.size, b.to_s.size].max end ans = 10**10 divisors(N).each do |n| candidate = arc057func(n, N/n) if candidate < ans ans = candidate end end puts ans
a.cc:1:9: warning: multi-character character constant [-Wmultichar] 1 | require 'pp' | ^~~~ a.cc:2:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 2 | require 'prime' | ^~~~~~~ a.cc:3:9: warning: multi-character character constant [-Wmultichar] 3 | require 'set' | ^~~~~ a.cc:7:11: error: token "." is not valid in preprocessor expressions 7 | # if Prime.prime?(N) | ^ a.cc:21: error: unterminated #if 21 | # if ((a-1 + b-1) < mini) a.cc:7: error: unterminated #if 7 | # if Prime.prime?(N) a.cc:1:1: error: 'require' does not name a type 1 | require 'pp' | ^~~~~~~ a.cc:5:40: error: expected unqualified-id before '.' token 5 | N=gets.chomp.split(' ').map{|n| n.to_i}.first | ^
s578687367
p03775
C
#include<bits/stdc++.h> using namespace std; int main(){ long long n,m; cin >> n; for(int i=1; i <= sqrt(n); i++){ if(n%i==0) m=(long long)log10(n/i)+1; } cout << m; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s896483415
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n,m; cin >> n; for(int i=1; i <= n/2; i++){ if(n%i==0) m=(lli)log10(m/i)+1; } cout << m; }
a.cc: In function 'int main()': a.cc:7:31: error: 'lli' was not declared in this scope 7 | if(n%i==0) m=(lli)log10(m/i)+1; | ^~~
s310241178
p03775
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; int count(ll n){ int res = 0; while(n>0){ res++; n/=10; } return res; } int main(){ ll N; cin >> N; //1*Nの桁数 int ans = count(N); for (ll A=1LL; A*A<=N; A++)} if(N%A!=0) continue; const int B = N/A; const int cur = max(count(A),count(B)); cur < ans ? ans = cur : 0; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:32: error: expected primary-expression before '}' token 19 | for (ll A=1LL; A*A<=N; A++)} | ^ a.cc: At global scope: a.cc:20:7: error: expected unqualified-id before 'if' 20 | if(N%A!=0) continue; | ^~ a.cc:21:21: error: 'N' was not declared in this scope 21 | const int B = N/A; | ^ a.cc:21:23: error: 'A' was not declared in this scope 21 | const int B = N/A; | ^ a.cc:22:33: error: 'A' was not declared in this scope 22 | const int cur = max(count(A),count(B)); | ^ a.cc:23:7: error: 'cur' does not name a type 23 | cur < ans ? ans = cur : 0; | ^~~ a.cc:24:5: error: expected declaration before '}' token 24 | } | ^ a.cc:25:3: error: 'cout' does not name a type 25 | cout << ans << endl; | ^~~~ a.cc:26:3: error: expected unqualified-id before 'return' 26 | return 0; | ^~~~~~ a.cc:27:1: error: expected declaration before '}' token 27 | } | ^
s615178794
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long x; long longi=0; cin >> x; while(x!=0){ i++; if(x>=2*i+1)x-=i; else if(x==i)x-=i; } cout << i; }
a.cc: In function 'int main()': a.cc:8:5: error: 'i' was not declared in this scope 8 | i++; | ^ a.cc:12:11: error: 'i' was not declared in this scope 12 | cout << i; | ^
s535155587
p03775
C++
#include<bits/stdc++.h> using namespace std; int keta(int n){ if(n<10)return 1; else if(n<100)return 2; else if(n<1000)return 3; else if(n<10000)return 4; else if(n<100000)return 5; else if(n<1000000)return 6; else return 7; } int main(){ long long n: cin >> n; int sqn = (int)sqrt((double)n) + 1; int i; int min = 7; for(i=1;i<=sqn;i++){ if(n%i==0){ if(min>max(keta(i),keta(n/i)))min = max(keta(i),keta(n/i)); } } cout << min; }
a.cc: In function 'int main()': a.cc:15:14: error: found ':' in nested-name-specifier, expected '::' 15 | long long n: | ^ | :: a.cc:15:13: error: 'n' has not been declared 15 | long long n: | ^ a.cc:16:7: error: qualified-id in declaration before '>>' token 16 | cin >> n; | ^~ a.cc:17:31: error: 'n' was not declared in this scope; did you mean 'yn'? 17 | int sqn = (int)sqrt((double)n) + 1; | ^ | yn
s588494215
p03775
C++
#include<bits/stdc++.h> using namespace std; int F(int n1, int n2) { int digit1 = 1, digit2 = 1; while(n1/10) { digit1++; n1 /= 10; } while(n2/10) { digit2++; n2 /= 10; } return max(digit1, digit2); } int main () { int N; cin >> N; for (int i=1;i<(N+1)/2;i++) { if (i==0) { ans = F(1,N); } else if (N%i==0) { ans = min(ans,F(i,N/i)); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | ans = F(1,N); | ^~~ | abs a.cc:27:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 27 | ans = min(ans,F(i,N/i)); | ^~~ | abs a.cc:30:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 30 | cout << ans << endl; | ^~~ | abs
s211392227
p03775
C++
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(false); cin.tie(0); #define FOR(i,s,n) for(int i = s; i < (n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(n) (n).begin(), (n).end() #define RALL(n) (n).rbegin(), (n).rend() #define ATYN(n) cout << ( (n) ? "Yes":"No") << endl; #define CFYN(n) cout << ( (n) ? "YES":"NO") << endl; using ll = long long; using ull = unsigned long long; using pii = pair<int,int>; int main(void) { IOS ll n; cin >> n; int ans = 1e8; for(ll i = 1;i * i <= n;i++) { if (n % i == 0) { string s = to_string(max(n/i,i)); ans = min(ans,s.size()); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:22: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)' 22 | ans = min(ans,s.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:22:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 22 | ans = min(ans,s.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:22:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | ans = min(ans,s.size()); | ~~~^~~~~~~~~~~~~~
s490034132
p03775
C++
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(false); cin.tie(0); #define FOR(i,s,n) for(int i = s; i < (n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(n) (n).begin(), (n).end() #define RALL(n) (n).rbegin(), (n).rend() #define ATYN(n) cout << ( (n) ? "Yes":"No") << endl; #define CFYN(n) cout << ( (n) ? "YES":"NO") << endl; using ll = long long; using ull = unsigned long long; using pii = pair<int,int>; int main(void) { IOS ll n; cin >> n; int ans = 1e8; FOR(i,1,i *i <= n) { if (n % i == 0) { string s = to_string(max(n/i,i)); ans = min(ans,s.size()); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:37: error: no matching function for call to 'max(ll, int&)' 21 | string s = to_string(max(n/i,i)); | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:21:37: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 21 | string s = to_string(max(n/i,i)); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:21:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | string s = to_string(max(n/i,i)); | ~~~^~~~~~~ a.cc:22:22: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)' 22 | ans = min(ans,s.size()); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:22:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 22 | ans = min(ans,s.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 /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:22:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | ans = min(ans,s.size()); | ~~~^~~~~~~~~~~~~~
s179185625
p03775
Java
import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int N = Integer.parseInt(sc.next()); int M = (int) Math.sqrt(N); int tmp=1; for(in i=1;i<M;i++){ if(N%i==0){ tmp = i; } } int r = Math.max(tmp,N/tmp); int count = 0; while(r>0){ r /= 10; count ++ ; } out.println(count); out.flush(); } }
Main.java:13: error: cannot find symbol for(in i=1;i<M;i++){ ^ symbol: class in location: class Main 1 error
s797621345
p03775
Java
public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { System.out.println(minF(sc.nextInt())); } } public static int minF(int n) { int balance = 1; int restMulti = 1; List<Integer> prime = new ArrayList<>(); for (int i = 2; i * i <= n; i++) { boolean rest = false; while (n % i == 0) { n /= i; if (rest) balance *= i; rest = !rest; } if (rest) { prime.add(i); restMulti *= i; } } if (n != 1) { prime.add(n); restMulti *= n; } if(prime.isEmpty()) { return (int)Math.log10(balance) + 1; } int minB = Integer.MAX_VALUE; for (int i = 2; i <= (1 << (prime.size() - 1)); i += 2) { BitSet set = BitSet.valueOf(new long[]{i}); int a = 1; for (int j = set.nextSetBit(0); j >= 0; j = set.nextSetBit(j + 1)) { a *= prime.get(j); } int b = restMulti / a; minB = Math.min(minB, Math.max(a, b)); } return (int)Math.log10(minB) + 1; } }
Main.java:4: error: cannot find symbol try (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol try (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main Main.java:12: error: cannot find symbol List<Integer> prime = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:12: error: cannot find symbol List<Integer> prime = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:36: error: cannot find symbol BitSet set = BitSet.valueOf(new long[]{i}); ^ symbol: class BitSet location: class Main Main.java:36: error: cannot find symbol BitSet set = BitSet.valueOf(new long[]{i}); ^ symbol: variable BitSet location: class Main 6 errors
s601848365
p03775
C++
#include <iostream> #include <string> #include <stack> #include <queue> #include <vector> #include <list> #include <set> #include <map> #include <algorithm> #include <cstdio> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repc(i, s, n) for (int i = (s); i <= (n); i++) #define rrep(i, n) for (int i = (n) - 1; i >= 0; i--) #define rrepc(i, s, n) for (int i = (s); i >= (n); i--) typedef long long ll; typedef unsigned long long ull; int main() { ll N; ll div; cin >> N; for (ll i = 1; i * i <= N; i++) { if (N % i == 0) div = N / i; } cout << (int)log10(div) + 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:32:22: error: 'log10' was not declared in this scope 32 | cout << (int)log10(div) + 1 << endl; | ^~~~~
s329382652
p03775
C++
import sys input = sys.stdin.readline def make_divisors(n): divisors = [] for i in range(1, int(n**0.5) + 1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) return divisors def main(): N = int(input()) a = make_divisors(N) a.sort() ans = 10 for i in a: ans = min(ans, len(str(max(i, N/i)))) print(ans) if __name__ == '__main__': main()
a.cc:23:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 23 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s046377782
p03775
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ long n; int a,s=0; cin >> n; a=(int)sqrt(n); while (n%a!=0) a--; n/=a; while (n>0){ s++; n/=10; } cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: 'sqrt' was not declared in this scope 8 | a=(int)sqrt(n); | ^~~~
s216316485
p03775
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ long n int a,s=0; cin >> n; a=(int)sqrt(n); while (n%a!=0) a--; n/=a; while (n>0){ s++; n/=10; } cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'int' 6 | int a,s=0; | ^~~ a.cc:7:10: error: 'n' was not declared in this scope 7 | cin >> n; | ^ a.cc:8:3: error: 'a' was not declared in this scope 8 | a=(int)sqrt(n); | ^ a.cc:8:10: error: 'sqrt' was not declared in this scope 8 | a=(int)sqrt(n); | ^~~~ a.cc:12:5: error: 's' was not declared in this scope 12 | s++; | ^ a.cc:15:11: error: 's' was not declared in this scope 15 | cout << s << endl; | ^
s792798896
p03775
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n; cin >> n; for(int i = sqrt(n); ; i--) { if(n % i == 0) { cout << int(log10(n / i)) + 1 << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:2:13: error: expected primary-expression before 'long' 2 | #define int long long | ^~~~ a.cc:10:15: note: in expansion of macro 'int' 10 | cout << int(log10(n / i)) + 1 << endl; | ^~~
s786058086
p03775
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main(){ double a; cin >> a; double b,c; a =b*c; double d == 10000000; for (int i= double ceil(double sqrt(double a)) ;i>=1;i--){ if(a%i == 0 && a/i%i == 0){ d = min(d,abs(i-a/i)); } cout << int log10(double d) << endl; ]
a.cc: In function 'int main()': a.cc:13:11: error: expected initializer before '==' token 13 | double d == 10000000; | ^~ a.cc:14:17: error: expected primary-expression before 'double' 14 | for (int i= double ceil(double sqrt(double a)) ;i>=1;i--){ | ^~~~~~ a.cc:16:14: error: invalid operands of types 'double' and 'int' to binary 'operator%' 16 | if(a%i == 0 && a/i%i == 0){ | ~^~ | | | | | int | double a.cc:16:28: error: invalid operands of types 'double' and 'int' to binary 'operator%' 16 | if(a%i == 0 && a/i%i == 0){ | ~~~^~ | | | | | int | double a.cc:18:12: error: 'd' was not declared in this scope 18 | d = min(d,abs(i-a/i)); | ^ a.cc:21:15: error: expected primary-expression before 'int' 21 | cout << int log10(double d) << endl; | ^~~ a.cc:22:7: error: expected primary-expression before ']' token 22 | ] | ^ a.cc:22:8: error: expected '}' at end of input 22 | ] | ^ a.cc:14:62: note: to match this '{' 14 | for (int i= double ceil(double sqrt(double a)) ;i>=1;i--){ | ^ a.cc:22:8: error: expected '}' at end of input 22 | ] | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s399493190
p03775
C++
#include <iostream> #include <vector> using namespace std; int GetDigit(long long int num){ int digit=0; while(num!=0){ num /= 10; digit++; } return digit; } int main() { long long int N; cin >> N; int a = 1; for(long long int i=2; i*i<=N; i++){ if(N%i==0){ a = i; } } int b = N/a; int a_keta = GetDigit(a); int b_keta = GetDigit(b); cout << max(a_keta, b_keta); } ~
a.cc:32:2: error: expected class-name at end of input 32 | ~ | ^
s897590058
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll inf = 1e18L + 5; ll dig(ll x) { ll cnt = 0; while (x) { cnt++; x /= 10; } return cnt; } fnc(ll N) { ll ans = inf; for (ll i = 1; i <= sqrt(N); i++) { if (N % i == 0) { ll a = i; ll b = N / i; ans = min(ans, max(dig(a), dig(b))); } } return ans; } int main() { ll N; cin >> N; cout << fnc(N); }
a.cc:18:1: error: ISO C++ forbids declaration of 'fnc' with no type [-fpermissive] 18 | fnc(ll N) | ^~~
s817850415
p03775
C++
<iostream>
a.cc:1:1: error: expected unqualified-id before '<' token 1 | <iostream> | ^
s159480455
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(long long int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { long long int a=0,b=0,c=0,d=0,n=0,count=0,ans=0; string s; cin>>n; for(long long int i=1;i<=sqrt(n);i++){ if(n%i==0){ ans=min(ans,max(int_sum(i),int_sum(n/i))); } } cout<<ans<<endl; return 0; } ///////////////////////////
a.cc: In function 'int main()': a.cc:31:14: error: no matching function for call to 'min(long long int&, const int&)' 31 | ans=min(ans,max(int_sum(i),int_sum(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:31:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 31 | ans=min(ans,max(int_sum(i),int_sum(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:31:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 31 | ans=min(ans,max(int_sum(i),int_sum(n/i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s716887511
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { long long int a=0,b=0,c=0,d=0,n=0,count=0,ans=0; string s; cin>>n; for(long long int i=1;i<=sqrt(n);i++){ if(n%i==0){ ans=min(ans,max(int_sum(i),int_sum(n/i))); } } cout<<ans<<endl; return 0; } ///////////////////////////
a.cc: In function 'int main()': a.cc:31:14: error: no matching function for call to 'min(long long int&, const int&)' 31 | ans=min(ans,max(int_sum(i),int_sum(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:31:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 31 | ans=min(ans,max(int_sum(i),int_sum(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:31:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 31 | ans=min(ans,max(int_sum(i),int_sum(n/i))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s201923177
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { long long int a=0,b=0,c=0,d=0,n=0,count=0,ans=0; string s; cin>>n; for(int i=1;i<=sqrt(n);i++){ if(n%i==0){ ans=min(ans,max(i,n/i)); } } cout<<ans<<endl; return 0; } ///////////////////////////
a.cc: In function 'int main()': a.cc:31:22: error: no matching function for call to 'max(int&, long long int)' 31 | ans=min(ans,max(i,n/i)); | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:31:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 31 | ans=min(ans,max(i,n/i)); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:31:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 31 | ans=min(ans,max(i,n/i)); | ~~~^~~~~~~
s890137097
p03775
Java
#include<iostream> #include <math.h> using namespace std; int main(){ long long n; cin >> n; int ans = 10; for(long long i=1; i<=sqrt(n); i++){ long long j = n / i; if(n == i*j){ int f = max((int)log10(i)+1, (int)log10(j)+1); ans = min(ans, f); } } cout << ans << endl; return 0; }
Main.java:1: error: illegal character: '#' #include<iostream> ^ Main.java:2: error: illegal character: '#' #include <math.h> ^ Main.java:5: error: not a statement long long n; ^ Main.java:6: error: not a statement cin >> n; ^ Main.java:9: error: not a statement for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:9: error: not a statement for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:10: error: not a statement long long j = n / i; ^ Main.java:16: error: not a statement cout << ans << endl; ^ Main.java:4: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) Main.java:5: error: ';' expected long long n; ^ Main.java:9: error: ';' expected for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:9: error: '.class' expected for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:9: error: ')' expected for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:9: error: ';' expected for(long long i=1; i<=sqrt(n); i++){ ^ Main.java:10: error: ';' expected long long j = n / i; ^ 15 errors
s319073202
p03775
C++
#include <bits/stdc++.h> using namespace std; int func(long long n) { int digits = 0; while(n > 0) { n /= 10; digits++; } return digits; } int main(void) { long long i,j; long long n; cin >> n; long long ans = (1<<29); for (i = 1; i*i <= n; i++) { if (n % i == 0) { j = n /i; ans = min(ans, func(j)); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:34: error: no matching function for call to 'min(long long int&, int)' 21 | ans = min(ans, func(j)); | ~~~^~~~~~~~~~~~~~ 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:21:34: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 21 | ans = min(ans, func(j)); | ~~~^~~~~~~~~~~~~~ /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:21:34: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | ans = min(ans, func(j)); | ~~~^~~~~~~~~~~~~~
s710766949
p03775
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;++i) #define rep1(i,n) for(int i=1;i<=n;++i) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; //桁 int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } signed main(){ int N; cin >> N; int answer = 100; for(int i = 1;i * i <= N;i++) { if(N % i == 0) { int A = N / i; int count =kt(A); } answer = min(answer,count); } } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:62:37: error: no matching function for call to 'min(long long int&, <unresolved overloaded function type>)' 62 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ 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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:36: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&' 233 | min(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:62:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 62 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ a.cc: At global scope: a.cc:65:9: error: 'cout' does not name a type 65 | cout << answer << endl; | ^~~~ a.cc:66:1: error: expected declaration before '}' token 66 | } | ^
s061324984
p03775
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cmath> #include<cstdlib> #include<tuple> #define int long long using namespace std; int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } signed main() { int N; cin >> N; int answer = 100; for(int i = 1;i * i <= N;i++) { if(N % i == 0) { int A = N / i; int count=0; count=kt(A); } answer = min(answer,count); } } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:26:37: error: no matching function for call to 'min(long long int&, <unresolved overloaded function type>)' 26 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ 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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:36: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&' 233 | min(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /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:26:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 26 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ a.cc: At global scope: a.cc:29:9: error: 'cout' does not name a type 29 | cout << answer << endl; | ^~~~ a.cc:30:1: error: expected declaration before '}' token 30 | } | ^
s001670877
p03775
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cmath> #include<cstdlib> #include<tuple> #define int long long using namespace std; int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } signed main() { int N; cin >> N; int answer = 100; for(int i = 1;i * i <= N;i++) { if(N % i == 0) { int A = N / i; int count =kt(A); } answer = min(answer,count); } } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:25:37: error: no matching function for call to 'min(long long int&, <unresolved overloaded function type>)' 25 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ 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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:36: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&' 233 | min(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /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:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 25 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ a.cc: At global scope: a.cc:28:9: error: 'cout' does not name a type 28 | cout << answer << endl; | ^~~~ a.cc:29:1: error: expected declaration before '}' token 29 | } | ^
s418809423
p03775
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cmath> #include<cstdlib> #include<tuple> #define int long long using namespace std; int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } signed main() { int N; cin >> N; int answer = 100; for(int i = 1;i * i <= N;i++) { if(N % i == 0) { int A = N / i; int count =kt(a); } answer = min(answer,count); } } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:23:39: error: 'a' was not declared in this scope 23 | int count =kt(a); | ^ a.cc:25:37: error: no matching function for call to 'min(long long int&, <unresolved overloaded function type>)' 25 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ 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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:36: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&' 233 | min(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /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:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 25 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ a.cc: At global scope: a.cc:28:9: error: 'cout' does not name a type 28 | cout << answer << endl; | ^~~~ a.cc:29:1: error: expected declaration before '}' token 29 | } | ^
s595655623
p03775
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cmath> #include<cstdlib> #include<tuple> #define int long long using namespace std; signed main() { int N; cin >> N; int answer = 100; for(int i = 1;i * i <= N;i++) { if(N % i == 0) { int A = N / i; int count =kt(a); } answer = min(answer,count); } } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:18:39: error: 'a' was not declared in this scope 18 | int count =kt(a); | ^ a.cc:18:36: error: 'kt' was not declared in this scope 18 | int count =kt(a); | ^~ a.cc:20:37: error: no matching function for call to 'min(long long int&, <unresolved overloaded function type>)' 20 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ 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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:36: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&' 233 | min(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /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:20:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 20 | answer = min(answer,count); | ~~~^~~~~~~~~~~~~~ a.cc: At global scope: a.cc:23:9: error: 'cout' does not name a type 23 | cout << answer << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s009750271
p03775
C++
#include <iostream> #include <string> #include <cstdlib> #include <vector> #include <array> #include <map> #include <set> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <climits> #include <cstdio> #include <iomanip> #include <utility> using namespace std; typedef long long int ll; vector<ll> divisor(ll n); ll GetDigit(ll num) { return std::to_string(num).length(); } int main(int argc, char const *argv[]) { ll n; cin >> n; vector<ll> v = divisor(n); ll _min = 100000; for (auto e : v) { ll temp = max(GetDigit(e), GetDigit(n / e)); if (temp < _min) { _min = temp; } } cout << _min << endl; }
/usr/bin/ld: /tmp/ccxC9mx9.o: in function `main': a.cc:(.text+0x79): undefined reference to `divisor(long long)' collect2: error: ld returned 1 exit status
s013956376
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; int mn=10; for (ll i=1;i*i<=n;i++) if (n%i==0) mn=min(mn,max(to_string(i).size(),to_string(n/i).size())); cout<<mn<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: no matching function for call to 'min(int&, const long unsigned int&)' 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:11:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:11:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s948853569
p03775
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; int mn=10; for (ll i=1;i*i<=n;i++) if (n%i==0) mn=min(mn,max(to_string(i).size(),to_string(n/i).size())) cout<<mn<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: no matching function for call to 'min(int&, const long unsigned int&)' 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:11:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:11:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 11 | mn=min(mn,max(to_string(i).size(),to_string(n/i).size())) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s567641283
p03775
C++
# include <bits/stdc++.h> # define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) # define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i) # define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i) # define rreps(i, n) for(int i=((int)(n)); i>0; --i) # define ALL(x) (x).begin(), (x).end() # define SZ(x) ((int)(x).size) # define pb push_back # define optimize_cin() cin.tie(0); ios::sync_with_stdio(false) using namespace std; using lint = long long; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int countDigit(int n) { int digit = 1; clock_t start,end; start = clock(); while((n /= 10) != 0) digit++; end = clock(); return digit; //printf("countDigit() digit::%d time::%dms\n",digit,(int)(end - start)); } int main() { int keta = 0; int f = 10000; long n; cin >> n; reps(i,n/2+1){ if(n % i != 0) continue; long a = i; long b = n /a; //cout << a << "," << b << endl; keta = countDigit(max(a,b); //cout << "大きい方の桁数:" << keta << endl; chmin(f,keta); } cout << f; return 0; }
a.cc: In function 'int main()': a.cc:40:31: error: expected ')' before ';' token 40 | keta = countDigit(max(a,b); | ~ ^ | )
s894981945
p03775
C++
#include<bits/stdc++.h> using namespace std; long long n,a,b,i,j,ans,m; int main() { cin>>n; for(i=1;i*i<=n;i++) { if(n%i!=0) {continue;} a=i; b=n/i; m=max(a,b); j=0; while(m!=0){ m=m/10; j++;} m=j;}cout<<m return 0; }
a.cc: In function 'int main()': a.cc:16:13: error: expected ';' before 'return' 16 | m=j;}cout<<m | ^ | ; 17 | return 0; | ~~~~~~
s189418478
p03775
C++
#include <isotream> #icnlude <cmath> using namespace std; int main(){ unsigned long long int l; cin >> l; unsigned long long int a = sqrt(l); int tmp = 1000; for(long long int i = 1; i <= a; i++){ if(a % i != 0) continue; unsigned long long int b = a / i; int p = log10(i), q = log10(b); p++, q++; if(max(p, q) > tmp) tmp = max(p,q); } cout << tmp; }
a.cc:1:10: fatal error: isotream: No such file or directory 1 | #include <isotream> | ^~~~~~~~~~ compilation terminated.
s372789374
p03775
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N;//Nの素因数を求めてから、そのかけ合わせでできるうちのFの最小値を求める cin>>N; vector<pair<int,int>> F; int c=0; /*if(N==1) { cout<< 1 << endl; return 0; } */ for(int i=1;i<sqrt(N);i++){ if(N%i==0) { F[i].first=i; F[i].second=N/i; c++; } F.resize(c); vector<pair<string,string>> f(c); vector<int> s(c); for(int i=0;i<c;i++){ f[i].first=to_string(F[i].first); f[i].second=to_string(F[i].second); s[i]=max(size(f[i].first),size(f[i].second)); } sort(s.begin(),s.end()); cout<<s[0]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s829529589
p03775
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-(p))) int cmp(const void *a, const void *b); //your code here! ll F(ll a, ll b); int main(void){ ll N, s, i; scanf("%lld", &N); ll MIN = F(1, N); N%2==0 ? s=2: s=3; for(i=s; i<=sqrt(N); i+=2){ if(N%i==0){ chmin(MIN, F(i, N/i)); } } printf("%lld\n", MIN); return 0; } ll F(ll a, ll b){ ll w=max(a,b), cnt=0; while(w!=0){ w /= 10; cnt++; } return cnt; } int cmp(const void *a, const void *b){ ll A=*(ll *)a, B=*(ll *)b; if(A==B)return 0; else return A>B ? 1:-1;//昇順ソート }
main.c: In function 'main': main.c:19:20: error: lvalue required as left operand of assignment 19 | N%2==0 ? s=2: s=3; | ^
s366331568
p03775
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0;i<(int)(n);i++) #define rrep(i, n) for(int i=((int)(n));i>0;i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define SORT(c) sort((c).begin(),(c).end()) #define REVERSE(c) reverse((c).begin(),(c).end()) #define REVSORT(c) SORT(c);REVERSE(c) #define ALL(x) (x).begin(),(x).end() #define INF 1e9 const long long MOD = 10e9 + 7; typedef long long ll; int F(long long A, long long B){ return max(to_string(A).size(), to_string(B).size()); } int main(){ ll N; cin >> N; int ans = to_string(N).size(); for(int A = 1; A * A <= N; A++){ if(N % A != 0)continue; ll B = N / A; int X = F(A, B)); if(ans > X)ans = X; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:26:32: error: expected ',' or ';' before ')' token 26 | int X = F(A, B)); | ^
s981614768
p03775
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0;i<(int)(n);i++) #define rrep(i, n) for(int i=((int)(n));i>0;i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define SORT(c) sort((c).begin(),(c).end()) #define REVERSE(c) reverse((c).begin(),(c).end()) #define REVSORT(c) SORT(c);REVERSE(c) #define ALL(x) (x).begin(),(x).end() #define INF 1e9 const long long MOD = 10e9 + 7; typedef long long ll; ll F(ll a, ll b){ return max(to_string(a).size(), to_string(b).size()); } int main(){ ll N; cin >> N; ll ans = to_string(N).size(); for(ll i = 1; i * i < N; i++){ if(N % i != 0)continue; ll B = N / i; ll ans = max(ans, min(F(i), F(B))); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:26:40: error: too few arguments to function 'll F(ll, ll)' 26 | ll ans = max(ans, min(F(i), F(B))); | ~^~~ a.cc:14:4: note: declared here 14 | ll F(ll a, ll b){ | ^ a.cc:26:46: error: too few arguments to function 'll F(ll, ll)' 26 | ll ans = max(ans, min(F(i), F(B))); | ~^~~ a.cc:14:4: note: declared here 14 | ll F(ll a, ll b){ | ^
s468293527
p03775
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;++i) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; //桁 int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } signed main(){ int a; int b=0; int c=0; cin>>a; for(int i=1;i<=a;i++){ if(a%i===0){ b=a/i; if(i>=b){ c=i; break; } } } cout<<kt(c); }
a.cc: In function 'int main()': a.cc:57:12: error: expected primary-expression before '=' token 57 | if(a%i===0){ | ^
s315668763
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin>>n; int64_t z=0; int64_t x=sqrt(n)/1; for(int i=0;i<x;i++){ if(n%(x-i))==0){ z+=n/(x-i); break; } } int count=0; while(z>0){ z/10; count++; } cout<<count; }
a.cc: In function 'int main()': a.cc:9:16: error: expected primary-expression before '==' token 9 | if(n%(x-i))==0){ | ^~
s259776798
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin>>n; int64_t z=0; for(int i=0;i<sqrt(n)/1;i++){ if(n%((sqrt(n)/1)-i))==0){ z+=n/((sqrt(n)/1)-i); break; } } int count=0; while(z>0){ z/10; count++; } cout<<count; }
a.cc: In function 'int main()': a.cc:8:9: error: invalid operands of types 'int64_t' {aka 'long int'} and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} to binary 'operator%' 8 | if(n%((sqrt(n)/1)-i))==0){ | ~^~~~~~~~~~~~~~~~ | | | | | __gnu_cxx::__enable_if<true, double>::__type {aka double} | int64_t {aka long int} a.cc:8:26: error: expected primary-expression before '==' token 8 | if(n%((sqrt(n)/1)-i))==0){ | ^~
s571652283
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin>>n; for(int i=0;i<sqrt(n)/1;i++){ if(n%((sqrt(n)/1)-i))==0){ int64_t z= n/((sqrt(n)/1)-i); break; } } int count=0; while(z>0){ z/10; count++; } cout<<count; }
a.cc: In function 'int main()': a.cc:7:9: error: invalid operands of types 'int64_t' {aka 'long int'} and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} to binary 'operator%' 7 | if(n%((sqrt(n)/1)-i))==0){ | ~^~~~~~~~~~~~~~~~ | | | | | __gnu_cxx::__enable_if<true, double>::__type {aka double} | int64_t {aka long int} a.cc:7:26: error: expected primary-expression before '==' token 7 | if(n%((sqrt(n)/1)-i))==0){ | ^~ a.cc:13:9: error: 'z' was not declared in this scope 13 | while(z>0){ | ^
s268694290
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin>>n; int(int i=0;i<sqrt(n)/1;i++){ if(n%((sqrt(n)/1)-i))==0){ int64_t z= n/((sqrt(n)/1)-i); break; } } int count=0; while(z>0){ z/10; count++; } cout<<count; }
a.cc: In function 'int main()': a.cc:6:3: error: expected primary-expression before 'int' 6 | int(int i=0;i<sqrt(n)/1;i++){ | ^~~ a.cc:6:15: error: 'i' was not declared in this scope 6 | int(int i=0;i<sqrt(n)/1;i++){ | ^ a.cc:13:9: error: 'z' was not declared in this scope 13 | while(z>0){ | ^
s272809835
p03775
C
/* Coached by rainboy */ #include <stdio.h> int length(long long n) { return n == 0 ? 0 : length(n / 10) + 1; } int main() { long long n, a; scanf("%lld", &n); for (a = 1; a <= n / a; a++) if (n % a == 0) a_ = a; printf("%d\n", length(n / a_)); return 0; }
main.c: In function 'main': main.c:14:25: error: 'a_' undeclared (first use in this function); did you mean 'a'? 14 | a_ = a; | ^~ | a main.c:14:25: note: each undeclared identifier is reported only once for each function it appears in
s769296945
p03775
C++
#include <iostream> #include <vector> #include <string> auto main() -> int { int n = 0; std::cin >> n; std::vector<int> my_vec; for (auto i = 0; i < n; ++i) { if (n / i == 0) my_vec.emplace_back(n / i < i ? n / i : i); } int num = *std::min_element(my_vec.begin(), my_vec.end()); std::cout << std::to_string(num).length(); }
a.cc: In function 'int main()': a.cc:17:20: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 17 | int num = *std::min_element(my_vec.begin(), my_vec.end()); | ^~~~~~~~~~~ | tuple_element
s422180445
p03775
C++
#include <iostream> #include <vector> #include <string> auto main() -> int { int n = 0; std::cin >> n; std::vector my_vec; for (auto i = 0; i < n; ++i) { if (n / i == 0) my_vec.emplace_back(n / i < i ? n / i : i); } int num = *std::min_element(my_vec.begin(), my_vec.end()); std::cout << std::to_string(num).length(); }
a.cc: In function 'int main()': a.cc:9:16: error: class template argument deduction failed: 9 | std::vector my_vec; | ^~~~~~ a.cc:9:16: error: no matching function for call to 'vector()' In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: template argument deduction/substitution failed: a.cc:9:16: note: couldn't deduce template parameter '_Tp' 9 | std::vector my_vec; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 0 provided a.cc:17:20: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 17 | int num = *std::min_element(my_vec.begin(), my_vec.end()); | ^~~~~~~~~~~ | tuple_element
s327406092
p03775
C++
// luogu-judger-enable-o2 #include <bits/stdc++.h> int lenlong(int i) { int len=0; while(i!=0) len++,i/=10; return len; } using namespace std; int main() { int a; cin>>a; for(int i=sqrt(a);i>=1;i--) if(a%i==0) cout<<lenlong(a/i)<<endl; } }
a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s715819181
p03775
C++
// luogu-judger-enable-o2 #include <bits/stdc++.h> int lenlong(int i) { int len=0; while(i!=0) len++,i/=10; return len; } using namespace std; int main() { int a,b=0; cin>>a; for(int i=2;i<=sqrt(a);i++) if(a%i==0) c=1; if(!c) { cout<<lenlong(a); return 0; } else { for(int i=sqrt(a);i>=2;i--) if(a%i==0) cout<<lenlong(a/i); } }
a.cc: In function 'int main()': a.cc:17:5: error: 'c' was not declared in this scope 17 | c=1; | ^ a.cc:18:9: error: 'c' was not declared in this scope 18 | if(!c) | ^
s242004326
p03775
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod=1e9+7; int GetDigit(int num){ int digit=0; while(num!=0){ num/=10; digit++; } return digit; } int main(){ ll N; cin >> N; ll ans=N; int min=10; for(ll i=1; i<=sqrt(N); i++){ if(N%i==0){ if(GetDigit(max(N/i, i))<min){ min=GetDigit(max(N/i,i)); } } } cout << min; }
a.cc: In function 'int main()': a.cc:20:19: error: '\U0000ff1dsqrt' was not declared in this scope; did you mean 'sqrt'? 20 | for(ll i=1; i<=sqrt(N); i++){ | ^~~~~~ | sqrt
s858239557
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) using ll =long long; ll func(ll a,ll b){ ll al=to_string(a).size(); ll bl=to_string(b).size(); return max(al,bl); } main(){ ll n; cin>>n; int ans=(1<<28); for(ll i=1;i*i<=n;++i){ if(n%i!=0)continue; ll a=i,b=n/i; ans=min(ans,func(a,b)); } cout<<ans<<endl; }
a.cc:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 10 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:17:12: error: no matching function for call to 'min(int&, ll)' 17 | ans=min(ans,func(a,b)); | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:17:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 17 | ans=min(ans,func(a,b)); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:17:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 17 | ans=min(ans,func(a,b)); | ~~~^~~~~~~~~~~~~~~
s509041693
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) using ll =long long; main(){ ll n; cin>>n; int ans=(1<<28); for(ll i=1;i*i<=n;++i){ if(n%i!=0)continue; ll a=i,b=n/i; ans=min(ans,max(to_string(a).size(),to_string(b).size())); } cout<<ans<<endl; }
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:12: error: no matching function for call to 'min(int&, const long unsigned int&)' 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:12:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s852609227
p03775
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) using ll =long long; main(){ ll n; cin>>n; int ans=(1<<28); for(ll i=1;i*i<=n;++){ if(n%i!=0)continue; ll a=i,b=n/i; ans=min(ans,max(to_string(a).size(),to_string(b).size())); } cout<<ans<<endl; }
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:9:23: error: expected primary-expression before ')' token 9 | for(ll i=1;i*i<=n;++){ | ^ a.cc:12:12: error: no matching function for call to 'min(int&, const long unsigned int&)' 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:12:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | ans=min(ans,max(to_string(a).size(),to_string(b).size())); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s713578410
p03775
C++
#include<cstdio> #include<cmath> using namespace std; long long n,ans;。 int s; int main(){ scanf("%lld",&n); for(int i=sqrt(n);i>0;--i) if(n%i==0){ ans=n/i; break; } while(ans>0){ ++s; ans/=10; } printf("%d\n",s); return 0; }
a.cc:4:17: error: extended character 。 is not valid in an identifier 4 | long long n,ans;。 | ^ a.cc:4:17: error: '\U00003002' does not name a type 4 | long long n,ans;。 | ^~ a.cc: In function 'int main()': a.cc:14:11: error: 's' was not declared in this scope 14 | ++s; | ^ a.cc:17:19: error: 's' was not declared in this scope 17 | printf("%d\n",s); | ^
s271101280
p03775
C++
#include<iostream> #include<cmath> using namespace std; int main() { __int64 n; __int64 a,b; cin>>n; for(int i=1;i<=sqrt(n);i++) { if(n%i==0) { a=i; b=n/a; } } //cout<<a<<" "<<b<<endl; //int p,q; long long count=0; if(a>=b) { while(a!=0) { count++; a/=10; } } else { while(b!=0) { count++; b/=10; } } cout<<count<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 6 | __int64 n; | ^~~~~~~ | __ynf64 a.cc:7:16: error: expected ';' before 'a' 7 | __int64 a,b; | ^~ | ; a.cc:8:14: error: 'n' was not declared in this scope; did you mean 'yn'? 8 | cin>>n; | ^ | yn a.cc:13:25: error: 'a' was not declared in this scope 13 | a=i; | ^ a.cc:14:25: error: 'b' was not declared in this scope 14 | b=n/a; | ^ a.cc:20:12: error: 'a' was not declared in this scope 20 | if(a>=b) | ^ a.cc:20:15: error: 'b' was not declared in this scope 20 | if(a>=b) | ^
s945747481
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c; int d=0; int b=a/c cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ if(c==i){ for(int j=0;b!=0;j++){ b=b/10; d++; } break; } c=i; } } cout<<d; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'cin' 8 | cin>>a; | ^~~
s409805933
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c; int d=0; cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ if(c==i){ for(int j=0;a/c!=0;j++){ a/c=a/c/10; d++; } break; } c=i; } } cout<<d; }
a.cc: In function 'int main()': a.cc:12:10: error: lvalue required as left operand of assignment 12 | a/c=a/c/10; | ~^~
s878909667
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c; int d=0; cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ if(c==i){ for(int j=0;a/c!=0;j++){ a/c=a/c/10; d++; break; } c=i; } } cout<<d; }
a.cc: In function 'int main()': a.cc:12:10: error: lvalue required as left operand of assignment 12 | a/c=a/c/10; | ~^~ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s400983222
p03775
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c; int d=0; cin>>a; for(int i=1;i<=a;i++) if(a%i==0){ if(c==i){ for(int j=0;a/c!=0;j++){ a/c=a/c/10; d++; break; } c=i; } cout<<d; }
a.cc: In function 'int main()': a.cc:12:10: error: lvalue required as left operand of assignment 12 | a/c=a/c/10; | ~^~ a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^