submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s665891231 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
ll N,M; cin >> N >> M;
ll x[N],y[N],a[M],b[M];
for(int i=0; i<N; i++) {
cin >> x[i] >> y[i] ;
}
for(int i=0; i<M; i++) {
cin >> a[i] >> b[i];
}
for(int i=0; i<M; i++) {
ll ans = INT_MAX;
ll ind = 0;
for(int j=0; j<N; j++) {
if( ans < abs(x[i] - a[j]) + abs(y[i] - b[j]) ) ) {
ans = abs(x[i] - a[j]) + abs(y[i] - b[j]) );
ind = j;
}
}
cout << ind+1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:62: error: expected primary-expression before ')' token
21 | if( ans < abs(x[i] - a[j]) + abs(y[i] - b[j]) ) ) {
| ^
|
s286041302 | p03774 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
using namespace std;
int plus(int a){
if(a<0)
a=-a;
return a;
}
int main(){
int n,m;
cin>>n>>m;
vector<pair<int,int> >pii;
for(int i=0;i<n;i++){
int a,b;
cin>>a>>b;
pii.pb(mp(a,b));
}
vector<int>ans;
for(int i=0;i<m;i++){
int a,b;
int min=INF;
cin>>a>>b;
int flag=-1;
for(int j=0;j<pii.size();j++){
int c=plus((a-pii[i].F));
int d=plus((b-pii[i].S));
if(min>c+d){
min=c+d;
flag=j+1;
}
}
ans.pb(flag);
}
for(int i=0;i<ans.size();i++){
cout<<ans[i]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:37:13: error: reference to 'plus' is ambiguous
37 | int c=plus((a-pii[i].F));
| ^~~~
In file included from /usr/include/c++/14/string:49,
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_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
160 | struct plus;
| ^~~~
a.cc:16:5: note: 'int plus(int)'
16 | int plus(int a){
| ^~~~
a.cc:38:13: error: reference to 'plus' is ambiguous
38 | int d=plus((b-pii[i].S));
| ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
160 | struct plus;
| ^~~~
a.cc:16:5: note: 'int plus(int)'
16 | int plus(int a){
| ^~~~
|
s134092869 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
inline cal(int a,int b,int c,int d){
return abs(a-c) + abs(b-d);
}
int main()
{
int n,m,x,y;
cin >> n >> m;
vector < pair < int , int > > st;
vector < pair < int , int > > chk;
for(int i=0;i<n;i++){
cin >> x >> y;
st.push_back(make_pair(x,y));
}
for(int j=0;j<m;j++){
cin >> x >> y;
chk.push_back(make_pair(x,y));
}
for(int i=0;i<n;i++){
int res = INT_MAX,idx = m;
for(int j=m-1;j>=0;j--){
int temp = cal(st[i].first,st[i].second,chk[j].first,chk[j].second);
if(res >= temp){
res = temp;
idx = j;
}
}
cout << idx+1 << endl;
}
return 0;
}
| a.cc:4:8: error: ISO C++ forbids declaration of 'cal' with no type [-fpermissive]
4 | inline cal(int a,int b,int c,int d){
| ^~~
|
s929816782 | p03774 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int x1[100], y1[100], x2[100], y2[100];
int main(){
int N, M;
cin >> N >> M;
for(int i = 1; i <= N; i++){
cin >> x1[i] >> y1[i];
}
for(int i = 0; i < M; i++){
cin >> x2[i] >> y2[i];
int ans, maxim;
mini = 1000000000;
for(int j = 1; j <= N; j++){
int hoge = abs(x1 - x2) + abs(y1 - y2);
if(hoge < mini){
mini = hoge;
ans = j;
}
}
cout << ans << endl;
}
return 0;
} | a.cc:6:20: error: 'int y1 [100]' redeclared as different kind of entity
6 | int x1[100], y1[100], x2[100], y2[100];
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/bits/requires_hosted.h:31,
from /usr/include/c++/14/iostream:38,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:12:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
12 | cin >> x1[i] >> y1[i];
| ^
a.cc:12:14: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
12 | cin >> x1[i] >> y1[i];
| ~~~~~~~~~~~~ ^~ ~~~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
12 | cin >> x1[i] >> y1[i];
| ~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(short int)(y1 + ((sizetype)i))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(short unsigned int)(y1 + ((sizetype)i))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(int)(y1 + ((sizetype)i))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(unsigned int)(y1 + ((sizetype)i))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(long int)(y1 + ((sizetype)i))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(long unsigned int)(y1 + ((sizetype)i))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(long long int)(y1 + ((sizetype)i))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(long long unsigned int)(y1 + ((sizetype)i))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:12:21: error: cannot bind rvalue '(void*)(y1 + ((sizetype)i))' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
12 | cin >> x1[i] >> y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:21: error: invalid conversion from 'd |
s836201685 | p03774 | C++ | #include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
#include<string>
#include<set>
#include<numeric>
#include<functional>
#include<unordered_map>
#include<cmath>
#include<cstdlib>
#include<cassert>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<long long> a(N), b(N), c(M), d(M);
for (int i = 0; i < N; i++)
cin >> a[i] >> b[i];
for (int i = 0; i < M; i++)
cin >> c[i] >> d[i];
for (int i = 0; i < N; i++) {
int ans = -1, min_distance = INT_MAX;
for (int j = 0; j < M; j++) {
int distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
if (distance < min_distance) {
ans = j + 1;
min_distance = distance;
}
}
cout << ans << endl;
}
} | a.cc: In function 'int main()':
a.cc:24:46: error: 'INT_MAX' was not declared in this scope
24 | int ans = -1, min_distance = INT_MAX;
| ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
12 | #include<cassert>
+++ |+#include <climits>
13 | using namespace std;
|
s684277083 | p03774 | C++ | #include<bits\stdc++.h>
using namespace std;
#define fi first
#define se second
#define MAX 40000000000000001
typedef pair<int,int> pii;
typedef long long ll;
int N,M;
pii A[100],B[100];
int main()
{
scanf("%d%d",&N,&M);
for(int i = 0; i < N; i++)scanf("%d%d",&A[i].fi ,&A[i].se);
for(int i = 0; i < M; i++)scanf("%d%d",&B[i].fi ,&B[i].se);
for(int i = 0; i < N; i++)
{
ll MIN = MAX;int ans = 0;
for(int j = 0; j < M; j++)
{
if(abs(A[i].fi - B[j].fi) + abs(A[i].se - B[j].se) < MIN)
{
MIN = abs(A[i].fi - B[j].fi) + abs(A[i].se - B[j].se);
ans = j + 1;
}
}
printf("%d\n",ans);
}
return 0;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s077018279 | p03774 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int i, n, m, a[50], b[50], c[50], d[50];
cin >> n >> m;
for(i=0; i<n; i++) cin >> a[i] >> b[i];
for(i=0; i<m; i++) cin >> c[i] >> d[i];
int cp, dis, dmin;
for(int i=0; i<n; i++){
dmin = 1000000007
for(int j=0; j<m; j++){
dis = fabs(c[j]-a[i]) + fabs(d[j]-b[i]);
if(dis < dmin){
dmin = dis;
cp = j + 1;
}
}
cout << cp << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:26: error: expected ';' before 'for'
17 | dmin = 1000000007
| ^
| ;
18 | for(int j=0; j<m; j++){
| ~~~
a.cc:18:22: error: 'j' was not declared in this scope
18 | for(int j=0; j<m; j++){
| ^
|
s377709833 | p03774 | C++ | #include "iostream"
using namespace std;
int main(){
long long int N,M,a,b,c,d,min=200000001;
cin>>N>>M;
for(int i=1;i<=N;i++){
cin>>a>>b;
}
for(int j=1;j<=M;j++){
cin>>c>>d;
}
for(int k=1;k<=N;k++){
if(min>abs(a-b)+abs(c-d)){
for(int l=1;l<=M;l++){
min=abs(a-b)+abs(c-d);
}
cout<<min<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s160268885 | p03774 | C++ | #include "iostream"
using namespace std;
int main(){
long long int N,M,a,b,c,d,min=200000001;
cin>>N>>M;
for(int i=1;i<=N;i++){
cin>>a>>b;
}
for(int j=1;j<=M;j++){
cin>>c>>d;
}
for(int k=1;k<=N;k++){
if(min>abs(a-b)+abs(c-d)){
for(int l=1;l<=M;l++){
min=abs(a-b)+abs(c-d);
}
cout<<mim<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:7: error: 'mim' was not declared in this scope; did you mean 'min'?
17 | cout<<mim<<endl;
| ^~~
| min
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s126501651 | p03774 | C++ | #include<iostream>
using namespace std;
int main(){
int n, m;
vector<long long> a, b, c, d;
cin >> n >> m;
a.resize(n);
b.resize(n);
c.resize(m);
d.resize(m);
for(int i=0; i < n; i++) cin >> a[i] >> b[i];
for(int i=0; i<m;i++) cin >> c[i] >> d[i];
for (int i=0;i<n;i++){
long long m = 10000000000;
int id= 0;
for (int j=0; j < m; j++) if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < m){
m = abs(a[i] - c[j]) + abs(b[i] - d[j]);
id = j;
}
cout << id+1<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:1: error: 'vector' was not declared in this scope
7 | vector<long long> a, b, c, d;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 |
a.cc:7:8: error: expected primary-expression before 'long'
7 | vector<long long> a, b, c, d;
| ^~~~
a.cc:9:1: error: 'a' was not declared in this scope
9 | a.resize(n);
| ^
a.cc:10:1: error: 'b' was not declared in this scope
10 | b.resize(n);
| ^
a.cc:11:1: error: 'c' was not declared in this scope
11 | c.resize(m);
| ^
a.cc:12:1: error: 'd' was not declared in this scope
12 | d.resize(m);
| ^
|
s868359769 | p03774 | C++ |
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define out(S) cout<<(S)<<endl;
#define REP(i,b) for(size_t i=0;i<(b);i++)
#define rREP(i,b) for(int i=(b)-1;i>=0;i--)
#define FOR(i,a,b) for(size_t i=(a);i<(b);i++)
#define rFOR(i,a,b) for(int i=(b)-1;i>=0;i--)
#define Foreach(item,collection) for(auto item:collection)
#define mod(i) ((i) % (ll)(1e9 + 7))
ll modpow(ll i, ll j) { ll tmp = 1; while (j) { if (j % 2)tmp = mod(tmp*i); i = mod(i*i); j /= 2; }return tmp; }
#define divmod(a,b) (mod(a * modpow((ll)b,(ll)(1e9 + 5))))
#define Yes out("Yes")
#define No out("No")
#define NO out("NO")
#define YES out("YES")
#define INF INT_MAX/2
#define ShowAll(collection) for(auto i:collection){out(i);}
#define IfOut(condition,text) if((condition)){out(text);return 0;}
#define IfeOut(condition,itext,etext) if(condition){out(itext);return 0;}else{out(etext);return 0;}
#define Select(collection,condition,result) Foreach(i,collection){result+=condition;}
template<typename T> pair<vector<T>,int> getAuto() {int N; cin >> N; pair<vector<T>, int> rt;rt.first.resize(N);rt.second = N;REP(i, N) cin >> rt.first[i];return rt;}
void removeAt(string& s, int index) { s.erase(index, 1); }
template<typename T> void removeAt(vector<T>& v, int index) { v.erase(v.begin() + index); }
ll manhattanDistance(ll x1, ll y1, ll x2, ll y2) { return (abs(x2 - x1) + abs(y2 - y1)); }
int main() {
int N, M;
cin >> N >> M;
vector<ll> a, b, c, d;
a.resize(N); b.resize(N);
c.resize(M); d.resize(M);
REP(i, N) { cin >> a[i] >> b[i]; }
REP(i, M) { cin >> c[i] >> d[i]; }
REP(n, N) {
int _min = INF;
int index = 0;
REP(m, M) {
int distance = manhattanDistance(a[n], b[n], c[m], d[m]);
if (_min > distance) { index = m; _min = distance; }
}
out(index+1);
}
}
| a.cc: In function 'int main()':
a.cc:26:13: error: 'INT_MAX' was not declared in this scope
26 | #define INF INT_MAX/2
| ^~~~~~~
a.cc:46:28: note: in expansion of macro 'INF'
46 | int _min = INF;
| ^~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
7 | #include <algorithm>
+++ |+#include <climits>
8 | #include <tuple>
|
s241446345 | p03774 | C++ | #include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
long long int a[n],b[n];
for(int i=0;i<n;i++) cin >> a[i] >> b[i];
int c[m],d[m];
for(int i=0;i<m;i++) cin >> c[i] >> d[i];
for(int i=0;i<n;i++){
long long int minl=200000001,minn=51;
for(int j=0;j<m;j++){
if(minl>=abs(a[i]-c[j])+abs(b[i]-d[j])){
if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
else minn=j+1;
minl=abs(a[i]-c[j])+abs(b[i]-d[j]);
}
}
cout << minn << endl;
}
} | a.cc: In function 'int main()':
a.cc:16:56: error: no matching function for call to 'min(long long int&, int)'
16 | if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:16:56: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
16 | if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:16:56: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
16 | if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
| ~~~^~~~~~~~~~
|
s706603564 | p03774 | C++ | #include<iostream>
#include<algorithm>
#include<limits>
#include<cmath>
using namespace std;
int N,M;
int n[51],m[51];
int nx[51],ny[51];
int cx[51],cy[51];
int main(){
cin>>N>>M;
for(int i=0;i<N;i++){
cin>>nx[i]>>ny[i];
}
for(int i=1;i<=M;i++){
cin>>cx[i]>>cy[i];
}
for(int i=0;i<N;i++){
int mi,mid=INT_MAX;
for(int j=1;j<=M;j++){
if(abs(nx[i]-cx[j])+abs(ny[i]-cy[j])<mid){
mid=abs(nx[i]-cx[j])+abs(ny[i]-cy[j]);
mi=j;
}
}
cout<<mi<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:28: error: 'INT_MAX' was not declared in this scope
19 | int mi,mid=INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include<cmath>
+++ |+#include <climits>
5 | using namespace std;
|
s452338220 | p03774 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> a(N, 0), b(N, 0), c(M, 0), d(M, 0);
for (int i = 0; i != N; ++i) cin >> a[i] >> b[i];
for (int i = 0; i != M; ++i) cin >> c[i] >> d[i];
for (int n = 0; n != N; ++n){
int dist = 1000000000;
int ans = 0;
for (int m = 0; m != M; ++m){
int d = abs(a[n] - c[m]) + abs(b[n] - d[m]);
if (d < dist) {
dist = d;
ans = m;
}
}
cout << ans <<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:52: error: invalid types 'int[int]' for array subscript
15 | int d = abs(a[n] - c[m]) + abs(b[n] - d[m]);
| ^
|
s875396792 | p03774 | C++ | N, M = map(int, input().split(" "))
student = [];
pos = [];
for i in range(N) :
a, b = map(int, input().split(" "))
student.append((a, b))
for i in range(M) :
a, b = map(int, input().split(" "))
pos.append((a,b))
for st in student :
ans = -1;
score = 100000000;
for i in range(M) :
tmpscore = abs(st[0] - pos[i][0]) + abs(st[1] - pos[i][1])
if score > tmpscore :
score = tmpscore;
ans = i;
print(ans+1);
| a.cc:1:1: error: 'N' does not name a type
1 | N, M = map(int, input().split(" "))
| ^
a.cc:4:1: error: 'pos' does not name a type
4 | pos = [];
| ^~~
a.cc:5:1: error: expected unqualified-id before 'for'
5 | for i in range(N) :
| ^~~
a.cc:15:9: error: 'score' does not name a type
15 | score = 100000000;
| ^~~~~
a.cc:16:9: error: expected unqualified-id before 'for'
16 | for i in range(M) :
| ^~~
a.cc:20:25: error: 'ans' does not name a type
20 | ans = i;
| ^~~
a.cc:21:14: error: expected constructor, destructor, or type conversion before '(' token
21 | print(ans+1);
| ^
|
s215239887 | p03774 | Java | import java.util.Scanner;
public Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int human = scan.nextInt();
int checkPoint = scan.nextInt();
int[] humanx = new int[human];
int[] humany = new int[human];
int[] checkPointX = new int[checkPoint];
int[] checkPointY = new int[checkPoint];
for (int i = 0; i < humanx.length; i++) {
humanx[i] = scan.nextInt();
humany[i] = scan.nextInt();
}
for (int i = 0; i < checkPointX.length; i++) {
checkPointX[i] = scan.nextInt();
checkPointY[i] = scan.nextInt();
}
for (int i = 0; i < humanx.length; i++) {
int p = 0;
int ans = 10000000;
for (int j = 0; j < checkPointX.length; j++) {
int leng = Math.abs((humanx[i] - checkPointX[j])) + Math.abs((humany[i] - checkPointY[j]));
if (ans > leng) {
ans = leng;
p = j + 1;
}
}
System.out.println(p);
}
scan.close();
}
} | Main.java:3: error: class, interface, enum, or record expected
public Main {
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:40: error: class, interface, enum, or record expected
}
^
3 errors
|
s101072234 | p03774 | C++ | #include<iostream>
#include<vector>
#include<cstdlib>
#include<algorithm>
#include<functional>
using namespace std;
void main() {
int N, M;
typedef pair<long, long> p;
vector<p> n, m;
vector<int> res;
cin >> N >> M;
for (int i = 0;i < N;i++) {
long a, b;
cin >> a >> b;
n.push_back(make_pair(a, b));
}
for (int i = 0;i < M;i++) {
long c, d;
cin >> c >> d;
m.push_back(make_pair(c, d));
}
for (int i = 0;i < n.size();i++) {
int near = 51;
long min = 1000000000;
for (int j = 0;j < m.size();j++) {
long d = abs(n[i].first - m[j].first) + abs(n[i].second - m[j].second);
if (d < min) {
near = j;
min = d;
}
}
cout <<near+1 << endl;
}
return;
} | a.cc:9:1: error: '::main' must return 'int'
9 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:42:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
42 | return;
| ^~~~~~
|
s342482455 | p03774 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <utility>
#include <functional>
using namespace std;
int main() {
int n, m, ab[50][2], cd[50][2];
cin >> n >> m;
for (int i = 0; i < n; ++i)
cin >> ab[i][0] >> ab[i][1];
for (int i = 0; i < m; ++i)
cin >> cd[i][0] >> cd[i][1];
for (int i = 0; i < n; ++i) {
pair<int, int> minp(INT_MAX, INT_MAX);
for (int j = 0; j < m; ++j) {
pair<int, int> t(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]), j + 1);
minp = min(minp, t);
}
cout << minp.second << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:22:37: error: 'INT_MAX' was not declared in this scope
22 | pair<int, int> minp(INT_MAX, INT_MAX);
| ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
8 | #include <functional>
+++ |+#include <climits>
9 |
|
s137555251 | p03774 | C++ | #include <iostream>
#include <cmath>
#include <vector>
#include <limits>
using namespace std;
class Point{
public:
int x,y;
void set(int x1,int y1){x=x1;y=y1;}
};
int calcDistance(Point p1, Point p2){
return abs(p1.x-p2.x)+abs(p1.y-p2.y);
}
int main(){
int N,M;
vector<Point> spvec;
cin >> N >> M;
for(int i=0;i<N;i++){
Point p;
cin >> p.x >> p.y;
spvec.push_back(p);
}
vector<Point> cpvec;
for(int j=0;j<M;j++){
Point p;
cin >> p.x >> p.y;
cpvec.push_back(p);
}
for(int i=0;i<N;i++){
int min = INT_MAX;
int minJ = 0;
for(int j=0;j<M;j++){
int distance = calcDistance(spvec[i],cpvec[j]);
if(min>distance){
min = distance;
minJ=j;
}
}
cout << minJ+1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:33:19: error: 'INT_MAX' was not declared in this scope
33 | int min = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <vector>
+++ |+#include <climits>
4 | #include <limits>
|
s230473064 | p03774 | C++ | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
class Point{
public:
int x,y;
void set(int x1,int y1){x=x1;y=y1;}
};
int calcDistance(Point p1, Point p2){
return abs(p1.x-p2.x)+abs(p1.y-p2.y);
}
int main(){
int N,M;
vector<Point> spvec;
cin >> N >> M;
for(int i=0;i<N;i++){
Point p;
cin >> p.x >> p.y;
spvec.push_back(p);
}
vector<Point> cpvec;
for(int j=0;j<M;j++){
Point p;
cin >> p.x >> p.y;
cpvec.push_back(p);
}
for(int i=0;i<N;i++){
int min = INT_MAX;
int minJ = 0;
for(int j=0;j<M;j++){
int distance = calcDistance(spvec[i],cpvec[j]);
if(min>distance){
min = distance;
minJ=j;
}
}
cout << minJ+1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:19: error: 'INT_MAX' was not declared in this scope
32 | int min = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <vector>
+++ |+#include <climits>
4 | using namespace std;
|
s537946376 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
int n,n;
cin >> n >> m;
vector<pair<ll int, ll int>> seito,point;
REP(i, n){
ll int a,b;
cin >> a >> b;
seito.pb(mp(a,b));
}
REP(i,m){
ll int c,d;
cin >> c >> d;
point.pb(mp(c,d));
}
REP(i,n){
int ans = 0;
int old = 0;
REP(j,m){
int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
if(j == 0){
old = dis;
} else{
if(old > dis){
old = dis;
ans = j;
}
}
}
cout << ans+1 << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
19 | int n,n;
| ^
a.cc:19:9: note: 'int n' previously declared here
19 | int n,n;
| ^
a.cc:20:17: error: 'm' was not declared in this scope
20 | cin >> n >> m;
| ^
|
s122872268 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
int n,n;
cin >> n >> m;
vector<pair<ll int, ll int> > seito, point;
REP(i, n){
ll int a,b;
cin >> a >> b;
seito.pb(mp(a,b));
}
REP(i,m){
ll int c,d;
cin >> c >> d;
point.pb(mp(c,d));
}
REP(i,n){
int ans = 0;
int old = 0;
REP(j,m){
int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
if(j == 0){
old = dis;
} else{
if(old > dis){
old = dis;
ans = j;
}
}
}
cout << ans << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
19 | int n,n;
| ^
a.cc:19:9: note: 'int n' previously declared here
19 | int n,n;
| ^
a.cc:20:17: error: 'm' was not declared in this scope
20 | cin >> n >> m;
| ^
|
s430839919 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
int n,n;
cin >> n >> m;
vector<pair<ll int, ll int>> seito,point;
REP(i, n){
ll int a,b;
cin >> a >> b;
seito.pb(mp(a,b));
}
REP(i,m){
ll int c,d;
cin >> c >> d;
point.pb(mp(c,d));
}
REP(i,n){
int ans = 0;
int old = 0;
REP(j,m){
int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
if(j == 0){
old = dis;
} else{
if(old > dis){
old = dis;
ans = j;
}
}
}
cout << ans << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
19 | int n,n;
| ^
a.cc:19:9: note: 'int n' previously declared here
19 | int n,n;
| ^
a.cc:20:17: error: 'm' was not declared in this scope
20 | cin >> n >> m;
| ^
|
s188390637 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
int n,n;
cin >> n >> m;
vector<pair<ll int, ll int>> seito,point;
REP(i, n){
ll int a,b;
cin >> a >> b;
seito.pb(mp(a,b));
}
REP(i,m){
ll int c,d;
cin >> c >> d;
point.pb(mp(c,d));
}
REP(i,n){
int ans = 0;
int old = 0;
REP(j,m){
int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
if(j == 0){
old = dis;
} else{
if(old > dis){
old = dis;
ans = j;
}
}
}
cout << ans << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
19 | int n,n;
| ^
a.cc:19:9: note: 'int n' previously declared here
19 | int n,n;
| ^
a.cc:20:17: error: 'm' was not declared in this scope
20 | cin >> n >> m;
| ^
|
s818254785 | p03774 | C++ | N,M = list(map(int, input().split()))
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
for t1 in s:
l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
print(l.index(min(l)) + 1) | a.cc:1:1: error: 'N' does not name a type
1 | N,M = list(map(int, input().split()))
| ^
|
s983013754 | p03774 | C++ | N,M = list(map(int, input().split()))
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
for t1 in s:
l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
print(l.index(min(l)) + 1) | a.cc:1:1: error: 'N' does not name a type
1 | N,M = list(map(int, input().split()))
| ^
|
s863119633 | p03774 | C++ | open System
open System.IO
let readInt () = int (Console.ReadLine())
let readInts () = (Console.ReadLine().Split(' ')) |> (Array.map int)
let read2Ints () =
let t = readInts()
(t.[0], t.[1])
let read3Ints () =
let t = readInts()
(t.[0], t.[1], t.[2])
let inf = 1000000000
let manhattan (x, y) (z, w) = abs(x-z) + abs(y-w)
[<EntryPoint>]
let main args =
let n,m = read2Ints()
let s = [|for i in 1..n -> read2Ints() |]
let p = [|for i in 1..m -> read2Ints() |]
for i=1 to n do
let mutable a=inf
let mutable b=0
for j=1 to m do
let t = manhattan s.[i-1] p.[j-1]
if a > t then
a <- t
b <- j
done
printfn "%d" b
done
0
| a.cc:23:24: error: too many decimal points in number
23 | let s = [|for i in 1..n -> read2Ints() |]
| ^~~~
a.cc:24:24: error: too many decimal points in number
24 | let p = [|for i in 1..m -> read2Ints() |]
| ^~~~
a.cc:1:1: error: 'open' does not name a type
1 | open System
| ^~~~
|
s499492837 | p03774 | C++ | // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int n,m;
int x,y,z;
int q = 1000000000;
cin >> n >> m;
int a[n],b[n],c[m],d[m];
int result[n];
for(int i = 0; i<n; i++){
cin >> a[i] >> b[i];
}
for(int i = 0; i<m; i++){
cin >> c[i] >> d[i];
}
for(int i = 0; i<n; i++){
for(int j = 0; j<m; j++){
x = a[i] - c[j];
y = b[i] - d[j];
if(x < 0){
x = -x;
}
if(y < 0){
y = -y;
}
z = x + y;
if(z < q){
q = z;
}
}
result[i] = j + 1;
}
for(int i = 0; i<n; i++){
cout << result[i] << endl;
}
}
// GCC reference:
// https://gcc.gnu.org/
// C++ language references:
// https://msdn.microsoft.com/library/3bstk3k5.aspx
// http://www.cplusplus.com/
// https://isocpp.org/
// http://www.open-std.org/jtc1/sc22/wg21/
// Boost libraries references:
// http://www.boost.org/doc/
| a.cc: In function 'int main()':
a.cc:50:21: error: 'j' was not declared in this scope
50 | result[i] = j + 1;
| ^
|
s987307277 | p03774 | C | #include <stdio.h>
int Man(int x,y,z,w){
int e = x - y;
int f = z - w;
if(e<<0){
e = e * (-1);
}
if(f<<0){
f = f * (-1);
}
int g = e + f;
return g;
}
int main(){
int N,M;
int a[N],b[N],c[M],d[M];
int S;
scanf("%d%d",&N,&M);
for(int i=0;i<<N;i++){
scanf("%d%d\n",a[i],b[i]);
}
for(int i=0;i<<M;i++){
scanf("%d%d",c[i],d[i]);
}
for(int i=0;i<<N;i++){
S = 0;
for(int j=0;j<<M;j++){
if(Man(a[S],b[S],c[S],d[S])<<Man(a[i],b[i],c[j],d[j])){
S = j;
}
}
printf("%d\n",S);
}
return 0;
}
| main.c:2:15: error: unknown type name 'y'
2 | int Man(int x,y,z,w){
| ^
main.c:2:17: error: unknown type name 'z'
2 | int Man(int x,y,z,w){
| ^
main.c:2:19: error: unknown type name 'w'
2 | int Man(int x,y,z,w){
| ^
main.c: In function 'main':
main.c:29:28: error: implicit declaration of function 'Man' [-Wimplicit-function-declaration]
29 | if(Man(a[S],b[S],c[S],d[S])<<Man(a[i],b[i],c[j],d[j])){
| ^~~
|
s715848405 | p03774 | C++ | int main(void){
int N,M;
cin >> N >> M;
const int NMMAX = 50;
int A[NMMAX], B[NMMAX], C[NMMAX], D[NMMAX];
for( int i = 0 ; i < N; ++i){
cin >> A[i] >> B[i];
}
for( int j = 0; j < M; ++j){
cin >> C[j] >> D[j];
}
for( int i = 0; i < N; ++ i){
int min_dist = abs(A[i] - C[0]) + abs(B[i] - D[0]) , checkpoint = 1;
for( int j = 1; j < M; ++j){
const int cur_dist = abs(A[i] - C[j]) + abs(B[i] - D[j]);
if( min_dist > cur_dist){
min_dist = cur_dist;
checkpoint = j + 1;
}
}
cout << checkpoint <<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N >> M;
| ^~~
a.cc:18:20: error: 'abs' was not declared in this scope
18 | int min_dist = abs(A[i] - C[0]) + abs(B[i] - D[0]) , checkpoint = 1;
| ^~~
a.cc:25:17: error: 'checkpoint' was not declared in this scope
25 | checkpoint = j + 1;
| ^~~~~~~~~~
a.cc:29:9: error: 'cout' was not declared in this scope
29 | cout << checkpoint <<endl;
| ^~~~
a.cc:29:17: error: 'checkpoint' was not declared in this scope
29 | cout << checkpoint <<endl;
| ^~~~~~~~~~
a.cc:29:30: error: 'endl' was not declared in this scope
29 | cout << checkpoint <<endl;
| ^~~~
|
s296014209 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
cin >> c[j] >> d[j];}
int min[n], number[n], k, l;
for(l=1; l<=n; l++){
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++){
if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
min = abs(a[l]-c[k])+abs(b[l]-d[k]);
number[l] = k;
}
}
}
cout << number << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:17: error: incompatible types in assignment of 'int' to 'int [n]'
22 | min = abs(a[l]-c[k])+abs(b[l]-d[k]);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s055156967 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
cin >> c[j] >> d[j];}
int min[n], number[n], k, l;
for(l=1; l<=n; l++){
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++){
if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
min = abs(a[l]-c[k])+abs(b[l]-d[k])
number[l] = k;
}
}
}
cout << number << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:17: error: incompatible types in assignment of 'int' to 'int [n]'
22 | min = abs(a[l]-c[k])+abs(b[l]-d[k])
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s611044461 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
cin >> c[j] >> d[j];}
int min[n], number[n], k, l;
for(l=1; l<=n; l++){
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++){
if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
min = abs(a[l]-c[k])+abs(b[l]-d[k])
number[l] = k;
}
}
}
cout << number << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ')' before '{' token
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~ ^
| )
a.cc:25:5: error: expected primary-expression before '}' token
25 | }
| ^
|
s102729324 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
cin >> a[i] >> b[i]};
int c[m], d[m];
for(j=1; j<=m; j++){
cin >> c[j] >> d[j]};
int min[n], number[n], k, l;
for(l=1; l<=n; l++){
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++){
if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
min = abs(a[l]-c[k])+abs(b[l]-d[k])
number[l] = k;
}
}
}
cout << number << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before '}' token
11 | cin >> a[i] >> b[i]};
| ^
| ;
a.cc:14:24: error: expected ';' before '}' token
14 | cin >> c[j] >> d[j]};
| ^
| ;
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ')' before '{' token
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~ ^
| )
a.cc:25:5: error: expected primary-expression before '}' token
25 | }
| ^
|
s073429728 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++)
cin >> a[i] >> b[i];
int c[m], d[m];
for(j=1; j<=m; j++)
cin >> c[j] >> d[j];
int min[n], number[n], k, l;
for(l=1; l<=n; l++)
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++)
if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
min = abs(a[l]-c[k])+abs(b[l]-d[k])
number[l] = k;
};
;
count << number << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ';' before '{' token
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ^
| ;
a.cc:25:9: error: expected primary-expression before ';' token
25 | ;
| ^
a.cc:24:11: error: expected ')' before ';' token
24 | };
| ^
| )
25 | ;
| ~
a.cc:21:11: note: to match this '('
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ^
a.cc:27:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int [n]' to binary 'operator<<'
27 | count << number << endl;
| ~~~~~~^~~~~~~~~
|
s660948009 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++)
cin >> a[i] >> b[i];
int c[m], d[m];
for(j=1; j<=m; j++)
cin >> c[j] >> d[j];
int min[n], number[n], k, l;
for(l=1; l<=n; l++)
min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
number[l] = 1;
for(k=2; k<=m; k++)
if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
min = abs(a[l]-c[k])+abs(b[l]-d[k])
number[l] = k;
}
count << number << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ';' before '{' token
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ^
| ;
a.cc:26:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int [n]' to binary 'operator<<'
26 | count << number << endl;
| ~~~~~~^~~~~~~~~
a.cc:26:24: error: expected ')' before ';' token
26 | count << number << endl;
| ^
| )
a.cc:21:11: note: to match this '('
21 | if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
| ^
|
s191104218 | p03774 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 99999999;
int check = 0;
int min = 99999999;
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 99999999;
check = 0;
}
}
} | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s010115156 | p03774 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int min = 99999999;
int index = 0;
int date = 99999999;
for(int i = 0; i < n; i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0; i < m; i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n; i++){
for(int j = 0; j < m; j++){
date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(date < min){
min = date;
index = j;
}
}
System.out.println(index + 1);
min = 999999999;
index = 0;
}
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s872474618 | p03774 | Java | import java.util.Scanner;
public class cheakpoint {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int min = 99999999;
int index = 0;
int date = 99999999;
for(int i = 0; i < n; i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0; i < m; i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n; i++){
for(int j = 0; j < m; j++){
date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(date < min){
min = date;
index = j;
}
}
System.out.println(index + 1);
min = 999999999;
index = 0;
}
}
} | Main.java:3: error: class cheakpoint is public, should be declared in a file named cheakpoint.java
public class cheakpoint {
^
1 error
|
s146021729 | p03774 | Java | import java.util.Scanner;
public class B_cheakpoint {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int min = 99999999;
int index = 0;
int date = 99999999;
for(int i = 0; i < n; i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0; i < m; i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n; i++){
for(int j = 0; j < m; j++){
date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(date < min){
min = date;
index = j;
}
}
System.out.println(index + 1);
min = 999999999;
index = 0;
}
}
} | Main.java:3: error: class B_cheakpoint is public, should be declared in a file named B_cheakpoint.java
public class B_cheakpoint {
^
1 error
|
s195292776 | p03774 | Java | import java.util.Scanner;
public class cheak {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int min = 100000001,index = 0,date = 100000001;
for(int i = 0; i < n; i++){
a[i] = scan.nextInt();
b[i] = scan.nextInt();
}
for(int i = 0; i < m; i++){
c[i] = scan.nextInt();
d[i] = scan.nextInt();
}
for(int i = 0;i < n; i++){
for(int j = 0; j < m; j++){
date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(date < min){
min = date;
index = j;
}
}
System.out.println(index + 1);
min = 999999999;
index = 0;
}
}
} | Main.java:2: error: class cheak is public, should be declared in a file named cheak.java
public class cheak {
^
1 error
|
s802889252 | p03774 | Java | import java.util.Scanner;
public class cheak {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int min = 100000001,index = 0,date = 100000001;
for(int i = 0; i < n; i++){
a[i] = scan.nextInt();
b[i] = scan.nextInt();
}
for(int i = 0; i < m; i++){
c[i] = scan.nextInt();
d[i] = scan.nextInt();
}
for(int i = 0;i < n; i++){
for(int j = 0; j < m; j++){
date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(date < min){
min = date;
index = j;
}
}
System.out.println(index + 1);
min = 999999999;
index = 0;
}
}
} | Main.java:2: error: class cheak is public, should be declared in a file named cheak.java
public class cheak {
^
1 error
|
s730763114 | p03774 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 99999999;
int check = 0;
int min = 99999999;
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 99999999;
check = 0;
}
}
} | Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s779562396 | p03774 | Java | import java.util.Scanner;
public class B_checkpoint {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 99999999;
int check = 0;
int min = 99999999;
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 99999999;
check = 0;
}
}
} | Main.java:2: error: class B_checkpoint is public, should be declared in a file named B_checkpoint.java
public class B_checkpoint {
^
1 error
|
s360298263 | p03774 | Java | import java.util.Scanner;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 99999999,check = 0,min = 99999999;
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = sc.nextInt();
d[i] = sc.nextInt();
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 99999999;
check = 0;
}
}
| Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s945065280 | p03774 | Java | import java.util.Scanner;
public class B_checkpoint {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 99999999,check = 0,min = 99999999;
for(int i = 0;i < n;i++){
a[i] = scan.nextInt();
b[i] = scan.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = scan.nextInt();
d[i] = scan.nextInt();
}
for(int i = 0;i < n;i++){
check = 0;
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 100000001;
}
}
}
| Main.java:2: error: class B_checkpoint is public, should be declared in a file named B_checkpoint.java
public class B_checkpoint {
^
1 error
|
s301457223 | p03774 | Java | package spring;
import java.util.Scanner;
public class B_checkpoint {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[m];
int[] d = new int[m];
int data = 0,check = 0,min = 100000001;
for(int i = 0;i < n;i++){
a[i] = scan.nextInt();
b[i] = scan.nextInt();
}
for(int i = 0;i < m;i++){
c[i] = scan.nextInt();
d[i] = scan.nextInt();
}
for(int i = 0;i < n;i++){
check = 0;
for(int j = 0;j < m;j++){
data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
if(data < min) {
min = data;
check = j;
}
}
System.out.println(check+1);
min = 100000001;
}
}
} | Main.java:3: error: class B_checkpoint is public, should be declared in a file named B_checkpoint.java
public class B_checkpoint {
^
1 error
|
s802919635 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
void rd(int &x){
int k, m=0;
x=0;
for(;;){
k = getchar_unlocked();
if(k=='-'){
m=1;
break;
}
if('0'<=k&&k<='9'){
x=k-'0';
break;
}
}
for(;;){
k = getchar_unlocked();
if(k<'0'||k>'9'){
break;
}
x=x*10+k-'0';
}
if(m){
x=-x;
}
}
void wt_L(int x){
char f[10];
int m=0, s=0;
if(x<0){
m=1;
x=-x;
}
while(x){
f[s++]=x%10;
x/=10;
}
if(!s){
f[s++]=0;
}
if(m){
putchar_unlocked('-');
}
while(s--){
putchar_unlocked(f[s]+'0');
}
}
int A[50], B[50], C[50], D[50], M, N;
int main(){
int i, j, mn, res, tmp;
rd(N);
rd(M);
{
int Lj4PdHRW;
for(Lj4PdHRW=0;Lj4PdHRW<;Lj4PdHRW++){
rd(A[Lj4PdHRW]);
rd(B[Lj4PdHRW]);
}
}
{
int KL2GvlyY;
for(KL2GvlyY=0;KL2GvlyY<;KL2GvlyY++){
rd(C[KL2GvlyY]);
rd(D[KL2GvlyY]);
}
}
for(i=0;i<N;i++){
mn = 1073709056;
for(j=0;j<M;j++){
tmp = abs(A[i]-C[j]) + abs(B[i]-D[j]);
if(mn > tmp){
mn = tmp;
res = j;
}
}
wt_L(res+1);
putchar_unlocked('\n');
}
return 0;
}
// cLay varsion 20170330-1
| a.cc: In function 'int main()':
a.cc:56:29: error: expected primary-expression before ';' token
56 | for(Lj4PdHRW=0;Lj4PdHRW<;Lj4PdHRW++){
| ^
a.cc:63:29: error: expected primary-expression before ';' token
63 | for(KL2GvlyY=0;KL2GvlyY<;KL2GvlyY++){
| ^
|
s240049012 | p03774 | Java | public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int N=s.nextInt();//学生
int M=s.nextInt();//チェックポイント
long a[]=new long[N];//学生の位置
long b[]=new long[N];
long c[]=new long[M];//チェックポイントの位置
long d[]=new long[M];
long min=0;
int l=0;
int i=0,j=0;
for(i=0;i<N;i++){
a[i]=s.nextInt();
b[i]=s.nextInt();
}
for(i=0;i<M;i++){
c[i]=s.nextInt();
d[i]=s.nextInt();
}
for(i=0;i<N;i++){
min=Math.abs(a[i]-c[0])+Math.abs(b[i]-d[0]);
l=0;
for(j=0;j<M;j++){
if(min>Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j])){
min=Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j]);
l=j;
}
}
System.out.println(l+1);
}
}
}
| Main.java:6: error: cannot find symbol
Scanner s=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner s=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s385938143 | p03774 | C++ | #include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define MAX_N 60
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
pii students[MAX_N];
pii checkP[MAX_N];
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n,m;
cin >> n >> m;
for (int i = 0;i < n;i++){
cin >> students[i].F >> students[i].S;
}
for (int i= 0;i < m;i++){
cin >> checkP[i].F >> checkP[i].S;
}
int cdist;
for (int i= 0;i < n;i++){
int mindist = 1e9,minin = -1;
for (int j = 0;j < m;j++){
cdist = (abs(students[i].F - checkP[i].F)) + (abs(students[i].A - checkP[i].S));
if (cdist < mindist){
mindist = cdist;
minin = j;
}
}
cout << minin + 1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:75: error: 'pii' {aka 'struct std::pair<int, int>'} has no member named 'A'
27 | cdist = (abs(students[i].F - checkP[i].F)) + (abs(students[i].A - checkP[i].S));
| ^
|
s328220031 | p03774 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
try(Scanner sc = new Scanner(System.in) {
int N = sc.nextInt(), M = sc.nextInt();
long[] a = new long[N], b = new long[N];
long[] c = new long[M], d = new long[M];
for(int i = 0; i < N; i++) {
a[i] = sc.nextLong();
b[i] = sc.nextLong();
}
for(int i = 0; i < M; i++) {
c[i] = sc.nextLong();
d[i] = sc.nextLong();
}
for(int i = 0; i < N; i++) {
long len = 1e11;
int ans = 0;
for(int j = 0; j < N; j++) {
if(len > Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j])) {
len = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
ans = j;
}
}
System.out.println(ans + 1);
}
}
}
} | Main.java:9: error: illegal start of type
for(int i = 0; i < N; i++) {
^
Main.java:9: error: > or ',' expected
for(int i = 0; i < N; i++) {
^
Main.java:9: error: <identifier> expected
for(int i = 0; i < N; i++) {
^
Main.java:13: error: illegal start of type
for(int i = 0; i < M; i++) {
^
Main.java:13: error: > or ',' expected
for(int i = 0; i < M; i++) {
^
Main.java:13: error: <identifier> expected
for(int i = 0; i < M; i++) {
^
Main.java:17: error: illegal start of type
for(int i = 0; i < N; i++) {
^
Main.java:17: error: > or ',' expected
for(int i = 0; i < N; i++) {
^
Main.java:17: error: <identifier> expected
for(int i = 0; i < N; i++) {
^
Main.java:28: error: ')' expected
}
^
Main.java:30: error: reached end of file while parsing
}
^
11 errors
|
s770677103 | p03774 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a[]=new int[n];
int b[]=new int[n];
int c[]=new int[m];
int d[]=new int[m];
int e[]=new int[m];
int min[]=new int[n];
int minIdx[]=new int[n];
for(int i=0;i<n;i++){
a[i]=sc.nextInt();
b[i]=sc.nextInt();
}
for(int k=0;k<m;k++){
c[k]=sc.nextInt();
d[k]=sc.nextInt();
}
for(int i=0;i<n;i++){
for(int k=0;k<m;k++){
e[k]=Math.abs(a[i]-c[k])+Math.abs(b[i]-d[k]);
}
min[i]=e[0];
for(int k=0;k<m;k++){
if(min[i]>e[k]){
min[i]=e[k];
minIdx[i]=k;
}
}
}
for(int i=0;i<n;i++){
System.out.println(minIdx[i]+1);
}
}
} | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s314805077 | p03774 | C++ | #include <iostream>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int student[N][2], check[M][2];
for (int i = 0; i< N; i++)
cin >> student[i][0] >> student[i][1];
for (int i = 0; i< M; i++)
cin >> check[i][0] >> check[i][1];
int distance[N][M];
for (int i = 0; i < N; i++)
for (int j = 0; j < M; j++)
distance[i][j] = abs(student[i][0] - check[i][0]) + abs(student[i][1] - check[i][1]);
for (int i = 0; i < N; i++) {
int minD = distance[i][0];
int res = 0;
int j = 1
for (; j < M; j++)
if (distance[i][j] < minD) {
minD = distance[i][j];
res = j;
}
cout << j << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:9: error: expected ',' or ';' before 'for'
20 | for (; j < M; j++)
| ^~~
a.cc:20:26: error: expected ';' before ')' token
20 | for (; j < M; j++)
| ^
| ;
|
s859196228 | p03774 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int N,M,i,j;
cin >> N,M;
cout << abs(N) < endl;
int a[N],b[N],c[M],d[M];
for(i=0;i<N;i++){
cin >> a[i] >>b[i];
}
for(j=0;j<M;j++){
cin >> c[j] >>d[j];
}
for(i=0; i < N;i++){
int temp=0;
for(j=0;j<M;j++){
if(abs(a[i]-c[j]) + abs(b[i]-d[j]) < abs(a[i]-c[temp]) + abs(b[i]-d[temp])){
temp = j;
}
}
cout << temp << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
8 | cout << abs(N) < endl;
| ~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
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_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: couldn't deduce template parameter '_CharT'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s537250033 | p03774 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int N,M,i,j;
cin >> N,M;
cout << abs(N) < endl;
int a[N],b[N],c[M],d[M];
for(i=0;i<N;i++){
cin >> a[i] >>b[i];
}
for(j=0;j<M;j++){
cin >> c[j] >>d[j];
}
for(i=0; i < N;i++){
int temp=0;
for(j=0;j<M;j++){
if(abs(a[i]-c[j]) + abs(b[i]-d[j]) < abs(a[i]-c[temp]) + abs(b[i]-d[temp])){
temp = j;
}
}
cout << temp+1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
8 | cout << abs(N) < endl;
| ~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
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_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: couldn't deduce template parameter '_CharT'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s047604241 | p03774 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int N,M,i,j;
cin >> N,M;
cout << abs(N) < endl;
int a[N],b[N],c[M],d[M];
for(i=0;i<N;i++){
cin >> a[i] >>b[i];
}
for(j=0;j<M;j++){
cin >> c[j] >>d[j];
}
for(i=0; i < N;i++){
int temp=0;
for(j=0;j<M;j++){
if(abs(a[i]-c[j]) + abs(b[i]-d[j]) < abs(a[i]-c[temp]) + abs(b[i]-d[temp])){
temp = j;
}
}
cout << temp << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
8 | cout << abs(N) < endl;
| ~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
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_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: couldn't deduce template parameter '_CharT'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | cout << abs(N) < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:8:20: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
8 | cout << abs(N) < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s379336620 | p03774 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
int N, M;
int A[50], B[50];
int C[50], D[50];
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
cin >> N >> M;
rep(i, N) cin >> A[i] >> B[i];
rep(i, M) cin >> C[i] >> D[i];
rep(i, N) {
int x = A[i], y = B[i];
int m = INT_MAX, mi = -1;
rep(j, M) {
int d = abs(C[j]-x) + abs(D[j]-y);
if (d < m) {
m = d;
mi = j;
}
}
cout << mi + 1 << "\n";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:13: error: 'INT_MAX' was not declared in this scope
32 | int m = INT_MAX, mi = -1;
| ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
9 | #include <cmath>
+++ |+#include <climits>
10 | using namespace std;
a.cc:37:9: error: 'mi' was not declared in this scope; did you mean 'm'?
37 | mi = j;
| ^~
| m
a.cc:40:13: error: 'mi' was not declared in this scope; did you mean 'm'?
40 | cout << mi + 1 << "\n";
| ^~
| m
|
s321042813 | p03774 | C++ | #include<stdio.h>
int main(void)
{
int n,m,i,j,t;
int a[51],b[51],c[51],d[51];
int dist[51][51];
scanf("%d %d",&n,&m);
for(i=0;i<n;i++)
scanf("%d %d",&a[i],&b[i]);
for(i=0;i<m;i++)
scanf("%d %d",&c[i],&d[i]);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
dist[i][j]=abs(a[i]-c[j])+abs(b[i]-d[j]);
}
t=0;
for(j=1;j<m;j++){
if(dist[i][j]<dist[i][t])t=j;
}
printf("%d\n",t+1);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:36: error: 'abs' was not declared in this scope
14 | dist[i][j]=abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^~~
|
s506734859 | p03774 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int students [] [] = new int [n] [2];
int points [] [] = new int [m] [2];
for (int i = 0 ; i < n ; i++) {
students [i] [0] = scanner.nextInt();
students [i] [1] = scanner.nextInt();
}
for (int j = 0 ; j < m ; j++) {
points [j] [0] = scanner.nextInt();
points [j] [1] = scanner.nextInt();
}
int [] result = new int [n];
for (int i = 0 ; i < n ; i++) {
int minDist = 10000;
int minIndex = 0;
for (int j = 0 ; j < m ; j++) {
int dist = Math.abs(students [i] [0] - points [j] [0]) + Math.abs(students [i] [1] - points [j] [1]);
if (dist < minDist) {
minDist = dist;
minIndex = j;
}
}
result [i]= minIndex + 1;
System.out.prntln(result [i]);
}
}
} | Main.java:31: error: cannot find symbol
System.out.prntln(result [i]);
^
symbol: method prntln(int)
location: variable out of type PrintStream
1 error
|
s885944227 | p03774 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int students [] [] = new int [n] [2];
int points [] [] = new int [m] [2];
for (int i = 0 ; i < n ; i++) {
students [i] [0] = scanner.nextInt();
students [i] [1] = scanner.nextInt();
}
for (int j = 0 ; j < m ; j++) {
points [j] [0] = scanner.nextInt();
points [j] [1] = scanner.nextInt();
}
int [] result = new int [n];
for (int i = 0 ; i < n ; i++) {
int minDist = 10000;
int minIndex = 0;
for (int j = 0 ; j < m ; j++) {
int dist = Math.abs(students [i] [0] - points [j] [0]) + Math.abs(students [i] [1] - points [j] [1]);
if (dist < minDist) {
minDist = dist;
minIndex = j;
}
}
result [i]= minIndex + 1;
System.out.prntln(results [i]);
}
}
} | Main.java:31: error: cannot find symbol
System.out.prntln(results [i]);
^
symbol: variable results
location: class Main
1 error
|
s886677816 | p03774 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int students [] [] = new int [n] [2];
int points [] [] = new int [m] [2];
for (int i = 0 ; i < n ; i++) {
students [i] [0] = scanner.nextInt();
students [i] [1] = scanner.nextInt();
}
for (int j = 0 ; j < m ; j++) {
points [j] [0] = scanner.nextInt();
points [j] [1] = scanner.nextInt();
}
int [] result = new int [n];
for (int i = 0 ; i < n ; i++) {
int minDist = 10000;
int minIndex = 0;
for (int j = 0 ; j < m ; j++) {
int dist = Math.abs(students [i] [0] - points [j] [0]) + Math.abs(students [i] [1] - points [j] [1]);
if (dist < minDist) {
minDist = dist;
minIndex = j;
}
}
result [i]= minIndex + 1;
System.out.prntln(results [i]);
}
}
} | Main.java:31: error: cannot find symbol
System.out.prntln(results [i]);
^
symbol: variable results
location: class Main
1 error
|
s677727731 | p03774 | C++ | #include <iostream>
#Include <vector>
#include <algorithm>
using namespace std;
struct Point {
int x, y;
Point(int x, int y):x(x), y(y) { }
};
int main() {
int N, M; cin >> N >> M;
vector<Point> a(N);
vector<Point> b(M);
for (int i = 0; i < N; i++) {
int x, y;
cin >> x >> y;
a[i] = Point(x, y);
}
for (int i = 0; i < M; i++) {
int x, y;
cin >> x >> y;
b[i] = Point(x, y);
}
for (int i = 0; i < N; i++) {
Point &p = a[i];
int idx = 0;
int minval = 1e9+10;
for (int j = 1; j < M; j++) {
int val = abs(p.y - b[i],y) + abs(p.x - b[i].x);
if (val < minval) {
idx = j;
minval = val;
}
}
cout << idx << endl;
}
return 0;
} | a.cc:2:2: error: invalid preprocessing directive #Include; did you mean #include?
2 | #Include <vector>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:14:3: error: 'vector' was not declared in this scope
14 | vector<Point> a(N);
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:14:15: error: expected primary-expression before '>' token
14 | vector<Point> a(N);
| ^
a.cc:14:17: error: 'a' was not declared in this scope
14 | vector<Point> a(N);
| ^
a.cc:15:15: error: expected primary-expression before '>' token
15 | vector<Point> b(M);
| ^
a.cc:15:17: error: 'b' was not declared in this scope
15 | vector<Point> b(M);
| ^
a.cc:34:32: error: 'y' was not declared in this scope
34 | int val = abs(p.y - b[i],y) + abs(p.x - b[i].x);
| ^
|
s254538443 | p03774 | Java | import java.util.Scanner;
public class ABC057B {
public static void main(String[] args) {
ABC057BSolve solve = new ABC057BSolve();
solve.main();
}
}
class ABC057BSolve {
Point[] checkPoints;
Point[] students;
int N;
int M;
ABC057BSolve() {
Scanner cin = new Scanner(System.in);
this.N = cin.nextInt();
this.M = cin.nextInt();
this.students = new Point[N];
this.checkPoints = new Point[M];
for (int i = 0; i < N; i++) {
int a = cin.nextInt();
int b = cin.nextInt();
students[i] = new Point(a, b);
}
for (int i = 0; i < M; i++) {
int c = cin.nextInt();
int d = cin.nextInt();
checkPoints[i] = new Point(c, d);
}
}
void main() {
for (Point student : students) {
int point = 0;
int min = Integer.MAX_VALUE;
for (int i = M - 1; i >= 0; i--) {
int distance = distance(student, checkPoints[i]);
if (min >= distance) {
min = distance;
point = i + 1;
}
}
System.out.println(point);
}
}
int distance(Point a, Point b) {
return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
}
class Point {
int x;
int y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
}
}
| Main.java:2: error: class ABC057B is public, should be declared in a file named ABC057B.java
public class ABC057B {
^
1 error
|
s713291155 | p03774 | C++ | #include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
int a[100],b[100], c[100], d[100], ans[100], mini[100];
int main(void){
int n, m; cin >> n >> m;
for(int i=0;i<n;i++) cin >> a[i] >> b[i];
for(int i=0;i<m;i++) cin >> c[i] >> d[i];
for(int i=0;i<n;i++){
mini[i] = INT_MAX;
for(int j=0;j<m;j++){
if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
}
cout << ans[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:74: error: no matching function for call to 'abs()'
13 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
a.cc:13:80: error: no matching function for call to 'abs()'
13 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
|
s465843924 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[100],b[100], c[100], d[100], ans[100], mini[100];
int main(void){
int n, m; cin >> n >> m;
for(int i=0;i<n;i++) cin >> a[i] >> b[i];
for(int i=0;i<m;i++) cin >> c[i] >> d[i];
for(int i=0;i<n;i++){
mini[i] = INT_MAX;
for(int j=0;j<m;j++){
if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
}
cout << ans[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:74: error: no matching function for call to 'abs()'
12 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
a.cc:12:80: error: no matching function for call to 'abs()'
12 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini[i]) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
|
s038416900 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[100],b[100], c[100], d[100], ans[100], mini[100];
int main(void){
int n, m; cin >> n >> m;
for(int i=0;i<n;i++) cin >> a[i] >> b[i];
for(int i=0;i<m;i++) cin >> c[i] >> d[i];
for(int i=0;i<n;i++){
mini[i] = INT_MAX;
for(int j=0;j<m;j++){
if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini) {ans[i] = j+1; mini[i] = abs()+abs();}
}
cout << ans[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:12:71: error: no matching function for call to 'abs()'
12 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
a.cc:12:77: error: no matching function for call to 'abs()'
12 | if (abs(a[i]-c[j])+abs(b[i]-d[j])<mini) {ans[i] = j+1; mini[i] = abs()+abs();}
| ~~~^~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 0 provided
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 0 provided
|
s340358487 | p03774 | Java | public class Main {
public static void main(String a[])
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), m = sc.nextInt();
int s[] = new int [n * 2];
int c[] = new int [m * 2];
for (int i = 0; i < n; ++i)
{
s[i * 2] = sc.nextInt();
s[i * 2 + 1] = sc.nextInt();
}
for (int i = 0; i < m; ++i)
{
c[i * 2] = sc.nextInt();
c[i * 2 + 1] = sc.nextInt();
}
for (int i = 0; i < n; ++i)
{
int dist = Integer.MAX_VALUE, index = -1;
for (int j = 0; j < m; ++j)
{
int tmp = (int)(Math.pow(s[i * 2] - c[j * 2], 2) + Math.pow(s[i * 2 + 1] - c[j * 2 + 1], 2));
if (tmp < dist)
{
tmp = dist;
index = j + 1;
}
}
System.out.println(index);
}
}
} | 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
2 errors
|
s842159770 | p03774 | C++ | #include<iostream>
#include<cmath>
#define MAX 1000000007
using namespace std;
int a[55][2];
int b[55][2];
int main(){
int n,m;
int i,j,k;
int s[2];
cin>>n>>m;
for(i=0;i<n;i++){
cin>>a[i][0]>>a[i][1];
}
for(i=0;i<m;i++){
cin>>b[i][0]>>b[i][1];
}
for(i=0;i<n;i++){
s[0]=MAX,s[1]=0;
for(j=0;j<m;j++)a{
k=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1]);
if(k<s[0])s[0]=k,s[1]=j;
}
cout<<s[1]+1<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:34: error: expected ';' before '{' token
21 | for(j=0;j<m;j++)a{
| ^
| ;
|
s508255081 | p03774 | Java | import java.util.*;
import java.io.*;
public class CF_C {
public static void main(String[] args) throws Exception {
FastScanner fs = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
int n = fs.nextInt(), m = fs.nextInt();
int[][] a = new int[n][2];
int[][] b = new int[m][2];
for(int i = 0; i < n; i++) {
a[i][0] = fs.nextInt(); a[i][1] = fs.nextInt();
}
for(int i = 0; i < m; i++) {
b[i][0] = fs.nextInt(); b[i][1] = fs.nextInt();
}
for(int i = 0; i < n; i++) {
int res = 0, best = (int)2e9+1000;
for(int j = 0; j < m; j++) {
int diff = Math.abs(a[i][0] - b[j][0]) + Math.abs(a[i][1] - b[j][1]);
if(diff < best) {
best = diff;
res = j;
}
}
out.println(res+1);
}
out.close();
}
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
try {
br = new BufferedReader(new InputStreamReader(System.in));
st = new StringTokenizer("");
} catch (Exception e) {
e.printStackTrace();
}
}
public String next() {
if (st.hasMoreTokens()) return st.nextToken();
try {
st = new StringTokenizer(br.readLine());
} catch (Exception e) {
e.printStackTrace();
}
return st.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
public String nextLine() {
String line = "";
try {
line = br.readLine();
} catch (Exception e) {
e.printStackTrace();
}
return line;
}
public Integer[] nextIntegerArray(int n) {
Integer[] a = new Integer[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
public char[] nextCharArray() {
return nextLine().toCharArray();
}
}
}
| Main.java:4: error: class CF_C is public, should be declared in a file named CF_C.java
public class CF_C {
^
1 error
|
s878504294 | p03774 | C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int n, m, answer[50];
long a[50], b[50], c[50], d[50];
int i, j, min, mindex, temp;
long min, temp;
scanf("%d%d", &n, &m);
for(i=0;i<n;i++) {
scanf("%ld%ld", a+i, b+i);
}
for(i=0;i<m;i++) {
scanf("%ld%ld", c+i, d+i);
}
for(i=0;i<n;i++) {
min = abs(a[i]-c[j]) + abs(b[i]-d[j]);
mindex = 0;
for(j=1;j<m;j++) {
temp = abs(a[i]-c[j]) + abs(b[i]-d[j]);
if(min > temp) {
min = temp;
mindex = j;
}
}
answer[i] = mindex + 1;
}
for(i=0;i<n;i++) {
printf("%d\n", answer[i]);
}
return 0;
}
| main.c: In function 'main':
main.c:9:8: error: conflicting types for 'min'; have 'long int'
9 | long min, temp;
| ^~~
main.c:8:13: note: previous declaration of 'min' with type 'int'
8 | int i, j, min, mindex, temp;
| ^~~
main.c:9:13: error: conflicting types for 'temp'; have 'long int'
9 | long min, temp;
| ^~~~
main.c:8:26: note: previous declaration of 'temp' with type 'int'
8 | int i, j, min, mindex, temp;
| ^~~~
|
s490226453 | p03774 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int n, m, a[50], b[50], c[50], d[50], answer[50];
int i, j, k, min, mindex;
scanf("%d%d", &n, &m);
for(i=0;i<n;i++) {
scanf("%d", a+i, b+i);
}
for(i=0;i<m;i++) {
scanf("%d", c+i, b+i);
}
for(i=0;i<n;i++) {
min = 0;
mindex = 0:
for(j=0;j<m;j++) {
if(min < abs(a[i]-c[j]) - abs(b[i]-c[j])) {
min = abs(a[i]-c[j]) - abs(b[i]-c[j]);
mindex = j;
}
}
answer[i] = mindex + 1;
}
for(i=0;i<n;i++) {
printf("%d\n", answer[i]);
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:17:15: error: expected ';' before ':' token
17 | mindex = 0:
| ^
| ;
a.cc:18:20: error: expected ';' before ')' token
18 | for(j=0;j<m;j++) {
| ^
| ;
|
s733464295 | p03774 | C++ |
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
// 問2
class cPOINT{
public:
long lnX;
long lnY;
cPOINT() { lnX = 0; lnY = 0; };
cPOINT& operator=(const cPOINT &obj);
cPOINT operator-(const cPOINT &obj);
double calc();
};
cPOINT& cPOINT::operator=(const cPOINT &obj)
{
lnX = obj.lnX;
lnY = obj.lnY;
return *this;
}
cPOINT cPOINT::operator-(const cPOINT &obj)
{
cPOINT cTmp;
cTmp.lnX = this->lnX - obj.lnX;
cTmp.lnY = this->lnY - obj.lnY;
return cTmp;
}
double cPOINT::calc()
{
double dbPowX = pow(lnX, 2);
double dbPowY = pow(lnY, 2);
return sqrt(dbPowX + dbPowY);
}
int main()
{
long lnCntN;
long lnCntM;
cin >> lnCntN;
cin >> lnCntM;
vector<cPOINT> vecN(lnCntN);
vector<cPOINT> vecM(lnCntM);
for (int i = 0; i < lnCntN; i++)
{
cPOINT stAdd;
cin >> stAdd.lnX;
cin >> stAdd.lnY;
vecN[i] = stAdd;
}
for (int i = 0; i < lnCntM; i++)
{
cPOINT stAdd;
cin >> stAdd.lnX;
cin >> stAdd.lnY;
vecM[i] = stAdd;
}
for (int i = 0; i < lnCntN; i++)
{
int nIdxM=0; // 1番近いチェックポイントデータのIndex;
double dbNearVal = LONG_MAX; // 1番近いチェックポイントまでの距離
for (int j=0; j < lnCntM; j++)
{
cPOINT cTmp = vecN[i] - vecM[j];
double dbVal = cTmp.calc();
if (dbVal < dbNearVal)
{
dbNearVal = dbVal;
nIdxM = j;
}
}
if (i == lnCntN-1)
cout << nIdxM + 1;
else
cout << nIdxM + 1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:70:36: error: 'LONG_MAX' was not declared in this scope
70 | double dbNearVal = LONG_MAX; // 1番近いチェックポイントまでの距離
| ^~~~~~~~
a.cc:7:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <math.h>
+++ |+#include <climits>
7 | using namespace std;
|
s264105676 | p03774 | Java | 1. import java.util.*;
2. class Main{
3. public static void main(String[]args){
4. Scanner cin=new Scanner(System.in);
5. int numS;
6. int numC;
7. int count =0;
8. int kx;
9. int ky;
10. int result;
11. int temp;
12.
13. numS = cin.nextInt();
14. numC = cin.nextInt();
15. int student[] = new int[numS];
16. int checkp[] = new int[numC];
17. for(int i=0;i<numS;i++ ){
18. student[count]=cin.nextInt();
19. count++;
20. student[count]=cin.nextInt();
21. count++;
22. }
23. count = 0;
24. for(int j=0;j<numC;j++ ){
25. checkp[count]=cin.nextInt();
26. count++;
27. checkp[count]=cin.nextInt();
28. count++;
29. }
30. for(int k=0;k<numS;k++){
31. kx = student[2*k];
32. ky = student[2*k+1];
33. result = 0;
34. temp = 900000000;
35. for(int m=0;m<numC;m++){
36. if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
37. temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
38. result = m;
39. }
40. }
41. System.out.println(result);
42. }
43. }
44. }
| Main.java:1: error: class, interface, enum, or record expected
1. import java.util.*;
^
Main.java:2: error: class, interface, enum, or record expected
2. class Main{
^
Main.java:3: error: illegal start of type
3. public static void main(String[]args){
^
Main.java:4: error: not a statement
4. Scanner cin=new Scanner(System.in);
^
Main.java:4: error: ';' expected
4. Scanner cin=new Scanner(System.in);
^
Main.java:5: error: not a statement
5. int numS;
^
Main.java:5: error: ';' expected
5. int numS;
^
Main.java:6: error: not a statement
6. int numC;
^
Main.java:6: error: ';' expected
6. int numC;
^
Main.java:7: error: not a statement
7. int count =0;
^
Main.java:7: error: ';' expected
7. int count =0;
^
Main.java:8: error: not a statement
8. int kx;
^
Main.java:8: error: ';' expected
8. int kx;
^
Main.java:9: error: not a statement
9. int ky;
^
Main.java:9: error: ';' expected
9. int ky;
^
Main.java:10: error: not a statement
10. int result;
^
Main.java:10: error: ';' expected
10. int result;
^
Main.java:11: error: not a statement
11. int temp;
^
Main.java:11: error: ';' expected
11. int temp;
^
Main.java:12: error: not a statement
12.
^
Main.java:12: error: ';' expected
12.
^
Main.java:14: error: not a statement
14. numC = cin.nextInt();
^
Main.java:14: error: ';' expected
14. numC = cin.nextInt();
^
Main.java:15: error: not a statement
15. int student[] = new int[numS];
^
Main.java:15: error: ';' expected
15. int student[] = new int[numS];
^
Main.java:16: error: not a statement
16. int checkp[] = new int[numC];
^
Main.java:16: error: ';' expected
16. int checkp[] = new int[numC];
^
Main.java:17: error: not a statement
17. for(int i=0;i<numS;i++ ){
^
Main.java:17: error: ';' expected
17. for(int i=0;i<numS;i++ ){
^
Main.java:18: error: not a statement
18. student[count]=cin.nextInt();
^
Main.java:18: error: ';' expected
18. student[count]=cin.nextInt();
^
Main.java:19: error: not a statement
19. count++;
^
Main.java:19: error: ';' expected
19. count++;
^
Main.java:20: error: not a statement
20. student[count]=cin.nextInt();
^
Main.java:20: error: ';' expected
20. student[count]=cin.nextInt();
^
Main.java:21: error: not a statement
21. count++;
^
Main.java:21: error: ';' expected
21. count++;
^
Main.java:22: error: not a statement
22. }
^
Main.java:22: error: ';' expected
22. }
^
Main.java:23: error: not a statement
23. count = 0;
^
Main.java:23: error: ';' expected
23. count = 0;
^
Main.java:24: error: not a statement
24. for(int j=0;j<numC;j++ ){
^
Main.java:24: error: ';' expected
24. for(int j=0;j<numC;j++ ){
^
Main.java:25: error: not a statement
25. checkp[count]=cin.nextInt();
^
Main.java:25: error: ';' expected
25. checkp[count]=cin.nextInt();
^
Main.java:26: error: not a statement
26. count++;
^
Main.java:26: error: ';' expected
26. count++;
^
Main.java:27: error: not a statement
27. checkp[count]=cin.nextInt();
^
Main.java:27: error: ';' expected
27. checkp[count]=cin.nextInt();
^
Main.java:28: error: not a statement
28. count++;
^
Main.java:28: error: ';' expected
28. count++;
^
Main.java:29: error: not a statement
29. }
^
Main.java:29: error: ';' expected
29. }
^
Main.java:30: error: not a statement
30. for(int k=0;k<numS;k++){
^
Main.java:30: error: ';' expected
30. for(int k=0;k<numS;k++){
^
Main.java:31: error: not a statement
31. kx = student[2*k];
^
Main.java:31: error: ';' expected
31. kx = student[2*k];
^
Main.java:32: error: not a statement
32. ky = student[2*k+1];
^
Main.java:32: error: ';' expected
32. ky = student[2*k+1];
^
Main.java:33: error: not a statement
33. result = 0;
^
Main.java:33: error: ';' expected
33. result = 0;
^
Main.java:34: error: not a statement
34. temp = 900000000;
^
Main.java:34: error: ';' expected
34. temp = 900000000;
^
Main.java:35: error: not a statement
35. for(int m=0;m<numC;m++){
^
Main.java:35: error: ';' expected
35. for(int m=0;m<numC;m++){
^
Main.java:36: error: not a statement
36. if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
^
Main.java:36: error: ';' expected
36. if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
^
Main.java:37: error: not a statement
37. temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
^
Main.java:37: error: ';' expected
37. temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
^
Main.java:38: error: not a statement
38. result = m;
^
Main.java:38: error: ';' expected
38. result = m;
^
Main.java:39: error: not a statement
39. }
^
Main.java:39: error: ';' expected
39. }
^
Main.java:40: error: not a statement
40. }
^
Main.java:40: error: ';' expected
40. }
^
Main.java:41: error: not a statement
41. System.out.println(result);
^
Main.java:41: error: ';' expected
41. System.out.println(result);
^
Main.java:42: error: not a statement
42. }
^
Main.java:42: error: ';' expected
42. }
^
Main.java:43: error: not a statement
43. }
^
Main.java:43: error: ';' expected
43. }
^
Main.java:44: error: illegal start of type
44. }
^
82 errors
|
s581514785 | p03774 | Java | import java.util.*;
class Main{
public static void main(String[]args){
Scanner cin=new Scanner(System.in);
int numS;
int numC;
int student = new int[];
int checkp = new int[];
int count =0;
int kx;
int ky;
int result;
int temp;
numS = cin.nextInt();
numC = cin.nextInt();
for(int i=0;i<numS;i++ ){
student[count]=cin.nextInt();
count++;
student[count]=cin.nextInt();
count++;
}
count = 0;
for(int j=0;j<numC;j++ ){
checkp[count]=cin.nextInt();
count++;
checkp[count]=cin.nextInt();
count++;
}
for(int k=0;k<numS;k++){
kx = student[2*k];
ky = student[2*k+1];
result = 0;
temp = 900000000;
for(int m=0;m<numC;m++){
if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
result = m
}
}
System.out.println(result);
}
}
} | Main.java:7: error: array dimension missing
int student = new int[];
^
Main.java:8: error: array dimension missing
int checkp = new int[];
^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
^
Main.java:38: error: ';' expected
result = m
^
6 errors
|
s014419791 | p03774 | C++ | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef long double LD;
typedef pair<LD, LD> PLDLD;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()
LL INF=1e15+7;
int main()
{
int n,m;
cin>>n>>m;
vector<PLL> p(n),q(m);
REP(i,n)
{
LL a,b;
cin>>a>>b;
p[i]=PLL(a,b);
}
REP(i,m)
{
LL a,b;
cin>>a>>b;
q[i]=PLL(a,b);
}
REP(i,n)
{
int ans=0;
LL mdis=INF,dis;
REP(j,m)
{
dis=abs(p[i].first-q[j].first) + abs(p[i].second - q[j].second);
if(dis<mdis)
{
mdis=dis;
ans=j;
}
}
cout<<ans+1<<endl;
}*/
}
| a.cc: In function 'int main()':
a.cc:52:7: error: expected primary-expression before '/' token
52 | }*/
| ^
a.cc:53:1: error: expected primary-expression before '}' token
53 | }
| ^
|
s355699313 | p03774 | C++ | #include<stdio.h>
#include<math.h>
int main() {
int n, m;
scanf("%d%d", &n, &m);
double a[50];
double b[50];
double c[50];
double d[50];
double h = pow(10, 8),i,g;
for (int k = 0; k < n; k++) {
scanf_s("%lf%lf", &a[k], &b[k]);
}
for (int k = 0; k < m; k++) {
scanf_s("%lf%lf", &c[k], &d[k]);
}
for (int e= 0; e < n; e++) {
for (int f = 0; f < m; f++) {
g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
if (h > g) {
h = g;
i = f + 1;
}
}
printf("%f\n", i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | scanf_s("%lf%lf", &a[k], &b[k]);
| ^~~~~~~
| scanf
a.cc:15:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
15 | scanf_s("%lf%lf", &c[k], &d[k]);
| ^~~~~~~
| scanf
|
s552654574 | p03774 | C++ | #include<stdio.h>
#include<math.h>
int main() {
int n, m;
scanf_s("%d%d", &n, &m);
double a[50];
double b[50];
double c[50];
double d[50];
double h = pow(10, 8),i,g;
for (int k = 0; k < n; k++) {
scanf_s("%lf%lf", &a[k], &b[k]);
}
for (int k = 0; k < m; k++) {
scanf_s("%lf%lf", &c[k], &d[k]);
}
for (int e= 0; e < n; e++) {
for (int f = 0; f < m; f++) {
g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
if (h > g) {
h = g;
i = f + 1;
}
}
printf("%f\n", i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
5 | scanf_s("%d%d", &n, &m);
| ^~~~~~~
| scanf
|
s287789681 | p03774 | C | #include<stdio.h>
#include<math.h>
int main() {
int n, m;
scanf_s("%d%d", &n, &m);
double a[50];
double b[50];
double c[50];
double d[50];
double h = pow(10, 8),i,g;
for (int k = 0; k < n; k++) {
scanf_s("%lf%lf", &a[k], &b[k]);
}
for (int k = 0; k < m; k++) {
scanf_s("%lf%lf", &c[k], &d[k]);
}
for (int e= 0; e < n; e++) {
for (int f = 0; f < m; f++) {
g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
if (h > g) {
h = g;
i = f + 1;
}
}
printf("%f\n", i);
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | scanf_s("%d%d", &n, &m);
| ^~~~~~~
| scanf
|
s903795954 | p03774 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
// freopen("/Users/balazskemenes/Documents/temp/practise/src/problems/input.txt","r",stdin);
int studentCount;
cin >> studentCount;
int checkpointCount;
cin >> checkpointCount;
vector<int> studentsX;
vector<int> studentsY;
vector<int> checkpointsX;
vector<int> checkpointsY;
for(int i = 0; i < studentCount; ++i) {
int sX;
int sY;
cin >> sX;
cin >> sY;
studentsX.emplace_back(sX);
studentsY.emplace_back(sY);
}
for(int i = 0; i < checkpointCount; ++i) {
int cX;
int cY;
cin >> cX;
cin >> cY;
checkpointsX.emplace_back(cX);
checkpointsY.emplace_back(cY);
}
for(int i = 0; i < studentCount; ++i) {
int sX = studentsX[i];
int sY = studentsY[i];
double minDistance = INT_MAX;
int checkpointId = 0;
for(int j = 0; j < checkpointCount; ++j) {
int cX = checkpointsX[j];
int cY = checkpointsY[j];
double currentDistance = abs(sX - cX) + abs(sY - cY);
if(currentDistance < minDistance) {
minDistance = currentDistance;
checkpointId = j + 1;
}
}
cout << checkpointId << endl;
}
// ------------------------------------------------------------------------------------------
//
// unsigned long long N;
// cin >> N;
//
//
//
// unsigned long long limit = N / 2;
//
// int minLength = to_string(N).size();
//
//
// for(int i = 2; i < limit; ++ i) {
//
//
// if(N % i == 0) {
//
// unsigned long long rightSide = N / i;
//
//
// unsigned long long leftSide = i;
// unsigned long long originalRightSide = rightSide;
//
// int leftSideLength=0;
// for(;leftSide;leftSide/=10) leftSideLength++;
// leftSideLength = leftSideLength==0 ? 1 : leftSideLength;
//
//
//
//
//
//
//// int leftSideLength = intLength(i);
//
//
//
//
//
// int rightSideLength=0;
// for(;rightSide;rightSide/=10) rightSideLength++;
// rightSideLength = rightSideLength==0 ? 1 : rightSideLength;
//
//
//
//
//
//
//// int rightSideLength = intLength(rightSide);
//
//
//
//
//
//
// int currentMaxLength = max(leftSideLength, rightSideLength);
//
//
//
// if(currentMaxLength > minLength) {
//
// break;
// }
//
//
// if(currentMaxLength < minLength) {
//
//
// minLength = currentMaxLength;
//
// }
//
//
//
//
//
//
// }
//
//
//
//
// }
//
//
//
// cout << minLength;
//
//
//
return 0;
}
| a.cc: In function 'int main()':
a.cc:83:30: error: 'INT_MAX' was not declared in this scope
83 | double minDistance = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <cmath>
+++ |+#include <climits>
4 |
|
s064707400 | p03774 | Java | public class ABC057b {
static int[] measureDistance(int x,int y,int[] arrx, int[] arry){
int[] arrDistance = new int[arrx.length];
for(int i = 0; i < arrx.length; i++) {
int dx = x - arrx[i];
int dy = y - arry[i];
if(dx < 0){
dx = -1 * dx;
}
if(dy < 0){
dy = -1 * dy;
}
arrDistance[i] = dx + dy;
}
return arrDistance;
}
static int indexOf(int[] a){
int min = a[0];
for(int i = 1; i < a.length; i++){
if(a[i] < min) min = a[i];
}
int index = 0;
for(int i = 0; i < a.length; i++) {
if(a[i] == min){
index = i;
i = a.length;
}
}
return index;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); //Number of Students
int M = sc.nextInt(); //Number of checkpoint
int[] arrStudentsX = new int[N];
int[] arrStudentsY = new int[N];
for(int i = 0; i < N; i++) {
arrStudentsX[i] = sc.nextInt();
arrStudentsY[i] = sc.nextInt();
}
int[] arrCheckpointX = new int[M];
int[] arrCheckpointY = new int[M];
for(int i = 0; i < M; i++) {
arrCheckpointX[i] = sc.nextInt();
arrCheckpointY[i] = sc.nextInt();
}
int[] result = new int[N];
for(int i = 0; i < N; i++){
int x = arrStudentsX[i];
int y = arrStudentsY[i];
int[] arr = measureDistance(x,y,arrCheckpointX,arrCheckpointY);
result[i] = indexOf(arr) + 1;
}
for(int i = 0; i < N; i++){
System.out.println(result[i]);
}
}
} | Main.java:1: error: class ABC057b is public, should be declared in a file named ABC057b.java
public class ABC057b {
^
Main.java:36: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class ABC057b
Main.java:36: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class ABC057b
3 errors
|
s604802614 | p03774 | C++ | #pragma warning(disable:4996)
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
#include<time.h>
#include<map>
#include<set>
#include<sstream>
#include<cassert>
using namespace std;
const int INF = 0x3f3f3f3f;
int p1()
{
int a,b;
cin >> a >> b;
return (a+b+24)%24;
}
void p2()
{
int m,n;
cin >> m >> n;
vector<int> study;
while(m){
int a1,b1;
cin >> a1 >> b1;
study.push_back(a1);
study.push_back(b1);
m--;
}
vector<int> point;
while(n) {
int c1,d1;
cin >> c1 >>d1;
point.push_back(c1);
point.push_back(d1);
n--;
}
int dist2 = 0;
int ma = INT_MAX;
int x,y;
for(int i =0; i<study.size(); i=i+2)
{
for(int j=0, index = 0; j<point.size(); j=j+2, ++index)
{
dist2 = abs(study[i]-point[j])
+ abs(study[i+1]-point[j+1]);
if(dist2 < ma)
{
ma = dist2;
x = i+1, y = index+1;
}
}
cout <<y<<endl;
dist2 = 0;
ma = INT_MAX;
}
}
int main()
{
p2();
return 0;
}
| a.cc: In function 'void p2()':
a.cc:45:14: error: 'INT_MAX' was not declared in this scope
45 | int ma = INT_MAX;
| ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
13 | #include<cassert>
+++ |+#include <climits>
14 | using namespace std;
|
s576258108 | p03774 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int n, m, a[50], b[50], c[51], d[51], ans = 0, max = 0;
int main(){
cin >> n >> m;
for (int i = 0; i < n; i++){
cin >> a[i] >> b[i];
}
for (int i = 1; i <= m; i++){
cin >> c[i] >> d[i];
}
for (int i = 0; i < n; i++){
max = abs(a[i] - c[1]) + abs(b[i] - d[1]);
ans = 1;
for (int j = 2; j <= m; j++){
if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < max){
max = abs(a[i] - c[j]) + abs(b[i] - d[j]);
ans = j;
}
}
cout << ans << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:17: error: reference to 'max' is ambiguous
18 | max = abs(a[i] - c[1]) + abs(b[i] - d[1]);
| ^~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:6:48: note: 'int max'
6 | int n, m, a[50], b[50], c[51], d[51], ans = 0, max = 0;
| ^~~
a.cc:22:67: error: reference to 'max' is ambiguous
22 | if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < max){
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:6:48: note: 'int max'
6 | int n, m, a[50], b[50], c[51], d[51], ans = 0, max = 0;
| ^~~
a.cc:23:33: error: reference to 'max' is ambiguous
23 | max = abs(a[i] - c[j]) + abs(b[i] - d[j]);
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:6:48: note: 'int max'
6 | int n, m, a[50], b[50], c[51], d[51], ans = 0, max = 0;
| ^~~
|
s158218370 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m;
set<int>q;
int dis(int x1,int y1,int x2,int y2)
{
return abs(x1-x2)+abs(y1-y2);
}
int x1[10000],y1[100000],x2[10000],y2[100000];
int main()
{
cin>>n>>m;
for(int i=1;i<=n;i++)
{
cin>>x1[i]>>y1[i];
}
for(int i=1;i<=m;i++)
{
cin>>x2[i]>>y2[i];
}
for(int i=1;i<=n;i++)
{
int pos;
int Max=(1<<31)-1;
for(int j=1;j<=m;j++)
{
int ans=dis(x1[i],y1[i],x2[j],y2[j]);
//cout<<ans<<endl;
if(ans<Max)
{
pos=j;
// cout<<pos<<endl;
Max=ans;
}
}
cout<<pos<<endl;
}
return 0;
}
| a.cc:9:24: error: 'int y1 [100000]' redeclared as different kind of entity
9 | int x1[10000],y1[100000],x2[10000],y2[100000];
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
15 | cin>>x1[i]>>y1[i];
| ^
a.cc:15:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
15 | cin>>x1[i]>>y1[i];
| ~~~~~~~~~~^~~~~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
15 | cin>>x1[i]>>y1[i];
| ~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(short int)(y1 + ((sizetype)i))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(short unsigned int)(y1 + ((sizetype)i))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(int)(y1 + ((sizetype)i))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(unsigned int)(y1 + ((sizetype)i))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(long int)(y1 + ((sizetype)i))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(long unsigned int)(y1 + ((sizetype)i))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(long long int)(y1 + ((sizetype)i))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(long long unsigned int)(y1 + ((sizetype)i))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
a.cc:15:25: error: cannot bind rvalue '(void*)(y1 + ((sizetype)i))' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:25: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
15 | cin>>x1[i]>>y1[i];
| ~~~~^
| |
| double (*)(double) noexcept
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits> |
s711000595 | p03774 | C++ | #include<cstdio>
#include<conio.h>
#include<math.h>
#include<algorithm>
using namespace std;
int a[100],b[100],x[100],y[100],lon[100],ans[100];
int main(){
int n,m,i,j;
scanf("%d %d",&n,&m);
for(i=0;i<n;i++){
scanf("%d %d",&a[i],&b[i]);
}
for(i=0;i<m;i++){
scanf("%d %d",&x[i],&y[i]);
}
for(i=0;i<n;i++){
for(j=0;j<m;j++){
if(lon[i]>abs(a[i]-x[j])+abs(b[i]-y[j])){
ans[i]=j;
lon[i]=abs(a[i]-x[j])+abs(b[i]-y[j]);
}
if(j==0){
ans[i]=j;
lon[i]=abs(a[i]-x[j])+abs(b[i]-y[j]);
}
}
}
for(i=0;i<n;i++){
printf("%d\n",ans[i]+1);
}
return 0;
}
| a.cc:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s912354797 | p03774 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
//
//
// int A;
// cin >> A;
//// A = 9;
//
// int B;
// cin >> B;
//// B = 12;
//
//
// cout << (A + B) % 24;
// ------------------------------------------------------------------------------------------
// freopen("/Users/balazskemenes/Documents/temp/practise/src/problems/input.txt","r",stdin);
int studentCount;
cin >> studentCount;
int checkpointCount;
cin >> checkpointCount;
vector<int> studentsX;
vector<int> studentsY;
vector<int> checkpointsX;
vector<int> checkpointsY;
for(int i = 0; i < studentCount; ++i) {
int sX;
int sY;
cin >> sX;
cin >> sY;
studentsX.emplace_back(sX);
studentsY.emplace_back(sY);
}
for(int i = 0; i < checkpointCount; ++i) {
int cX;
int cY;
cin >> cX;
cin >> cY;
checkpointsX.emplace_back(cX);
checkpointsY.emplace_back(cY);
}
for(int i = 0; i < studentCount; ++i) {
int sX = studentsX[i];
int sY = studentsY[i];
double minDistance = INT_MAX;
int checkpointId = 0;
for(int j = 0; j < checkpointCount; ++j) {
int cX = checkpointsX[j];
int cY = checkpointsY[j];
double currentDistance = abs(sX - cX) + abs(sY - cY);
if(currentDistance < minDistance) {
minDistance = currentDistance;
checkpointId = j + 1;
}
}
cout << checkpointId << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:97:30: error: 'INT_MAX' was not declared in this scope
97 | double minDistance = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <vector>
+++ |+#include <climits>
3 |
|
s726727424 | p03774 | C++ | #include <string>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;
typedef pair<int, int> coord;
int distance(int x1, int y1, int x2, int y2)
{
return abs(x1 - x2) + abs(y1 - y2);
}
int main()
{
int N, M;
cin >> N >> M;
vector<coord> students(N);
vector<coord> checkpoints(M);
vector<coord> answers(N);
for (int i = 0; i < N; ++i) cin >> students[i].first >> students[i].second;
for (int i = 1; i <= M; ++i) {
int x, y;
cin >> x >> y;
for (int j = 0; j < N; ++j) {
int dist = distance(x, y, students[j].first, students[j].second);
if (answers[j].first == 0 or dist < answers[j].second) {
answers[j].first = i;
answers[j].second = dist;
}
}
}
for (const auto answer: answers) cout << answer.first << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope
19 | cin >> N >> M;
| ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include <algorithm>
+++ |+#include <iostream>
6 |
a.cc:35:36: error: 'cout' was not declared in this scope
35 | for (const auto answer: answers) cout << answer.first << endl;
| ^~~~
a.cc:35:36: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:60: error: 'endl' was not declared in this scope
35 | for (const auto answer: answers) cout << answer.first << endl;
| ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
5 | #include <algorithm>
+++ |+#include <ostream>
6 |
|
s735625251 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[100], b[100], c[100], d[100];
int n, m;
int main(){
scanf("%d %d", &n, &m);
for(int i = 0; i < n; i++)
scanf("%d %d", a+i, b+i);
for(int i = 0; i < m; i++)
scanf("%d %d", c+i, d+i);
for(int i = 0; i < n; i++){
int ans = 0, mn = 1000000000;
for(int j = 0; j < m; j++){
int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
if(d < mn){
mn = d;
ans = j;
}
}
printf("%d\n", ans+1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:21:64: error: invalid types 'int[int]' for array subscript
21 | int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
| ^
|
s318893430 | p03774 | C++ | #include <set>
#include <map>
#include <queue>
#include <deque>
#include <cstdio>
#include <string>
#include <vector>
#include <math.h>
#include <time.h>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <conio.h>
#include <iostream>
#include <algorithm>
#include <windows.h>
#define ll long long
#define StopProgram() exit(0)
#define Max(a,b) (b<a ? a : b)
#define Min(a,b) (a<b ? a : b)
#define Abs(x) ((x) > 0 ? (x) : -(x))
#define Fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
using namespace std;
int n, m, a[55], b[55], c[55], d[55];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
for (int i = 1; i <= m; i++) scanf("%d%d", &c[i], &d[i]);
for (int i = 1; i <= n; i++) {
int e = -1;
for (int j = 1; j <= m; j++) if (e == -1 || abs(a[i]-c[j])+abs(b[i]-d[j])<abs(a[i]-c[e])+abs(b[i]-d[e])) e=j;
printf("%d\n", e);
}
return 0;
} | a.cc:16:10: fatal error: conio.h: No such file or directory
16 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s278927648 | p03774 | C++ | #include <stdio.h>
#include <cstdlib>
int main(void) {
int n, m;
scanf("%i %i", &n, &m);
int a[n], b[n];
for (int i = 0; i < n; i++) {
scanf("%i %i", &a[i], &b[i]);
}
int c[m], b[m];
for (int i = 0; i < m; i++) {
scanf("%i %i", &c[i], &d[i]);
}
for (int i = 0; i < n; i++) {
int best = 1 << 30, idx = -1;
for (int j = 0; j < m; j++) {
int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
if (d < best) {
best = d;
idx = j;
}
}
printf("%i\n", j + 1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:13: error: conflicting declaration 'int b [m]'
13 | int c[m], b[m];
| ^
a.cc:8:13: note: previous declaration as 'int b [n]'
8 | int a[n], b[n];
| ^
a.cc:15:28: error: 'd' was not declared in this scope
15 | scanf("%i %i", &c[i], &d[i]);
| ^
a.cc:21:46: error: invalid types 'int[int]' for array subscript
21 | int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
| ^
a.cc:28:20: error: 'j' was not declared in this scope
28 | printf("%i\n", j + 1);
| ^
|
s368371073 | p03774 | C++ | #include <iostream>
#include <cmath>
#define INF 1e+9
using namespace std;
int main(){
int n,m,a[50],b[50],c[50],d[50];
cin >> n >> m;
for(int i = 0;i < n;i++){
cin >> a[i] >> b[i];
}
for(int i = 0;i < m;i++) cin >> c[i] >> d[i];
for(int i = 0;i < n;i++){
int mi = INF,mii;
for(int j = 0;j < m;j++){
int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
if(mi > d){
mi = d;
mii = j + 1;
}
}
cout << mii << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:64: error: invalid types 'int[int]' for array subscript
16 | int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
| ^
|
s748965617 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;
typedef int64_t ll;
typedef uint64_t ull;
#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)
// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
uint64_t temp;
while (m % n != 0){
temp = n;
n = m % n;
m = temp;
}
return n;
}
uint64_t lcm(uint64_t m, uint64_t n) {
return (m*n)/gcd(m,n);
}
// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
for(uint64_t i = 0;i <v.size(); i++){
v[i][0]=1;
v[i][i]=1;
}
for(uint64_t k = 1;k <v.size();k++){
for(uint64_t j = 1;j<k;j++){
v[k][j]=(v[k-1][j-1]+v[k-1][j]);
}
}
}
// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {
uint64_t prod = a * b;
return (prod / b != a);
}
//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
long i,sq;
if(a%2==0){ //偶数の場合
factors.push_back(2);
primeFactorization(a/2,factors); //2で割った値で再帰
return;
}
sq = sqrt(a);
for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
if(a%i==0){
factors.push_back(i);
primeFactorization(a/i,factors); //割れた値で再帰
return;
}
}
//偶数でも3以上√a以下の奇数の場合でも割り切れない場合
if(a!=1){ //aが1でないなら、a自身は素数
factors.push_back(a);
}
}
// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m
int64_t modinv(int64_t a, int64_t m) {
int64_t b = m, u = 1, v = 0;
while (b) {
int64_t t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, v);
}
u %= m;
if (u < 0) u += m;
return u;
}
/*
//エラトステネスのふるい
int maxNum = 100000;
char isNotPrime[maxNum+1] = {};
isNotPrime[0]=isNotPrime[1]=1;
for(int i=2;i<maxNum;i++){
if(isNotPrime[i]==1) continue;
int num = i+i;
while(num<=maxNum){
isNotPrime[num]=1;
num += i;
}
}
*/
// 円周率
// M_PI
// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;
// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;
// 降順ソート vector<int> v;
// sort(v.begin(),v.end(),greater<int>());
signed main() {
ull n;
cin >> n;
ull a = 0;
for(ull i=sqrt(n);i>=1;i--){
if(n%i==0){
a = i;
break;
}
}
if(a==1){
a = n;z
}
//cout << a << ":" << n/a << endl;
int count = 0;
while(a>0){
a /= 10;
count++;
}
cout << count << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:124:11: error: 'z' was not declared in this scope
124 | a = n;z
| ^
|
s613907365 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
int Decimal(int N){
int num=0;
while(N!=0){
N=N/10;
num++;
}
return num;
}
int main(){
int N; //Nの数
long B=1; //AとBの数の入れ物を用意
int ans=12;
/////入力部/////
cin >> N;
int ans=Decimal(N); //1の時の値
for (long A=2;A*A<=N;A++){
if(N%i == 0){
B /= i;
if(ans >=Decimal(B))ans = Decimal(B);
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:21:7: error: redeclaration of 'int ans'
21 | int ans=Decimal(N); //1の時の値
| ^~~
a.cc:17:7: note: 'int ans' previously declared here
17 | int ans=12;
| ^~~
a.cc:24:10: error: 'i' was not declared in this scope
24 | if(N%i == 0){
| ^
|
s037851236 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
int Decimal(int N){
int num=0;
while(N!=0){
N=N/10;
num++;
}
return num;
}
int main(){
int N; //Nの数
int A=1,B=1,C=0; //AとBの数の入れ物を用意
int ans=12;
/////入力部/////
cin >> N;
int ans=Decimal(N); //1の時の値
for (long i=2;i^2<=N;i++){
if(N%i == 0){
B /= i;
if(ans >=Decimal(B))ans = Decimal(B);
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:21:7: error: redeclaration of 'int ans'
21 | int ans=Decimal(N); //1の時の値
| ^~~
a.cc:17:7: note: 'int ans' previously declared here
17 | int ans=12;
| ^~~
|
s991290176 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
int Decimal(int N){
int num=0;
while(N==0){
N=N/10;
num++;
}
return num;
}
int main(){
int N; //Nの数
int A=1,B=1,C=0; //AとBの数の入れ物を用意
int ans=12;
/////入力部/////
cin << N;
for (int i=1;i<=N;i++){
for(int j=1;j<=N;j++){
if(i*j == N){
A = Decimal(i);
B = Decimal(j);
C = max(A,B);
if(C < ans)ans =C;
}
}
}
cout<<C<<endl;
}
| a.cc: In function 'int main()':
a.cc:18:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
18 | cin << N;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:18:7: note: candidate: 'operator<<(int, int)' (built-in)
18 | cin << N;
| ~~~~^~~~
a.cc:18:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:18:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
18 | cin << N;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:18:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
18 | cin << N;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const sig |
s428162841 | p03775 | C++ | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);
int main()
{
ll n;
cin >> n;
ll ans = INT_MAX;
for (ll a = 1; a <= sqrt(n); a++) {
ll b = n / a;
ll f = max(to_string(a).size(), to_string(b).size());
ans = min(ans, f);
}
cout << ans << endl;
}
| a.cc:2:10: fatal error: atcoder/all: No such file or directory
2 | #include <atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s841558430 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint;
const int mod = 1000000007;
const double PI = acos(-1);
int main()
{
ll n;
cin >> n;
int ans = INT_MAX;
for (ll a = 1; a <= sqrt(n); a++) {
ll b = n / a;
int f = max(to_string(a).size(), to_string(b).size());
ans = min(ans, f);
}
cout << ans << endl;
}
| a.cc:3:17: error: 'atcoder' is not a namespace-name
3 | using namespace atcoder;
| ^~~~~~~
a.cc:5:14: error: 'modint' does not name a type; did you mean 'mode_t'?
5 | using mint = modint;
| ^~~~~~
| mode_t
|
s695147508 | p03775 | C++ | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint;
const int mod = 1000000007;
const double PI = acos(-1);
int main()
{
ll n;
cin >> n;
int ans = INT_MAX;
for (ll a = 1; a <= sqrt(n); a++) {
ll b = n / a;
int f = max(to_string(a).size(), to_string(b).size());
ans = min(ans, f);
}
cout << ans << endl;
}
| a.cc:2:10: fatal error: atcoder/all: No such file or directory
2 | #include <atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s551229345 | p03775 | Java |
import java.util.*;
public class Main2 {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
long right;
long left;
long min=1000000000;
long max;
for(long i=1;i<=n/2;i++)
{
if(n%i==0)
{
right=n/i;
if(right>i) max=right;
else max=i;
min=Math.min(min,(long)Math.log10(max)+1);
}
}
System.out.println(min);
}
}
| Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s157699182 | p03775 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll keta(ll n){
ll i,ans=0;
while(n>0){
n/=10;
ans++;
}
return ans;
}
int main(){
ll n;
cin >> n;
ll i,cp=n,ans=1000;
for(i=1;i*i<=n;i++){
if(cp%i==0){
ll q=cp/i;
ll a=keta(q);
ll b=keta(i);
ll maxi=max(a,b);
ans=min(ans,maxi);
}
}
cout << ans;
}
}
| a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s478811699 | p03775 | C++ | #include<bits/stdc++.h>
using namespace std;
int check( int i )
{
int count = 0;
while( i ) {
i /= 10;
count++;
}
return count;
}
int main( void )
{
long int N;
cin >> N;
long int A, B;
long int = max, min;
min = 1000;
for( int i = 1; i <= N; i++ ) {
if( i * ( N / i ) == N ) {
A = check( i );
B = check( N / i );
// cout << A << i << B << endl;
if( A > B )
max = A;
else
max = B;
}
if( min > max ) {
min = max;
}
//max = 0;
}
cout << min << endl;
} | a.cc: In function 'int main()':
a.cc:20:12: error: expected unqualified-id before '=' token
20 | long int = max, min;
| ^
a.cc:22:9: error: overloaded function with no contextual type information
22 | min = 1000;
| ^~~~
a.cc:29:15: error: overloaded function with no contextual type information
29 | max = A;
| ^
a.cc:31:15: error: overloaded function with no contextual type information
31 | max = B;
| ^
a.cc:33:13: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator>'
33 | if( min > max ) {
| ~~~~^~~~~
a.cc:34:13: error: overloaded function with no contextual type information
34 | min = max;
| ^~~
a.cc:38:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
38 | cout << min << endl;
| ~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.