submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s015303156 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int64_t 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];
}
int64_t min_j = 0;
for (int i = 0; i < n; i+... | a.cc: In function 'int main()':
a.cc:18:19: error: unable to find numeric literal operator 'operator""q2'
18 | int min = 4e8q2 + 1;
| ^~~~~
|
s288020623 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,N;
cin >> N >> M;
vector<vector<int>> v1(N,vector<int>(2));
vector<vector<int>> v2(M,vector<int>(2));
for (int i=0;i<N;i++){
cin >> v1.at(i).at(0) >> v1.at(i).at(1);
}
for (int j=0;j<N;j++){
cin >> v2.at(j).at(0) >> v2.at(j).at(1);... | a.cc: In function 'int main()':
a.cc:5:9: error: redeclaration of 'int N'
5 | int N,N;
| ^
a.cc:5:7: note: 'int N' previously declared here
5 | int N,N;
| ^
a.cc:6:15: error: 'M' was not declared in this scope
6 | cin >> N >> M;
| ^
|
s129828586 | p03774 | C++ | /*
これを入れて実行
g++ code.cpp
./a.out
*/
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long double ld;
int dy4[4] = {-1,... | a.cc: In function 'int main()':
a.cc:84:2: error: expected '}' at end of input
84 | }
| ^
a.cc:62:15: note: to match this '{'
62 | int main(void){
| ^
|
s188441932 | p03774 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;
using ll=lo... | a.cc: In function 'int main()':
a.cc:47:13: error: 'j' was not declared in this scope
47 | cout << j+1 << endl;
| ^
|
s097743357 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<int> a(n), b(m);
for(int i = 0; i < n; i++){
cin >> a[i] >> b[i];
}
for(int j = 0; j < m; j++){
cin >> c[i] >> d[i];
}
for(int i = 0; i < n; i++){
int min = abs(a[i]-c[0]) + abs(b[i]-d[0]);
int mi... | a.cc: In function 'int main()':
a.cc:12:12: error: 'c' was not declared in this scope
12 | cin >> c[i] >> d[i];
| ^
a.cc:12:14: error: 'i' was not declared in this scope
12 | cin >> c[i] >> d[i];
| ^
a.cc:12:20: error: 'd' was not declared in this scope
12 | cin ... |
s912711444 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int a[60],b[60],c[60],d[60];
int ... | a.cc: In function 'int func(int)':
a.cc:23:12: error: 'i' was not declared in this scope
23 | return i+1;
| ^
|
s680649168 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int a[60],b[60],c[60],d[60];
int ... | a.cc: In function 'int func(int)':
a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
24 | int main(){
| ^~
a.cc:24:9: note: remove parentheses to default-initialize a variable
24 | int main(){
| ^~
| --
a.cc:24:9: note: or... |
s005475468 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int func(int x){
int best=INF;
... | a.cc: In function 'int func(int)':
a.cc:17:12: error: 'a' was not declared in this scope
17 | if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
| ^
a.cc:17:17: error: 'c' was not declared in this scope
17 | if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
| ^
a.cc:17:27: error: 'b' was... |
s132450463 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int func(int x){
int best=INF;
... | a.cc: In function 'int func(int)':
a.cc:17:12: error: 'a' was not declared in this scope
17 | if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
| ^
a.cc:17:17: error: 'c' was not declared in this scope
17 | if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
| ^
a.cc:17:27: error: 'b' was... |
s507978318 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int func(int x){
int best=INF;
int ans... | a.cc: In function 'int func(int)':
a.cc:15:9: error: 'm' was not declared in this scope
15 | rep(i,m){
| ^
a.cc:4:38: note: in definition of macro 'rep'
4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
| ^
a.cc:16:12: error: 'a' was not declared in this ... |
s553155450 | p03774 | C++ | #include<iostream>
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 a1[10000],b1[100000],a2[10000],b2[100000];
int main()
{
cin>>n>>m;
for(int i=1;i<=n;i++)
{
cin>>a1[i]>>b1[i];
}
for(int i=1;i<=m;i++)
{
cin>>... | a.cc:4:1: error: 'set' does not name a type
4 | set<int>q;
| ^~~
a.cc: In function 'int main()':
a.cc:24:24: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
24 | int Max=(1<<31)-1;
| ~~~~~~~^~
|
s294566196 | p03774 | C++ | #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
struct D{
int x, y;
};
int main(){
int n, m, i, j, C[51] = {0}, t;
D b[51], e[51];
cin >> n >> m;
for(i = 0; i < n; i++){
cin >> b[i].x >> b[i].y;
}
for(i = 0; i < m; i++){
cin >> e[i].x >> e[i].y;
}
for(i = 0; i < n; i++){
int min... | a.cc:32:3: error: stray '#' in program
32 | } #include<iostream>
| ^
a.cc:32:4: error: 'include' does not name a type
32 | } #include<iostream>
| ^~~~~~~
a.cc:36:8: error: redefinition of 'struct D'
36 | struct D{
| ^
a.cc:5:8: note: previous definition of 'struct D'
5 | struc... |
s802158021 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m;
cin >> n >> m;
vector<int> a(n);
vector<int> b(n);
vector<int> c(m);
vector<int> d(m);
for(int i = 0; i < n; i++){
cin >> a.at(i) >> b.at(i);
}
for(int i = 0; i < m; i++){
cin >> c.at(i) >> d.at(i);
}
pair<int,int> ans;
... | a.cc: In function 'int main()':
a.cc:27:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::pair<int, int>')
27 | cout << ans << endl;
| ~~~~ ^~ ~~~
| | |
| | std::pair<int, int>
| std::ostream {aka ... |
s051014260 | p03774 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n = 0, m = 0;
cin >> n >> m;
vector<pair<long long, long long>> a(n), b(m);
for (int i=0; i<n; i++) cin >> a.at(i).first >> a.at(i).second;
for (int i=0; i<m; i++) cin >> b.at(i).first >> b.at(i).second;
for (int i=0; i<n; i++) {
... | a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<pair<long long, long long>> a(n), b(m);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <cmath>
+++ |+#inclu... |
s648488030 | p03774 | C++ | // --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char* argv[]) {
long double N, M;
long double min, cnt;
cin >> N >> M;
vector<long double>a(N), b(N);
vector<long double>c(N), d(M);
for (int i = 0; i < N; i++) {
cin >> a[i] >> ... | a.cc: In function 'int main(int, char**)':
a.cc:14:9: error: 'vector' was not declared in this scope
14 | vector<long double>a(N), b(N);
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <cmath>
+++ ... |
s890323138 | p03774 | C++ | // --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
long double N, M;
long double min, cnt;
cin >> N >> M;
vector<long double>a(N), b(N);
vector<long double>c(N), d(M);
for (int i = 0; i < N; i++) {
cin >> a[i] >> b[i];
}
for (in... | a.cc: In function 'int main(int, char**)':
a.cc:12:9: error: 'vector' was not declared in this scope
12 | vector<long double>a(N), b(N);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <iostream>
+... |
s215398578 | p03774 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i <(n); i++)
using namespace std;
using ll = long long;
int main()
{
int n, m;
cin << n << m;
int students[n][2];
int points[m][2];
rep(i, n)
cin >> students[i][0] >> students[i][1];
rep(j, m)
cin >> points[j][0] >> points... | a.cc: In function 'int main()':
a.cc:9:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
9 | cin << n << m;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:9:9: note: can... |
s325011897 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int inf=1e9;
int main(){
int n,m;
vector<int>a(n),b(n),c(m),d(m),ans(n);
for(int i=0;i<n;i++){
int dst=inf,ans=-1;
for(int j=0;j<m;j++){
if(dst>abs(a[i]-c[j])+abs(b[i]-d[j])ans=j+1;
}
}
for(auto&& u:ans)cout<<u<<endl;
} | a.cc: In function 'int main()':
a.cc:11:61: error: expected ';' before 'ans'
11 | if(dst>abs(a[i]-c[j])+abs(b[i]-d[j])ans=j+1;
| ^~~
| ;
a.cc:12:9: error: expect... |
s337658411 | p03774 | C | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX... | main.c: In function 'main':
main.c:125:87: error: macro "ABS" passed 2 arguments, but takes just 1
125 | size_t distanceToNearestCP = (size_t)ABS(a[i] - c[0]) + (size_t)ABS(b[i], d[0]);
| ^
main.c:17:9: note: macro "AB... |
s590786899 | p03774 | C | #include<bits/stdc++.h>
using namespace std;
int main(){
int N , M , ans1 , ans2=1000000000 , ans;
cin>>N>>M;
vector<int> 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++){
ans2=1000000000;
for(int j=0;j... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s351905706 | p03774 | C++ | #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int a[55][2], b[55][2];
int main(){
// freopen("input.txt", "r", stdin);
int N, M;
cin >> N >> M;
for (int i = 0; i < N; ++i)
{
cin >> a[i][0] >> a[i][1];
}
for (int i = 0; i < M; ++i)
{
cin >> b[i][0] >> b[i][1];
}
for (int i... | a.cc: In function 'int main()':
a.cc:24:26: error: 'INT_MAX' was not declared in this scope
24 | int mm = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <cstdio>
+... |
s049707908 | p03774 | Java | import java.util.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
int n = scanner.nextInt();
int m = scanner.nextInt();
int[] a = new int[n];
int[] b = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.... | Main.java:31: error: variable index might not have been initialized
System.out.println(index);
^
1 error
|
s217446444 | p03774 | Java | import util.java.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
int n = scanner.nextInt();
int m = scanner.nextInt();
int[] a = new int[n];
int[] b = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.ne... | Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:1: error: package util.java does not exist
import util.java.*;
^
Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
... |
s572828562 | p03774 | C++ | #include<bits/stc++.h>
using namespace std;
int main(){
int N,M;
cin>>N>>M;
vector<int>a(N);
vector<int>b(N);
vector<int>c(M);
vector<int>d(M);
for(int i=0;i<N;i++){
cin>>a.at(i)>>b.at(i);
}
for(int i=0;i<M;i++){
cin>>c.at(i)>>d.at(i);
}
for(int i=0;i<N;i++){
int max=0... | a.cc:1:9: fatal error: bits/stc++.h: No such file or directory
1 | #include<bits/stc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s158033440 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> a(n);
vector<int> b(n);
for (int i = 0; i < n; i++)
{
cin >> a.at(i) >> b.at(i);
}
vector<int> c(m);
vector<int> d(m);
for (int i = 0; i < m; i++)
{
cin >> c.at(i)... | a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
38 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s740691398 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> a(n);
vector<int> b(n);
for (int i = ; i < n; i++)
{
cin >> a.at(i) >> b.at(i);
}
vector<int> c(m);
vector<int> d(m);
for (int i = 0; i < m; i++)
{
cin >> c.at(i) ... | a.cc: In function 'int main()':
a.cc:10:18: error: expected primary-expression before ';' token
10 | for (int i = ; i < n; i++)
| ^
|
s903882853 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n, m;
cin>>n>>m;
int a[n], b[n], c[m], d[m];
int i;
REP(i, n){
... | a.cc: In function 'int main()':
a.cc:23:5: error: 'bango' was not declared in this scope
23 | bango = 0;
| ^~~~~
|
s772518416 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n, m;
cin>>n>>m;
int a[n], b[n], c[m], d[m];
int i;
REP(i, n){
... | a.cc: In function 'int main()':
a.cc:26:52: error: expected ';' before '}' token
26 | min = abs(a[i]-c[i])+abs(b[i]-d[i])
| ^
| ;
27 | }
| ~ ... |
s616830006 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n, m;
cin>>n>>m;
int a[n], b[n], c[m], d[m];
REP(i, n){
cin>>a[i... | a.cc: In function 'int main()':
a.cc:18:9: error: 'i' was not declared in this scope
18 | for(i=0; i<m; i++){
| ^
a.cc:22:9: error: 'i' was not declared in this scope
22 | for(i=0; i<n; i++){
| ^
|
s770989851 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n, m;
cin>>n>>m;
int a[n], b[n], c[m], d[m];
REP(i, n){
cin>>a[i... | a.cc: In function 'int main()':
a.cc:18:9: error: 'i' was not declared in this scope
18 | for(i=0; i<m; i++){
| ^
a.cc:8:13: error: overloaded function with no contextual type information
8 | #define INF 2e9
| ^~~
a.cc:21:11: note: in expansion of macro 'INF'
21 | min =... |
s371915700 | p03774 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
int main(void){
int N,M;
cin >> N >> M;
vector<vector<int>>person(N,vector<int>(2,0));
for(int i=0;i<N;i++){
cin >> person[i][0];
cin >> person[i][1];
}
vector<vector<int>>point(M,vector<int>(2,0));
for(int i=0;i<M;i... | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> N >> M;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked t... |
s350808818 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<int> ans(n);
vector<int> a(n);
vector<int> b(n);
vector<int> c(m);
vector<int> d(m);
vector<>
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++){
... | a.cc: In function 'int main()':
a.cc:11:10: error: wrong number of template arguments (0, should be at least 1)
11 | vector<>
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/b... |
s771347305 | p03774 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define MAXP 0x0FFFFFFF
typedef struct{
TLong x;
TLong y;
} point;
int main(int argc, char const *argv[])
{
int n,m;
int pNum;
TLong min;
point std[53],cp[53];
... | main.c: In function 'main':
main.c:31:28: error: implicit declaration of function 'MHD' [-Wimplicit-function-declaration]
31 | if(MHD(std[i],cp[j]) < min){
| ^~~
|
s334320375 | p03774 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <limit.h>
int main()
{
int point[50][2];
int check[50][2];
int N,M;
int i, j;
int minditance;
int distance;
int minnum = 0;
scanf("%d%d",&N,&M);
for (i = 0; i < N; i++) {
scanf("%d%d", &point[i][0], &point[i][1]);
}
for (i = 0; i < M; i++) {
scanf("%d%d"... | a.cc:3:10: fatal error: limit.h: No such file or directory
3 | #include <limit.h>
| ^~~~~~~~~
compilation terminated.
|
s514054060 | p03774 | C++ | #include <stdlib.h>
int main()
{
int point[50][2];
int check[50][2];
int N,M;
int i, j;
int minditance;
int distance;
int minnum = 0;
scanf("%d%d",&N,&M);
for (i = 0; i < N; i++) {
scanf("%d%d", &point[i][0], &point[i][1]);
}
for (i = 0; i < M; i++) {
scanf("%d%d", &check[i][0], &check[i][1]);
}
fo... | a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf' was not declared in this scope
14 | scanf("%d%d",&N,&M);
| ^~~~~
a.cc:23:30: error: 'INT_MAX' was not declared in this scope
23 | minditance = INT_MAX;
| ^~~~~~~
a.cc:2:1: note: 'INT_... |
s700041237 | p03774 | C++ |
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int getdis(int a, int b, int c, int d) {
return abs(a - c) + abs(b - d);
}
int main() {
int a[50];
int b[50];
int c[50];
int d[50];
int n, m;
int dis;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
... | a.cc: In function 'int main()':
a.cc:34:30: error: 'INT_MAX' was not declared in this scope
34 | int wk_dis = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <std... |
s767759368 | p03774 | C++ | #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int getdis(int a, int b, int c, int d) {
return abs(a - c) + abs(b - d);
}
int main() {
int a[50];
int b[50];
int c[50];
int d[50];
int n, m;
int dis;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
... | a.cc: In function 'int main()':
a.cc:33:30: error: 'INT_MAX' was not declared in this scope
33 | int wk_dis = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <std... |
s286663449 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, M, num, mi;
cin >> N >> M;
int a[N];
int b[N];
int c[M];
int d[M];
for(int i = 0;i < N;i++){
cin >> a[i];
cin >> b[i];
}
for(int i = 0;i < M;i++){
cin >> c[i];
cin >> d[i];
}
for(int j = 0;j < N;j++){
mi = 200000001;
... | a.cc: In function 'int main()':
a.cc:31:4: error: expected '}' at end of input
31 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s621276347 | p03774 | Java | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int m = Integer.parseInt(sc.next());
int[] ax = new int[n];
int[] ay = new int[n];
int[] bx = new int[m];
int[] ... | Main.java:30: error: incompatible types: possible lossy conversion from long to int
min = manhattan;
^
1 error
|
s169618442 | p03774 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
int main() {
std::cin.tie(nullptr); std::ios::sync_with_stdio(false);
int N, M; std::cin >> N >> M;
std::vector<int> a(N), b(N), c(M), d(M);
for (int i = 0; i < N; i++) {
std::cin >> a.at(i) >> b.at(i);
}
for (int i = 0; i < M; i++)... | a.cc:40:14: error: 'cout' in namespace 'std' does not name a type
40 | std::cout << check_point;
| ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ... |
s113001490 | p03774 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
re... | a.cc: In function 'int main()':
a.cc:91:12: error: 'j' was not declared in this scope
91 | ans[i]=j;
| ^
|
s162834986 | p03774 | Java | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[][] stu = new int[n][2];
for(int i = 0; i < n; i++){
stu[i][0] = sc.nextInt();
stu[i][1] = sc.... | Main.java:13: error: <identifier> expected
int[][] cp = new[m][2];
^
1 error
|
s651434881 | p03774 | C++ | #include <cstdio>
#include <cmath>
usin namespace std;
int main() {
int s_x[51], s_y[51], m_x[51], m_y[51], cur_dis;
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) scanf("%d%d", &s_x[i], &s_y[i]);
for (int i = 0; i < m; i++) scanf("%d%d", &m_x[i], &m_y[i]);
for (int i = 0; i < n; i++) {
int update... | a.cc:3:1: error: 'usin' does not name a type
3 | usin namespace std;
| ^~~~
|
s690390964 | p03774 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
int 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;
int k=abs(c[0]-a[i])+abs... | a.cc: In function 'int main()':
a.cc:20:22: error: invalid types 'int[int]' for array subscript
20 | if(k>abs(c[j]-k[i])+abs(d[j]-k[i])){
| ^
a.cc:20:37: error: invalid types 'int[int]' for array subscript
20 | if(k>abs(c[j]-k[i])+abs(d[j]-k[i])){
| ... |
s417704316 | p03774 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>
#define all... | a.cc: In function 'int main()':
a.cc:40:53: error: 'INT_MAX' was not declared in this scope
40 | vector< pair<int, int> > ans(N, pair<int, int>(0, INT_MAX));
| ^~~~~~~
a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by ... |
s883469576 | p03774 | C++ | #include <bits/stdc++.h>
#define INF 1000000007
using namespace std;
int nearest_checkpoint(int , int y, int m, int c[], int d[]) {
int ret = 0, ds = INF;
for (int i = 0; i < m; i++) {
int nds = abs(x - c[i]) + abs(y - d[i]);
if (nds < ds) {
ds = nds;
ret = i + 1;
}
}
return ret;
}
int... | a.cc: In function 'int nearest_checkpoint(int, int, int, int*, int*)':
a.cc:8:19: error: 'x' was not declared in this scope
8 | int nds = abs(x - c[i]) + abs(y - d[i]);
| ^
|
s136500354 | p03774 | C++ | #include <bits/stdc++.h>
#define INF 1000000007
using namespace std;
int nearest_checkpoint(int , int y, int m, int c[], int d[]) {
int ret = 0, ds = INF;
for (int i = 0; i < m; i++) {
nds = abs(x - c[i]) + abs(y - d[i]);
if (nds < ds) {
ds = nds;
ret = i + 1;
}
}
return ret;
}
int mai... | a.cc: In function 'int nearest_checkpoint(int, int, int, int*, int*)':
a.cc:8:5: error: 'nds' was not declared in this scope; did you mean 'ds'?
8 | nds = abs(x - c[i]) + abs(y - d[i]);
| ^~~
| ds
a.cc:8:15: error: 'x' was not declared in this scope
8 | nds = abs(x - c[i]) + abs(y - ... |
s154826507 | p03774 | C++ | #include <bits/stdc++.h>
#define INF 1000000007
using namespace std;
int nearest_checkpoint(int , int y, int m, int c[], int d[]) {
int ret = 0, ds = INF;
for (int i = 0; i < m; i++) {
nds = abs(x - c[i]) + abs(y - d[i]);
if (nds < ds) {
ds = nds;
ret = i;
}
}
return ret;
}
int main() ... | a.cc: In function 'int nearest_checkpoint(int, int, int, int*, int*)':
a.cc:8:5: error: 'nds' was not declared in this scope; did you mean 'ds'?
8 | nds = abs(x - c[i]) + abs(y - d[i]);
| ^~~
| ds
a.cc:8:15: error: 'x' was not declared in this scope
8 | nds = abs(x - c[i]) + abs(y - ... |
s647820605 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, i, j, r, t;
cin >> n >> m;
int a[n][2], b[m][2];
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++){
r = 1000000000;
t = ... | a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before 'for'
16 | t = 0
| ^
| ;
17 | for(j=0; j<m; j++){
| ~~~
a.cc:17:26: error: expected ';' before ')' token
17 | for(j=0; j<m; j++){
| ... |
s745541921 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int N, M;
cin >> N >> M;
vector<pair<int,int>> human(N), check(M);
for(int i = 0; i < N; i++) {
cin >> human.at(i).first >> human.at(i).second;
}
for(int i = 0; i < M; i++) {
cin >> check.at(i).first >> check.at(i).second;
}
long ans, n... | a.cc: In function 'int main()':
a.cc:23:13: error: 'nm' was not declared in this scope; did you mean 'num'?
23 | cout << nm << endl;
| ^~
| num
|
s950440975 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std ;
int main () {
int N , M ;
cin >> N >> M ;
int A[100][2] , B[100][2] ;
for(int i = 0 ; i < N ; i ++ ){
int a , b ;
cin >> a >> b ;
A[i][0] = a ;
A[i][1] = b ;
}
for(int i = 0 ; i < M ; i ++ ){
int a , b ;
cin >> a >> b ;
B[i][0] = a... | a.cc: In function 'int main()':
a.cc:22:16: error: expected initializer before 'pre'
22 | long longt pre = 100000000 ;
| ^~~
a.cc:26:10: error: 'pre' was not declared in this scope; did you mean 'pread'?
26 | if(pre>d[i]) ans = j ;
| ^~~
| pread
|
s095534900 | p03774 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000... | a.cc: In function 'int main()':
a.cc:45:64: error: invalid types 'int[int]' for array subscript
45 | if (d > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
| ^
|
s945892660 | p03774 | C++ | #ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;
typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define p... | a.cc: In function 'int main()':
a.cc:67:25: error: 'j' was not declared in this scope
67 | cout << j + 1 << endl;
| ^
|
s366036553 | p03774 | C++ | include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<vector<long long int>> a(n, vector <long long int>(2));
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 2; j++)
{
cin >> a.at(i).at(j);
}
}
vector<long long int> ap(n);
for... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s310191259 | p03774 | C | #include<stdio.h>
int dif(int a, int b);
int N, M, A, B, C, D, min, i, j;
int MAX = 1073741824;
int main(){
scanf("%d%d", &N, &M);
for(i=0; i<N; i++){
scanf("%d%d", A+i, B+i);
}
for(j=0; j<M; j++){
scanf("%d%d", C+j, D+j);
}
for(i=0; i<N; i++){
min = max;
for(j=0; j<M; j++){
if(dif(A[i... | main.c: In function 'main':
main.c:14:11: error: 'max' undeclared (first use in this function)
14 | min = max;
| ^~~
main.c:14:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:15: error: subscripted value is neither array nor pointer nor vector
... |
s216221887 | p03774 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
int main(){... | a.cc: In function 'int main()':
a.cc:28:25: error: 'INT_MAX' was not declared in this scope
28 | int m = INT_MAX;
| ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
16 | #include <cassert>
+... |
s796869554 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
vector<int> a(N), b(N), c(M), d(M);
for (int i=0; i<N; i++)
cin >> a.at(i) >> b.at(i);
for (int i=0; i<M; i++)
cin >> c.at(i) >> d.at(i);
int minmht = -1, minp=0;
for (int i=0; i<N; i++) {
for (int j=0; j<M; j++) {
if (m... | a.cc: In function 'int main()':
a.cc:14:53: error: 'abc' was not declared in this scope; did you mean 'abs'?
14 | if (minmht==-1 || minmht>abs(a.at(i)-c.at(j))+abc(b.at(i)-d.at(j))) {
| ^~~
| abs... |
s073059150 | p03774 | C++ | #include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
int n, m;
cin >> n >> ... | a.cc: In function 'int main(int, const char**)':
a.cc:30:23: error: 'dis' was not declared in this scope; did you mean 'div'?
30 | min = dis;
| ^~~
| div
|
s894272779 | p03774 | C++ | #include<cmath>
#include<iostream>
using namespace std;
const int MAXN = 51;
int a[MAXN], b[MAXN], c[MAXN], d[MAXN];
inline int dist(int x1, int y1, int x2, int y2) {
return abs(x1-x2) + abs(y1-y2);
}
int main() {
int N, M;
cin >> N >> M;
for (int i = 1; i <= N; i++) {
cin >> a[i] >> b[i];
}
for (int j = 1; j <... | a.cc: In function 'int main()':
a.cc:28:23: error: 'j' was not declared in this scope
28 | cout<<j<<endl;
| ^
|
s770085065 | p03774 | C++ | #include "bits/stdc++.h"
using namespace std;
#define print(s) cout << (s) << endl;
#define sp(x) cout<<setprecision(x);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define all(a) (a).begin(), (a).end()
#define inf 10000000
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
... | a.cc: In function 'int main()':
a.cc:17:28: error: 'j' was not declared in this scope
17 | vector<int> ans(n),tem(j);
| ^
|
s340477497 | p03774 | C++ | #include<iostream>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[nm], b[nm], c[nm], d[nm];
for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
for(int j = 0; j < m; j++) cin >> c[i] >> d[i];
for(int i = 0; i < n; i++){
int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);... | a.cc: In function 'int main()':
a.cc:9:39: error: 'i' was not declared in this scope
9 | for(int j = 0; j < m; j++) cin >> c[i] >> d[i];
| ^
|
s524022088 | p03774 | C++ | #include<iostream>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[nm], b[nm], c[nm], d[nm];
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 minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);... | a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before '}' token
18 | checkpoint = j +1
| ^
| ;
19 | }
| ~
|
s082386422 | p03774 | C++ | #include<iostream>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[nm], b[nm], c[nm], d[nm];
for(int i = 0; i < n; i++) cin >> a >> b;
for(int i = 0; i < m; i++) cin >> c >> d;
for(int i = 0; i < n; i++){
int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
int che... | a.cc: In function 'int main()':
a.cc:8:34: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [50]')
8 | for(int i = 0; i < n; i++) cin >> a >> b;
| ~~~ ^~ ~
| | |
| ... |
s169500294 | p03774 | C++ | #include<iostream>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[nm], b[nm], c[nm], d[nm];
for(int i = 0; i < n; i++) cin >> a >> b;
for(int i = 0; i < m; i++) cin >> c >> d;
for(int i = 0; i < n; i++){
int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
for(int... | a.cc: In function 'int main()':
a.cc:8:34: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [50]')
8 | for(int i = 0; i < n; i++) cin >> a >> b;
| ~~~ ^~ ~
| | |
| ... |
s780666948 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[nm], b[nm], c[nm], d[nm];
for(int i = 0; i < n; i++) cin >> a >> b;
for(int i = 0; i < m; i++) cin >> c >> d;
for(int i = 0; i < n; i++){
int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
fo... | a.cc: In function 'int main()':
a.cc:8:34: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [50]')
8 | for(int i = 0; i < n; i++) cin >> a >> b;
| ~~~ ^~ ~
| | |
| ... |
s531432722 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
int n, m;
int main(){
cin >> n >> m;
const int nm = 50;
int a[], b, c, d;
for(int i = 0; i < n; i++) cin >> a >> b;
for(int i = 0; i < m; i++) cin >> c >> d;
for(int i = 0; i < n; i++){
int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
for(int j = i; j... | a.cc: In function 'int main()':
a.cc:7:7: error: storage size of 'a' isn't known
7 | int a[], b, c, d;
| ^
a.cc:12:30: error: invalid types 'int[int]' for array subscript
12 | int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
| ^
a.cc:12:42: error: invalid typ... |
s163792348 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int 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 mi=1000000000,e;
for(int j=0;j<m;j++){
if(mi>abs(a[i]-c[j])+abs(b[i]-d[... | a.cc: In function 'int main()':
a.cc:16:42: error: expected ')' before '{' token
16 | if(mi>abs(a[i]-c[j])+abs(b[i]-d[i]){
| ~ ^
| )
a.cc:20:10: error: expected primary-expression before '}' token
20 | }
... |
s516952572 | p03774 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
const int INF = 1000000; // 十分大きな値
int n,m,a[60],b[60],c[60],d[60];
int func(int id){
int best = INT_MAX;
int ans = -1;
REP(j,m){
int dist = abs(a[id] -c[j]) ... | a.cc: In function 'int func(int)':
a.cc:10:20: error: 'INT_MAX' was not declared in this scope
10 | int best = 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>
+++ |+#inc... |
s714285689 | p03774 | C | int n,m,i,j,min,tmp,jj;
scanf("%d%d",&n,&m);
int a[n],b[n],c[m],d[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++){
tmp = 10000000;
for(j=0;j<m;... | main.c:3:15: error: expected declaration specifiers or '...' before string constant
3 | scanf("%d%d",&n,&m);
| ^~~~~~
main.c:3:22: error: expected declaration specifiers or '...' before '&' token
3 | scanf("%d%d",&n,&m);
| ^
main.c:3:25: error: expe... |
s584662716 | p03774 | C++ | #include <iostream>
#include <vector>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<int> a(N), b(N);
for (int i = 0; i < N; ++i) {
std::cin >> a[i] >> b[i];
}
std::vector<int> c(M), d(M);
for (int i = 0; i < M; ++i) {
std::cin >> c[i] >> d[i];
}
for (int i = 0; i < N; ++i) {
int... | a.cc: In function 'int main()':
a.cc:20:46: error: invalid types 'int[int]' for array subscript
20 | int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
| ^
|
s975104515 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pii> AB(N), CD(M);
for(int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
AB[i] = {a, b};
}
for(int j = 0; j < M; j++) {
int c, d;
cin >> c >> d;
CD[j] = {c, d};
}
for(int i = 0; i < N; i++... | a.cc: In function 'int main()':
a.cc:8:10: error: 'pii' was not declared in this scope
8 | vector<pii> AB(N), CD(M);
| ^~~
a.cc:8:13: error: template argument 1 is invalid
8 | vector<pii> AB(N), CD(M);
| ^
a.cc:8:13: error: template argument 2 is invalid
a.cc:12:7: error: in... |
s428009863 | p03774 | C++ | #include <iostream>
using namespace std;
int main()
{
long long i, j, k, N, M, a[50], b[50], c[50], d[50], dis, ans[50];
cin >> N; cin >> M;
for (i = 0; i < N; i++) {
cin >> a[i];
cin >> b[i];
}
for (i = 0; i < M; i++) {
cin >> c[i];
cin >> d[i];
}
for (i = 0; i < N; i++) {
long long min = LLONG_MA... | a.cc: In function 'int main()':
a.cc:20:33: error: 'LLONG_MAX' was not declared in this scope
20 | long long min = LLONG_MAX;
| ^~~~~~~~~
a.cc:2:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 |... |
s663230497 | p03774 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a)... | a.cc: In function 'int main()':
a.cc:43:13: error: 'min_num' was not declared in this scope; did you mean 'max_num'?
43 | cout << min_num << endl;
| ^~~~~~~
| max_num
|
s448706445 | p03774 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
using namespace std;
using ll = long long;
int main(int argc, const char * argv[]... | a.cc: In function 'int main(int, const char**)':
a.cc:28:15: error: 'LLONG_MAX' was not declared in this scope
28 | min = LLONG_MAX;
| ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <cmath>
... |
s509564142 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M,i,ans=0,d,a[51],b[51],c[51],d[51];
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];
}
for(int j=0;j<N;j++){
d=100000001;
ans=0;
for(i=0;i<N;i++){
if(d<abs(a[i]-c[i])+abs(b[i]-d[i])){... | a.cc: In function 'int main()':
a.cc:5:39: error: conflicting declaration 'int d [51]'
5 | int N,M,i,ans=0,d,a[51],b[51],c[51],d[51];
| ^
a.cc:5:19: note: previous declaration as 'int d'
5 | int N,M,i,ans=0,d,a[51],b[51],c[51],d[51];
| ^
a.... |
s256996328 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M,i,ans=0,c,a[51],b[51],c[51],d[51];
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];
}
for(int j=0;j<N;j++){
c=100000001;
ans=0;
for(i=0;i<N;i++){
if(c<abs(a[i]-c[i])+abs(b[i]-d[i])){... | a.cc: In function 'int main()':
a.cc:5:33: error: conflicting declaration 'int c [51]'
5 | int N,M,i,ans=0,c,a[51],b[51],c[51],d[51];
| ^
a.cc:5:19: note: previous declaration as 'int c'
5 | int N,M,i,ans=0,c,a[51],b[51],c[51],d[51];
| ^
a.cc:11:... |
s077581243 | p03774 | C++ | #include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#define mod 1000000007
using namespace std;
int main() {
int n, m;
int 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... | a.cc: In function 'int main()':
a.cc:18:27: error: 'INT_MAX' was not declared in this scope
18 | int min = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include "cmath"
... |
s614005335 | p03774 | C++ | #include<bits/stdc++.h>
using namespace std;
using int64 = long long;
const int64 INF = 1LL << 60;
int main() {
int64 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 near = ... | a.cc: In function 'int main()':
a.cc:14:16: warning: overflow in conversion from 'long long int' to 'int' changes value from '1152921504606846976' to '0' [-Woverflow]
14 | int near = INF;
| ^~~
a.cc:16:17: error: no matching function for call to 'min(int&, long long int)'
16 | near ... |
s641538153 | p03774 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <queue>
using namespace std;
#define ll long long
#define kd int
#define fors(i,a,b) for(int i=(a);i<=(b);++i)
inline kd read(){
int x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
wh... | a.cc:23:8: error: ISO C++ forbids declaration of 'min' with no type [-fpermissive]
23 | inline min(int x,int y){
| ^~~
a.cc: In function 'int main()':
a.cc:28:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
28 | register int n,m,a[100001],b[100001],x[1000... |
s011604750 | p03774 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,x; cin>>n>>m;
int a[n][2],b[n],c[n][2];
for(int i=0;i<n;i++){
for(int j=0;j<2;j++){
cin>>a[i][j];
}
}
for(int i=0;i<n;i++){
for(int j=0;j<2;j++){
cin>>c[i][j];
}
}
for(int k=0;k<n;k++){
b[k]=0
for(int l=0;l<n;l++){
x=abs(a[... | a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before 'for'
18 | b[k]=0
| ^
| ;
19 | for(int l=0;l<n;l++){
| ~~~
a.cc:19:29: error: 'l' was not declared in this scope
19 | ... |
s484487975 | p03774 | C++ | #include<iostream>
using namespace std;
int M,N;
int a[60],b[60],c[60],d[60];
int main(){
cin>>N>>M;
int i;
for(i=0;i<N;i++)cin>>a[i]>>b[i];
for(i=0;i<M;i++)cin>>c[i]>>d[i];
for(i=0;i<N;i++)cout<<func[i]<<endl;
return 0;
}
int func(int id){
int best=(1<<29);
int ans=-1;
for (int i=0... | a.cc: In function 'int main()':
a.cc:11:27: error: 'func' was not declared in this scope
11 | for(i=0;i<N;i++)cout<<func[i]<<endl;
| ^~~~
|
s258773069 | p03774 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
int main (void) {
int N,M;
ll ans=0;
ll dis=1000000000;
cin >> N >>M;
ll a[50], b[50],c[50] d[50];
for (ll i=0; i<N; i++) {
... | a.cc: In function 'int main()':
a.cc:16:25: error: expected initializer before 'd'
16 | ll a[50], b[50],c[50] d[50];
| ^
a.cc:22:12: error: 'c' was not declared in this scope
22 | cin >> c[i] >> d[i];
| ^
a.cc:22:20: error: 'd' was not declared in this scope
... |
s172538679 | p03774 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(), M = sc.nextInt();
int[] a = new int[N];
int[] b = new int[N];
int[] c = new int[M];
int[] d = new int[M];
for(int i = 0; i < N... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s279781315 | p03774 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] s = new int[2*N];
int[] c = new int[2*M];
for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
for(... | Main.java:12: error: integer number too large
long min = 99999999999;
^
1 error
|
s000571718 | p03774 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] s = new int[2*N];
int[] c = new int[2*M];
for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
for(... | Main.java:12: error: integer number too large
double min = 99999999999;
^
1 error
|
s124569057 | p03774 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] s = new int[2*N];
int[] c = new int[2*M];
for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
for(... | Main.java:12: error: integer number too large
int min = 99999999999;
^
1 error
|
s928900799 | p03774 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] s = new int[2*N];
int[] c = new int[2*M];
for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
for(... | Main.java:12: error: method pow in class Math cannot be applied to given types;
int min = Math.pow(2.50);
^
required: double,double
found: double
reason: actual and formal argument lists differ in length
1 error
|
s698371843 | p03774 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
int 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 min_dist=abs(a[i]-c[0])+abs(b[i]-d[0]);
for(int j=1; j<M; j++){
int cur_... | a.cc: In function 'int main()':
a.cc:20:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
20 | ans=j;
| ^~~
| abs
a.cc:23:25: error: 'ans' was not declared in this scope; did you mean 'abs'?... |
s648732754 | p03774 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
int 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 x=0, a;
for(int j=0; j<M; j++){
int l=abs(a[i]-c[j]... | a.cc: In function 'int main()':
a.cc:18:36: error: invalid types 'int[int]' for array subscript
18 | int l=abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^
|
s236716487 | p03774 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
int 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 x=0, a;
for(int j=0; j<M; j++){
int l;
l=abs(a[i]-c[j])+abs(b[i]-d[j]... | a.cc: In function 'int main()':
a.cc:18:32: error: invalid types 'int[int]' for array subscript
18 | l=abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^
|
s226614095 | p03774 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
int 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 x=0, a;
for(int j=0; j<M; j++){
int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
... | a.cc: In function 'int main()':
a.cc:17:38: error: invalid types 'int[int]' for array subscript
17 | int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^
|
s587537730 | p03774 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
int 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 x=0, a;
for(int j=0; j<M; j++){
int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
... | a.cc: In function 'int main()':
a.cc:17:38: error: invalid types 'int[int]' for array subscript
17 | int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^
a.cc:23:25: error: 'j' was not declared in this scope
23 | cout << j << endl;
| ... |
s520405930 | p03774 | C++ | #include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;
#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
#define INF 1000000000
#defi... | a.cc: In function 'void solve()':
a.cc:39:63: error: request for member 'first' in 'students', which is of non-class type 'P [50]' {aka 'std::pair<long long int, long long int> [50]'}
39 | if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
| ... |
s457314893 | p03774 | C++ | #include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;
#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
#define INF 1000000000
type... | a.cc: In function 'void solve()':
a.cc:39:63: error: request for member 'first' in 'students', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
39 | if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
| ... |
s248993113 | p03774 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
long long i,j,n,m;
cin >> n >> m;
for(i=0;i<n;i++)cin >> a[i] >> b[i];
for(i=0;i<n;i++)cin >> c[i] >> d[i];
for(i=0;i<n;i++){
long long ret = 1e16;
long long ans = -1;
for(j=0;j<m;i++){
if(ret>(abs(a[i]-c[i])+abs(b[i]... | a.cc: In function 'int main()':
a.cc:8:26: error: 'a' was not declared in this scope
8 | for(i=0;i<n;i++)cin >> a[i] >> b[i];
| ^
a.cc:8:34: error: 'b' was not declared in this scope
8 | for(i=0;i<n;i++)cin >> a[i] >> b[i];
| ^
a.cc:9:26:... |
s704504733 | p03774 | C++ | #include <bits/stdc++.h>
//#include <math.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(... | a.cc: In function 'int main()':
a.cc:43:53: error: invalid types 'int[int]' for array subscript
43 | if(abs(a[i]-c[j])+abs(b[i]-d[j])<d) pos=j+1,d=abs(a[i]-c[j])+abs(b[i]-d[j]);
| ^
a.cc:43:96: error: invalid types 'int[int]' for array... |
s636091074 | p03774 | C++ | #include <iostream>
#include <cmath>
using namespace std;
#define Rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
int ans=1;
int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
Rep(m,M){
if(abs(a[n]-c[m])... | a.cc: In function 'int main()':
a.cc:21:11: error: expected ';' before '}' token
21 | ans=m+1
| ^
| ;
22 | }
| ~
|
s735853088 | p03774 | C++ | #include <iostream>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
int ans=1;
int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
Rep(m,M){
if(abs(a[n]-c[m])... | a.cc: In function 'int main()':
a.cc:13:5: error: 'i' was not declared in this scope
13 | Rep(i,N)cin>>a[i]>>b[i];
| ^
a.cc:13:1: error: 'Rep' was not declared in this scope; did you mean 'rep'?
13 | Rep(i,N)cin>>a[i]>>b[i];
| ^~~
| rep
a.cc:15:5: error: 'n' was not declared in this scope
... |
s148567792 | p03774 | C++ | #include <iostream>
#include <math>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
int ans=1;
int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
Rep(m,M){
if(abs(a[n]-c[m])+... | a.cc:2:10: fatal error: math: No such file or directory
2 | #include <math>
| ^~~~~~
compilation terminated.
|
s431758934 | 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;
fo... | 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]) ) ) {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.