submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s246006017 | p00507 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
int i,j;
int count=0;
int n;
int a[100000];
int tmp;
int b[200000];
char buffer[2][100000];
scanf("%d", &n);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<n-1;i++){
for(j=i+1;j<n;j++){
... | main.c: In function 'main':
main.c:28:13: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
28 | itoa(a[i], buffer[0], 10);
| ^~~~
|
s290897008 | p00507 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
char *itoa( int val, char *a, int radix )
{
char *p = a;
unsigned int v = val;
int n = 1;
while(v >= radix){
v /= radix;
n++;
}
p = a + n;
v = val;
*p = '\0';
do {
--p;
*p = v % radix + '0';
if(*p > '9') {
*p = v % radix - 10 + 'A';
}
... | main.c:28:5: error: conflicting types for 'atoi'; have 'int(char *)'
28 | int atoi(char *str) {
| ^~~~
In file included from main.c:3:
/usr/include/stdlib.h:105:12: note: previous declaration of 'atoi' with type 'int(const char *)'
105 | extern int atoi (const char *__nptr)
| ^~~~
|
s744380510 | p00507 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int connect(int l, int r){
char ll[42], rr[22];
sprintf(ll, "%d", l), sprintf(rr, "%d", r);
strcat(ll, rr);
return atoi(ll);
}
int main(){
int n;
cin >> n;
vector <int>... | a.cc: In function 'int connect(int, int)':
a.cc:11:5: error: 'strcat' was not declared in this scope
11 | strcat(ll, rr);
| ^~~~~~
a.cc:6:1: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#include <cstring>
... |
s603875379 | p00507 | C++ | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n; scanf("%d", &n);
vector<string> S(n);
vector<int> d(6);
for (int i = 0; i < n; i++)
{
cin >> S[i];
d[S[i].size()]++;
}
bool same = true;
for (int i = 0; i < n; i++)
{
for (int j =... | a.cc: In function 'int main()':
a.cc:61:62: error: expected ';' before ')' token
61 | printf("%s\n", (S[1] + S[0]).c_str()));
| ^
| ;
|
s164467969 | p00507 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_... | a.cc: In function 'int main()':
a.cc:22:44: error: 'struct std::pair<const int, std::vector<int> >' has no member named 'resize'
22 | if (m.second.size() >= 4)m.resize(3);
| ^~~~~~
|
s519786618 | p00507 | C++ | import sys
inputs = sys.stdin.readlines()
datum = []
for i, x in enumerate(inputs[1:]):
for y in inputs[i+2:]:
if y!='\n':
datum.append(int('{}{}'.format(x.strip(), y.strip())))
datum.append(int('{}{}'.format(y.strip(), x.strip())))
print(sorted(datum)[2])
| a.cc:9:30: warning: multi-character character constant [-Wmultichar]
9 | datum.append(int('{}{}'.format(x.strip(), y.strip())))
| ^~~~~~
a.cc:10:30: warning: multi-character character constant [-Wmultichar]
10 | datum.append(int('{}{}'.format(y.strip(), ... |
s491260091 | p00507 | C++ | #include <iostream>
#include <queue>
#include <sstream>
#include <vector>
using namespace std;
int next_combination(int cur)
{
int r1 = cur & -cur; // extracts the rightmost 1
int moved1 =
cur + r1; // cancel the rightmost run of 1s and put 1 on its left
int rm1s = cur & ~moved1; // extracts the r... | a.cc: In function 'int main()':
a.cc:48:13: error: 'reverse' was not declared in this scope
48 | reverse(begin(t), end(t));
| ^~~~~~~
|
s454397523 | p00507 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<string> A(n);
REP(i, n) cin >> A[i];
sort(A.begin(), A.end())
vector<int> B;
REP(i, n){
REP(j, n){
... | a.cc: In function 'int main()':
a.cc:13:29: error: expected ';' before 'vector'
13 | sort(A.begin(), A.end())
| ^
| ;
14 |
15 | vector<int> B;
| ~~~~~~
a.cc:20:13: error: 'B' was not declared in this scope... |
s218354953 | p00507 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <lim... | a.cc: In function 'int main()':
a.cc:39:22: error: 'itos' was not declared in this scope
39 | string s = itos(a[i]);
| ^~~~
|
s565094609 | p00507 | C++ | nclude<iostream>
#include<vector>
#include<sstream>
#include<algorithm>
#include<cstdlib>
using namespace std;
bool cmp(const string& a,const string b)
{
if(a.size() != b.size())
return a.size() < b.size();
if(a != b)
return (atoi)(a.c_str()) < (atoi)(b.c_str());
return false;
}
int main()
{
int n;
... | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude<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_cxx... |
s030056039 | p00507 | C++ | #include<iostream>
#include<set>
using namespace std;
int main()
{
int n,t;
set<int> list;
set<int>::iterator it;
cin>>n;
for(int i=0; i<n; i++) cin>>a, list.insert(a);
it = list.begin();
if(n==3) cout<<*(it+1)<<*it<<endl;
else cout<<*it<<*(it+2)<<endl;
} | a.cc: In function 'int main()':
a.cc:10:33: error: 'a' was not declared in this scope
10 | for(int i=0; i<n; i++) cin>>a, list.insert(a);
| ^
a.cc:12:24: error: no match for 'operator+' (operand types are 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity... |
s397945624 | p00507 | C++ | include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
int n,a[10000],c;
cin >> n;
for(int i=0;i<n;i++) cin >> a[i];
sort(a,a+n);
cout << a[1] << a[0] << endl;
} | 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/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g... |
s736419901 | p00508 | Java | #include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
int N;
P A[500000];
bool compare_y(P a, P b) {
return a.second < b.second;
}
int closest_pair(P *a ,int n) {
if(n <= 1) return 2 << 27;
int m = n /2;
int x = a[m].first... | Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <vector>
^
Main.java:3: error: illegal character: '#'
#include <math.h>
^
Main.java:4: error: illegal character: '#'
#include <stdio.h>
^
Main.java:5: error: illegal character: '#'
#include <algorithm>
^... |
s211265943 | p00508 | C | x[99999],y[99999];main(n,i,j,m,z){scanf("%d",&n);else if(n==500000)puts("529");else{for(i=0;i<n;i++)scanf("%d%d",x+i,y+i);m=999999;for(i=0;i<n;i++)for(j=i+1;j<n;j++)if(m>(z=(x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i])))m=z;printf("%d\n",m);}exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | x[99999],y[99999];main(n,i,j,m,z){scanf("%d",&n);else if(n==500000)puts("529");else{for(i=0;i<n;i++)scanf("%d%d",x+i,y+i);m=999999;for(i=0;i<n;i++)for(j=i+1;j<n;j++)if(m>(z=(x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i])))m=z;printf("%d\n",m);}ex... |
s630713406 | p00508 | C | #include <cstdio>
int n,i,j,m,z,x[99999],y[99999];main(){scanf("%d",&n);if(n==500000)puts("529");else{for(i=0;i<n;i++)scanf("%d%d",x+i,y+i);m=999999;for(i=0;i<n;i++)for(j=i+1;j<n;j++)if(m>(z=(x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i])))m=z;printf("%d\n",m);}} | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s957476826 | p00508 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
enum
{
x,
y,
};
int main()
{
int n;
cin >> n;
int d2 = 800000001;
int tmp;
vector< vector<int> > a(n, vector<int>(2));
for (int i = 0; i < n; i++)
{
cin >> a[i][x] >> a[i][y];
}
for (int i = 0; i < n; i++)
{
for (int j = ... | a.cc: In function 'int main()':
a.cc:28:31: error: 'pow' was not declared in this scope
28 | tmp = pow(a[j][x] - a[i][x], 2) + pow(a[j][y] - a[i][y], 2);
| ^~~
|
s656090698 | p00508 | C++ | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
typedef pair<int,int> P;
int N;
P A[500000];
bool compare_y(P a, P b) {
return a.second < b.second;
}
int closest_pair(P *a ,int n) {
if(n <= 1) return 2 << 27;
int m = n /2;
int x = a[m].first;
int d = min(closest_pair(a,m),closest... | a.cc: In function 'int closest_pair(P*, int)':
a.cc:17:3: error: 'inplace_merge' was not declared in this scope
17 | inplace_merge(a, a + m, a + n, compare_y);
| ^~~~~~~~~~~~~
a.cc: In function 'void solve()':
a.cc:34:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
34 | sort(A,A ... |
s981072371 | p00508 | C++ | /**
* @brief 最近点対の発見について扱います
* @note 関連URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585
* @date 2016/03/22
*/
//****************************************
// 必要なヘッダファイルのインクルード
//****************************************
#include <vector>
#include <algorithm>
#include <cmath>
#include <iostrea... | a.cc:34:25: error: 'int32_t' in namespace 'std' does not name a type
34 | using index_t = std::int32_t;
| ^~~~~~~
a.cc:35:32: error: 'index_t' was not declared in this scope
35 | using indices_t = std::vector<index_t>;
| ^~~~~~~
a.cc:35:39: er... |
s899305674 | p00508 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, bx, by; pair<int, int> p[100009];
int main() {
scanf("%d", &n);
int sq = 7, cq = 24;
for(int i = 0; i < n; i++) {
scanf("%d%d", &bx, &by);
int ex = bx * cq - by * sq;
int ey = bx * sq + by * cq;
p[i] = make_pair(ex, ey);
}
sort(p, p + n);
long long ret ... | a.cc: In function 'int main()':
a.cc:24:24: error: 'dist' was not declared in this scope
24 | printf("%d\n", dist / 25);
| ^~~~
|
s265061406 | p00508 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int,int>> coo(n);
double res=1e15;
for(int i=0;i<n;i++) cin>>coo[i].first>>coo[i].second;
random_device rnd;
for(int i=0;i<1e8;i++){
x=rnd()%n;
y=rnd()%n;
if(x!=y) res=min(sqrt((coo[x].first-coo[y].first)*(coo[x].first-coo... | a.cc: In function 'int main()':
a.cc:12:17: error: 'x' was not declared in this scope
12 | x=rnd()%n;
| ^
a.cc:13:17: error: 'y' was not declared in this scope
13 | y=rnd()%n;
| ^
|
s014000716 | p00508 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
uint64_t dist(int x1, int x2, int y1, int y2) {
return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
int main() {
int n;
cin >> n;
uint64_t out;
int **arr = new int *[n];
for (int i = 0; i < n; i++) {
arr[i] = new int[2];
}
for (int ... | a.cc:5:1: error: 'uint64_t' does not name a type
5 | uint64_t dist(int x1, int x2, int y1, int y2) {
| ^~~~~~~~
a.cc:3:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
2 | #include <iostream>
+++ |+#include <cstdint>
3 | using namespace st... |
s064415856 | p00508 | C++ | #include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <vector>
using namespace std;
int dist(const vector<int> v1, const vector<int> v2) {
return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
}
void print_v(vector<vector<int> > v) {
for (auto&& var : v) {
... | a.cc: In function 'int brute(std::vector<std::vector<int> >)':
a.cc:22:13: error: 'INT_MAX' was not declared in this scope
22 | 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 <vector... |
s260684987 | p00508 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
// #include <iostream>
#include <iterator>
#include <numeric>
#include <vector>
using namespace std;
struct Point {
int x, y;
};
int closest(vector<Point>::iterator begin, vector<Point>::iterator end);
int strip_closest(const vector<Point> v... | a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope
21 | cin >> n;
| ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
8 | #include <vector>
+++ |+#include <iostream>
9 | using namespace st... |
s051379486 | p00508 | C++ | // AOJ 585 Nearest Two Points
// 2017.9.24 bal4u
// 2018.3.17
// 2018.5.3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct { int x, y; } PP;
#define INF 0x10101010
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
int n = 0, c = gc();
if (c == '-') { c ... | a.cc: In function 'int main()':
a.cc:90:33: error: invalid conversion from 'int (*)(PP*, PP*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
90 | qsort(p, n, sizeof(PP), cmp);
| ^~~
| |
| ... |
s085709362 | p00508 | C++ | // AOJ 585 Nearest Two Points
// 2017.9.24 bal4u
// 2018.3.17
// 2018.5.3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct { int x, y; } PP;
#define INF 0x10101010
#if 0
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
int n = 0, c = gc();
if (c == '-') { c ... | a.cc: In function 'int cmp(const void*, const void*)':
a.cc:34:24: error: invalid conversion from 'const void*' to 'const PP*' [-fpermissive]
34 | const PP *aa = a, *bb = b;
| ^
| |
| const void*
a.cc:34:33: error: invalid... |
s315415140 | p00508 | C++ | #include <Eigen/Core>
#include <Eigen/Geometry>
int main() {
return 0;
}
| a.cc:1:10: fatal error: Eigen/Core: No such file or directory
1 | #include <Eigen/Core>
| ^~~~~~~~~~~~
compilation terminated.
|
s318746059 | p00508 | C++ | #include <Eigen/Core>
#include <Eigen/Geometry>
int main() {
return 0;
}
| a.cc:1:10: fatal error: Eigen/Core: No such file or directory
1 | #include <Eigen/Core>
| ^~~~~~~~~~~~
compilation terminated.
|
s818182579 | p00508 | C++ | // #include <Eigen/Core>
// #include <Eigen/Geometry>
#include "boost/numpy.hpp"
int main() {
return 0;
}
| a.cc:3:10: fatal error: boost/numpy.hpp: No such file or directory
3 | #include "boost/numpy.hpp"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s210363899 | p00508 | C++ | #include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
template <typename T>
class Region {
private:
std::vector<std::complex<T>> points;
T d_min;
public:
T getDist() {
return d_min;
}
void setDist(T dist) {
t... | a.cc: In member function 'Region<T> Region<T>::operator+(Region<T>&)':
a.cc:38:31: error: '__INT_MIN__' was not declared in this scope
38 | T left_boundary = __INT_MIN__;
| ^~~~~~~~~~~
|
s412991953 | p00508 | C++ | #include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
template <typename T>
class Region {
private:
std::vector<std::complex<T>> points;
T d_min;
public:
T getDist() {
return d_min;
}
void setDist(T dist) {
t... | a.cc: In member function 'Region<T> Region<T>::operator+(Region<T>&)':
a.cc:38:31: error: '__INT_' was not declared in this scope
38 | T left_boundary = __INT_;
| ^~~~~~
|
s914081998 | p00508 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int n,x,y,l[20100],r[20100];
const int lim = 10000;
for(int i=0;i<=20000;i++){
l[i] = lim+1; r[i] = -lim-1;
}
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d",&x,&y);
l[x+lim] = min(l[x+lim],y); r[x+lim] = max(r[x+lim],... | a.cc: In function 'int main()':
a.cc:26:16: error: no matching function for call to 'min(long long int&, int)'
26 | ans = min(ans,(r[i]-l[j])*(r[i]-l[j]) + (j-i)*(j-i));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
f... |
s880242826 | p00508 | C++ | #include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
#include <set>
using namespace std;
template<typename T>
inline T dbl(T x){ return x * x; }
int main(){
const int n = getInt();
vector<pair<int, int> > ... | a.cc: In function 'int main()':
a.cc:25:13: error: 'numeric_limits' was not declared in this scope
25 | int ans = numeric_limits<int>::max();
| ^~~~~~~~~~~~~~
a.cc:25:28: error: expected primary-expression before 'int'
25 | int ans = numeric_limits<int>::max();
| ... |
s425025442 | p00508 | C++ | #include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
#include <set>
using namespace std;
template<typename T>
inline T dbl(T x){ return x * x; }
int main(){
const int n = getInt();
vector<pair<int, int> > ... | a.cc: In function 'int main()':
a.cc:25:13: error: 'numeric_limits' was not declared in this scope
25 | int ans = numeric_limits<int>::max();
| ^~~~~~~~~~~~~~
a.cc:25:28: error: expected primary-expression before 'int'
25 | int ans = numeric_limits<int>::max();
| ... |
s338977012 | p00508 | C++ | #include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int x[500000];
int y[500000];
vector<int>bag[201][201];
int dx[]={1,1,1,0,0,0,-1,-1,-1};
int dy[]={1,0,-1,1,0,-1,1,0,-1};
int main(){
int a;
scanf("%d",&a);
vector<P>v;
for(int i=0;i<a;i++){
scanf("%d%d",x+i,y+i);
x[i]+=10000;
y[i]+=1... | a.cc: In function 'int main()':
a.cc:13:16: error: 'P' was not declared in this scope
13 | vector<P>v;
| ^
a.cc:13:17: error: template argument 1 is invalid
13 | vector<P>v;
| ^
a.cc:13:17: error: template argument 2 is invalid
|
s690486510 | p00509 | C | z
| main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | z
| ^
|
s886931148 | p00509 | C++ | #include <string>
#include <iostream>
using namespace std;
bool is_prime(long long n, long long k)
{
if (n < k * k) { return true; }
if (n % k == 0) { return false; }
return is_prime(n, k + 1);
}
string solve(int n, int k)
{
if (k < 0)
{
if (n == 1)
{
return "11";
}
else
{
return string(2 * n,... | a.cc: In function 'std::string solve(int, int)':
a.cc:33:57: error: 'reverse' was not declared in this scope
33 | string T = to_string(i) + to_string(k); reverse(S.begin(), S.end());
| ^~~~~~~
|
s209979438 | p00509 | C++ | #include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int n, m;
long long int ans;
char x[16];
bool prime(long long int x)
{
for (long long int i = 2; i * i <= x; i++){
if (x % i == 0) return (false);
}
return (x != 1);
}
void dfs(int idx)
{
if (idx == n){
if (prime(atoll(x)) ans = ... | a.cc: In function 'void dfs(int)':
a.cc:22:36: error: expected ';' before 'ans'
22 | if (prime(atoll(x)) ans = max(ans, atoll(x));
| ^~~~
| ;
a.cc:23:17: error: expected primary-expression before 'return'
23 | ... |
s172286057 | p00510 | Java |
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int car = in.nextInt();
int max = 0;
for (int i = 0; i < n; i++) {
car += in.nextInt();
max = Math.max(max, car);
car -= in.nextInt();
if (car < 0) {
car = 0;
break;
... | Main.java:4: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s249879866 | p00510 | C | #include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
}
if(I==a){
printf("%d?\n",b);
}
}
return 0;
} | main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scans("%d%d",&a,&b);
| ^~~~~
| scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
5 | for(int I=a;i>=a;i++){
| ^
m... |
s940594611 | p00510 | C | #include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
}
if(i==a){
printf("%d?\n",b);
}
}
return 0;
} | main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scans("%d%d",&a,&b);
| ^~~~~
| scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
5 | for(int I=a;i>=a;i++){
| ^
m... |
s599069337 | p00510 | C | #include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
if(i==a){
printf("%d?\n",b);
}
}
return 0;
} | main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scans("%d%d",&a,&b);
| ^~~~~
| scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
5 | for(int I=a;i>=a;i++){
| ^
m... |
s527594149 | p00510 | C | #include<stdio.h>
int main()
{
int i,s,a,b,m;
scanf("%d%d",&i,&s);
for(m=s;i>=0;i--)
{
if(~scanf("%d%d",&a,&b))
{
s+=a-b;
if(s<0)
{
m=0;
break;
}
if(s>m)
m=s;
}
}
printf("%d\n",m);
return 0;
} | main.c: In function 'main':
main.c:21:1: error: stray '\343' in program
21 | <U+3000><U+3000><U+3000><U+3000> return 0;
| ^~~~~~~~
main.c:21:3: error: stray '\343' in program
21 | <U+3000><U+3000><U+3000><U+3000> return 0;
| ^~~~~~~~
main.c:21:5: error: stray '\343' in program
21 | <U+3000>... |
s161294605 | p00510 | C | #include<stdio.h>
int main()
{
int i,s,a,b,m;
scanf("%d%d",&i,&s);
for(m=s;i>0;i--)
{
scanf("%d%d",&a,&b);
s+=a-b;
if(s<0)
{
m=0;
break;
}
if(s>m)
m=s;
}
printf("%d\n",m);
return 0;
}
#include<stdio.h>
int main()
{
int i,s,a,b,m;
scanf("%d%d",&i,&s);
for(m=s;i>0;i--)
{
scanf("%d%d",&a,... | main.c:22:5: error: redefinition of 'main'
22 | int main()
| ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int()'
2 | int main()
| ^~~~
|
s106699154 | p00510 | C++ | #include <cstdio>
#include <stack>
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main(){
int n,a,b,count=0;
scanf("%d%d",&n,&count);
for(int i=0;i<n;i++){
scanf("%d%d",&a,&b);
count+=a-b;
if(count<0){
puts("0")... | a.cc: In function 'int main()':
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
24 | ans=max(ans,count);
| ^~~
| abs
a.cc:27:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
27 | printf("%d\n",ans);
| ^... |
s984866692 | p00510 | C++ | n, m, err = gets.to_i, gets.to_i, false
s = m
n.times do
in_car, out_car = gets.split.map(&:to_i)
m += in_car - out_car
if m < 0
err = true
else
s = [s, m].max
end
end
puts err ? 0 : s | a.cc:1:1: error: 'n' does not name a type
1 | n, m, err = gets.to_i, gets.to_i, false
| ^
|
s040085705 | p00510 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(void){
int n,cnt,in,out,mx;
cin >> n >> cnt;
mx=cnt;
while(n--){
cin >> in >> out;
cnt+=in-out;
mx=max(mx,cnt);
if(cnt<0){
cout << 0 << endl;
return;
}
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
19 | return;
| ^~~~~~
|
s044652238 | p00510 | C++ | #include<stdio.h>
int main(void)
{
int n,m;
int ir[100],de[100];
int max;
int i;
max=0;
scanf("%d",&n);
scanf("%d",&m);
max+=m;
for(i=0;i<n;i++){
scanf("%d %d",&ir[i],&de[i]);
m+=ir[i];
m-=de[i];
if(max<m){
max=m;
}
}
printf("0");
if(flg=0){
... | a.cc: In function 'int main()':
a.cc:21:60: error: 'flg' was not declared in this scope
21 | if(flg=0){
| ^~~
|
s319833366 | p00510 | C++ | #include <stdio.h>
int main(){
int con,i,n,m,I[100],D[100];
scanf("%d",&n);
scanf("%d",&m);
for(i=0;i<n;i++)scanf("%d %d",&I[i],&D[i]);
con = m+I[0]-D[0];
if(con<0)goto fail;
max=con;
for(i=1;i<n;i++){
con = con+I[i]-D[i];
if(max<con)max=con;
}
fail:;
printf("%d\n",(con<0?0:max));
return 0;
} | a.cc: In function 'int main()':
a.cc:15:1: error: 'max' was not declared in this scope
15 | max=con;
| ^~~
|
s250171814 | p00510 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
int main(){
  int n,m;
  bool judge = true;
  stack<bool> st;
  cin >> n;
  cin >> m;
  for(int i=0;i<m;i++) st.push(1);
  int a,b,ma = m;
  for(int i=0;i<n;i++){
&... | a.cc:6:2: error: stray '#' in program
6 |   int n,m;
| ^
a.cc:6:8: error: stray '#' in program
6 |   int n,m;
| ^
a.cc:7:2: error: stray '#' in program
7 |   bool judge = true;
| ^
a.cc:7:8: error: stray '#' in program
7 |   bool judge =... |
s136706036 | p00511 | C | #include <stdio.h>
#include <math.h>
int main(){
int ans, a;
char x[1];
scanf("%d", &ans);
while("%1s", &x[0]) != '='){
if(x[0] == '=') break;
scanf("%d", &a);
if(x[0] == '+') ans += a;
if(x[0] == '-') ans -= a;
if(x[0] == '*') ans *= a;
if(x[0] == '/') ans /= a;
}
printf("%d\n", ans);
return 0;
} | main.c: In function 'main':
main.c:8:29: error: expected expression before '!=' token
8 | while("%1s", &x[0]) != '='){
| ^~
main.c:8:35: error: expected statement before ')' token
8 | while("%1s", &x[0]) != '='){
| ^
main.... |
s469766013 | p00511 | C | #include <stdio.h>
#include <math.h>
int main(){
int ans, a;
char x[1];
scanf("%d", &ans);
while("%s", &x) != '='){
if(x[0] == '=') break;
scanf("%d", &a);
if(x[0] == '+') ans += a;
if(x[0] == '-') ans -= a;
if(x[0] == '*') ans *= a;
if(x[0] == '/') ans /= a;
}
printf("%d\n", ans);
return 0;
} | main.c: In function 'main':
main.c:8:25: error: expected expression before '!=' token
8 | while("%s", &x) != '='){
| ^~
main.c:8:31: error: expected statement before ')' token
8 | while("%s", &x) != '='){
| ^
main.c:9:33: error: b... |
s891736146 | p00511 | C | #include <iostream>
using namespace std;
int main(void){
char c;
int b,ans;
cin >> ans;
while(true){
cin >> c;
if(c == '=') break;
cin >> b;
switch(c){
case '+':
ans += b;
break;
case ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s324427005 | p00511 | C++ | #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
int a;
scanf("%d",&a);
string ss;
int x;
while(true){
cin >> ss;
if(ss=="=")break;
cin >> x;
if(ss=='+')a+=x;
if(ss=='-')a-=x;
if(ss=='*')a*=x;
if(ss=='/')a/=x;
}
printf("%d\n",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:15:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | if(ss=='+')a+=x;
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In fi... |
s930241592 | p00511 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
#include <vector>
using namespace std;
int main(){
int x;
int a=0;
string G;
cin>>x;
a=x;
while(1){
cin>>G;
if(G=="=")break;
cin>>x;
ifG=="+")a+=x;
ifG=="-")a-=x;
ifG=="/")a/=x;
ifG=="*")a*=x;
}
cout<<a<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:1: error: 'ifG' was not declared in this scope
22 | ifG=="+")a+=x;
| ^~~
|
s610400147 | p00511 | C++ | import std.stdio;
import std.string;
import std.conv;
import std.array;
void main() {
string s;
string op = "+";
int res = 0;
while(1) {
s = readln();
int a = to!int(chomp(s));
if(op[0] == '+')
res += a;
else if(op[0] == '-')
res -= a;
else if(op[0] == '*')
res *= a;
else
res /= a;
op =... | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.string;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: e... |
s275741228 | p00511 | C++ | #include <stdio.h>
int main(){
int a,b;
char s[10];
scanf("%d",&a);
while(1){
scanf("%s",s);
if ( strcmp(s, "=") == 0 )break;
scanf("%d",&b);
if ( strcmp(s, "+") == 0 ) a+=b;
if ( strcmp(s, "-") == 0 ) a-=b;
if ( strcmp(s, "*") == 0 ) a*=b;
if ( strcmp(s, "/") == 0 ) a/=b;
}
... | a.cc: In function 'int main()':
a.cc:9:10: error: 'strcmp' was not declared in this scope
9 | if ( strcmp(s, "=") == 0 )break;
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <c... |
s245619047 | p00511 | C++ | #include <stdio.h>
int main(){
int a,b;
char s[10];
scanf("%d",&a);
while(1){
scanf("%s",&s);
if ( strcmp(s, "=") == 0 )break;
scanf("%d",&b);
if ( strcmp(s, "+") == 0 ) a+=b;
if ( strcmp(s, "-") == 0 ) a-=b;
if ( strcmp(s, "*") == 0 ) a*=b;
if ( strcmp(s, "/") == 0 ) a/=b;
}
... | a.cc: In function 'int main()':
a.cc:9:10: error: 'strcmp' was not declared in this scope
9 | if ( strcmp(s, "=") == 0 )break;
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <c... |
s724674782 | p00511 | C++ | #include<stdio.h>
int main(void)
{
int a,b;
char *c;
scanf("%d",&a);
while(1){
scanf("%c",&c);
if(c=='=')break;
scanf("%d",&b);
if(c=='+'){a=a+b;}
else if(c=='-'){a=a-b;}
else if(c=='*'){a=a*b;}
else if(c=='/'){a=a/b;}
}
printf("%d\n",a);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(c=='=')break;
| ~^~~~~
a.cc:11:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(c=='+'){a=a+b;}
| ~^~~~~
a.cc:12:1... |
s421433805 | p00511 | C++ | import sys
def line():return sys.stdin.readline().strip()
e=""
ans=0
while True:
try:
temp = line()
if temp=="/":
e+="//"
elif temp=="*":
e+="*"
elif temp=="+":
e+="+"
elif temp=="-":
e+="-"
elif temp=="=":
... | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s028565670 | p00511 | C++ | #include <iostream>
using namespace std;
int main(){
int ans;
cin >> ans;
char s [10];
int n = 0;
while (true){
cin >> s;
if (s[0] == "="){ break; }
else if (s[0] == "+"){
ans += n;
}
else if (s[0] == "-"){
ans -= n;
}
else if (s[0] == "*"){
ans *= n;
}
else if (s[0] == "/"){
ans /= n... | a.cc: In function 'int main()':
a.cc:10:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (s[0] == "="){ break; }
| ~~~~~^~~~~~
a.cc:11:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | ... |
s410884667 | p00511 | C++ | #include <iostream>
using namespace std;
int main(){
int ans;
cin >> ans;
char *s = "a";
int n = 0;
ans = n;
while (true){
scanf_s("%c", &s);
if (s == "="){ break; }
else if (s == "+"){
cin >> n;
ans += n;
}
else if (s == "-"){
cin >> n;
ans -= n;
}
else if (s == "*"){
cin >> n;
an... | a.cc: In function 'int main()':
a.cc:6:19: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
6 | char *s = "a";
| ^~~
a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | scanf_s("%c", &s);
|... |
s569421559 | p00511 | C++ | #include<iostream>
using namespace std;
int main(){
int a;
char b;
int c;
for(int i=0;i<10;i++){
cin>>a>>b;
if (b=="="){
break;
}
else if(b=="+");{
c+=a;
}
else if(b=="-");{
c-=a;
}
else if(b=="*");{
c*=a;
}
else if(b=="/");{
c/=a;
}
}
cout<<c<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (b=="="){
| ~^~~~~
a.cc:12:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | else if(b=="+")... |
s377909150 | p00511 | C++ | #include<iostream>
using namespace std;
int main(){
int a;
char b;
int ans;
while(true){
cin>>b;
cin>>a;
if (b=="="){cout<<ans<<endl;}
else if(b=="+");{ans+=a;}
else if(b=="-");{ans-=a;}
else if(b=="*");{c*=a;}
else(b=="/");{ans/=a;}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (b=="="){cout<<ans<<endl;}
| ~^~~~~
a.cc:11:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | ... |
s531358787 | p00511 | C++ | using namespace std;
int main(){
int a=0;
string b;
cin>>a;
while(1){
cin>>b;
if(b=="=") break;
int x;
cin>>x;
if(b=="+") a+=x;
else if(b=="-") a-=x;
else if(b=="/") a/=x;
else if(b=="*") a*=x;
}
cout<<a<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
4 | string b;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:5:3: error: 'cin... |
s969799653 | p00511 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int num1,num2,ans;
for(string mark;mark==¨=¨;){
cin>>num1;
cin>>mark;
cin>>num2;
ans=num1,mark,num2;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:23: error: '\U000000a8' was not declared in this scope
10 | for(string mark;mark==¨=¨;){
| ^
|
s735284993 | p00511 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int num1,num2,ans;
string mark1,mark2;
while(1){
cin>>num1;
cin>>mark1;
cin>>num2;
cin>>mark2;
if(mark2 == ¨=¨)break;
ans=ans,mark2,num1,mark1,num2;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:13: error: '\U000000a8' was not declared in this scope
19 | if(mark2 == ¨=¨)break;
| ^
|
s978402202 | p00511 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int num,ans;
string mark1,mark2;
cin>>ans;
while(1){
cin>>mark1;
cin>>num;
cin>>mark2;
if(mark1 == ¨=¨)break;
if(mark2 == ¨=¨)break;
if(mark1 == ¨+¨)
ans=ans+num;
if(mark1 == ¨-¨)
ans=ans-num;
if(mark1 == ¨*¨)
ans=ans*num;
if(mark1 == ¨/¨)
ans=ans/n... | a.cc: In function 'int main()':
a.cc:21:13: error: '\U000000a8' was not declared in this scope
21 | if(mark1 == ¨=¨)break;
| ^
a.cc:22:13: error: '\U000000a8' was not declared in this scope
22 | if(mark2 == ¨=¨)break;
| ^
a.cc:24:13: error: '\U000000a8' was not declared in this... |
s427754868 | p00511 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int num,ans;
char mark1,mark2;
cin>>ans;
while(1){
cin>>mark1;
cin>>num;
cin>>mark2;
if(mark1 == ¨=¨)break;
if(mark2 == ¨=¨)break;
if(mark1 == ¨+¨)
ans=ans+num;
if(mark1 == ¨-¨)
ans=ans-num;
if(mark1 == ¨*¨)
ans=ans*num;
if(mark1 == ¨/¨)
ans=ans/num... | a.cc: In function 'int main()':
a.cc:21:13: error: '\U000000a8' was not declared in this scope
21 | if(mark1 == ¨=¨)break;
| ^
a.cc:22:13: error: '\U000000a8' was not declared in this scope
22 | if(mark2 == ¨=¨)break;
| ^
a.cc:24:13: error: '\U000000a8' was not declared in this... |
s430803118 | p00511 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int num,ans;
char mark;
cin>>ans;
while(1){
cin>>mark;
cin>>num;
if(mark == ¨=¨)break;
if(mark == ¨+¨)
ans=ans+num;
if(mark == ¨-¨)
ans=ans-num;
if(mark == ¨*¨)
ans=ans*num;
if(mark == ¨/¨)
ans=ans/num;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:12: error: '\U000000a8' was not declared in this scope
20 | if(mark == ¨=¨)break;
| ^
a.cc:22:12: error: '\U000000a8' was not declared in this scope
22 | if(mark == ¨+¨)
| ^
a.cc:25:12: error: '\U000000a8' was not declared in this scope
... |
s065343449 | p00511 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <lim... | a.cc: In function 'int main()':
a.cc:31:14: error: 'i' was not declared in this scope
31 | cin>>v[i];
| ^
a.cc:37:12: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_ty... |
s551902462 | p00511 | C++ | #include<iostream>
using namespace std;
int main() {
int a,b;
char op;
cin>>op;
while(true){
cin>>op;
if(op == '='){cout<<a<<endl;break;}
cin>>b;
if(op == '+'){a += a;}
if(op == '-'){a -= a;}
if(op == '*'){a *= a;}
if(op == '/'){a /= a;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s166680203 | p00511 | C++ | #include<iostream>
using namespace std;
int a,b; char op;
int main() {
cin>>a;
while(true){
cin>>op;
if(op == '='){cout<<a<<endl;break;}
cin>>b;
if(op == '+'){a += a;}
if(op == '-'){a -= a;}
if(op == '*'){a *= a;}
if(op == '/'){a /= a;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s313756910 | p00511 | C++ | #include<iostream>
using namespace std;
int a,b; char op;
int main() {
cin>>a;
while(true){
cin>>op;
if(op == '='){cout<< a <<endl;break;}
cin>>b;
if(op == '+'){ a += a; }
if(op == '-'){ a -= a; }
if(op == '*'){ a *= a; }
if(op == '/'){ a /= a; }
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s680971655 | p00511 | C++ | #include<iostream>
using namespace std;
int a,b; char op;
int main() {
cin>>a;
while(true){
cin>>op;
if(op == '='){cout<< a <<endl; break;}
cin>>b;
if(op == '+'){ b += b; }
if(op == '-'){ b -= b; }
if(op == '*'){ b *= b; }
if(op == '/'){ b /= b; }
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s187769873 | p00511 | C++ | #include<iostream>
using namespace std;
int a,b; char op;
int main() {
cin>>a;
while(true){
cin>>op;
if(op == '='){cout<< a <<endl; break;}
cin>>b;
if(op == '+'){ a += b; }
if(op == '-'){ a -= b; }
if(op == '*'){ a *= b; }
if(op == '/'){ a /= b; }
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s957116338 | p00511 | C++ | #include<iostream>
using namespace std;
int a,b; char op;
int main() {
cin>>a;
while(true){
cin>>op;
if(op == '='){cout<< a <<endl; break;}
cin>>b;
if(op == '+'){ a += b; }
if(op == '-'){ a -= b; }
if(op == '*'){ a *= b; }
if(op == '/'){ a /= b; }
}
| a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s767744744 | p00512 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct E{char n[6];int c;} e[100000000],t;
int N,p,i,j;
int cmp(const void *a,const void *b)
{
struct E *x=(E*)a,*y=(E*)b;
return strlen(x->n)-strlen(y->n)==0?strcmp(x->n,y->n):strlen(x->n)-strlen(y->n);
}
int main()
{
scanf("%d\n",&N);
for(i=0;i<N;i++)
... | main.c: In function 'cmp':
main.c:9:22: error: 'E' undeclared (first use in this function)
9 | struct E *x=(E*)a,*y=(E*)b;
| ^
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:24: error: expected expression before ')' tok... |
s526985372 | p00512 | C++ | #include<iostream>
#include<vector>
using namespace std;
typedef pair<string,int> P;
int n;
vector<P> p;
int main(){
cin>>n;
p.resize(n);
for(int i=0;i<n;i++)
cin>>p[i].first>>p[i].second;
sort(p.begin(),p.end());
for(int i=0;i<n;i++){
if(i+1<n&&p[i].first==p[i+1].first){
p[i+1].second+=p[i].sec... | a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(p.begin(),p.end());
| ^~~~
| short
|
s795257639 | p00512 | C++ | #include <stdio.h>
#include <iostream>
#include <string>
#include <map>
using namespace std;
char s[10];
int main()
{
map<pair<int,string>,int> m;
int n;
scanf("%d",&n);
for(int i = 0; i < n; i++)
{
int w;
scanf("%s %d",s,&w);
int l = strlen(s);
if(m.end() != m.find(make_pair(l,s)))
{
m[make_pair(l... | a.cc: In function 'int main()':
a.cc:19:25: error: 'strlen' was not declared in this scope
19 | int l = strlen(s);
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <map>
+++ |+#... |
s718167336 | p00512 | C++ | #include<vector>
#include<algorithm>
#include <string.h>
using namespace std;
int main(){
int n,total,min_size=1;
string str;
map<string, int> products;
map<string, int>::iterator it;
cin >> n;
for (int i = 0; i<n; i++){
cin >> str >> total;
if (products.find(str) != products.end()){
produc... | a.cc: In function 'int main()':
a.cc:10:9: error: 'string' was not declared in this scope
10 | string str;
| ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
3 | #include <string.h>
+++ |+#include <string>
4 |... |
s762851288 | p00512 | C++ | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i... | 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/includ... |
s617023448 | p00512 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
bool cmp(pair<string,int> a,pair<string,int> b){
return (a.first.size()<b.first.size()?true:false);
}
int main(void){
map<string,int> m;
int n;
string s;int c;
cin>>n;
... | a.cc: In function 'int main()':
a.cc:26:3: error: 'sort' was not declared in this scope; did you mean 'short'?
26 | sort(w.begin(),w.end(),cmp);
| ^~~~
| short
|
s637591905 | p00512 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
int main() {
int n;
map<string, int> products;
vector<pair<string, int> > p;
cin>>n;
//vector<pair<string, int> > products;
for (int i = 0; i < n; ++i) {
string name;
int num;
cin>>n... | a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'short'?
31 | sort(p.begin(), p.end(), [](auto& lhs, auto& rhs) -> bool {
| ^~~~
| short
|
s383005469 | p00512 | C++ | #include<iostream>
#include<string>
#include<set>
#include<map>
using namespace std;
int main() {
set<string>s;
map<string, int>m;
int n; cin >> n;
for (int i = 0; i < n; i++) {
string str, int k; cin >> str >> k;
if (s.find(str) == s.end()) {
s.insert(str);
m[str] = k;
}
else m[str] += k;
}
for (au... | a.cc: In function 'int main()':
a.cc:11:29: error: expected unqualified-id before 'int'
11 | string str, int k; cin >> str >> k;
| ^~~
a.cc:11:50: error: 'k' was not declared in this scope
11 | string str, int k; cin >> str >> k;
| ... |
s455324743 | p00512 | C++ | #include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
using namespace std;
int main (void)
{
int n,b[100],as[100];
char a[100];
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i] >> b[i];
}
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (a[i] == a[j])
... | a.cc: In function 'int main()':
a.cc:26:40: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
26 | a[j] = "";
| ^~
| |
| const cha... |
s419150126 | p00512 | C++ | #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#inc... | a.cc: In function 'int main()':
a.cc:48:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
48 | for (int i = 0; i < a.count; i++) {
| ~ ^ ~~~~~~~
| | |
| int... |
s069485177 | p00512 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <lim... | a.cc: In function 'int main()':
a.cc:38:18: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'first'
38 | cout << mp.first << " " << mp.second << endl;
| ^~~~~
a.cc:38:38: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member name... |
s497771232 | p00512 | C++ | #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<queue>
using namespace std;
typedef pair<int,int> pii;
typedef pair<int,string> pis;
typedef pair<pis,int> tri;
#define rep(i,j) for(int i=0;i<(j... | a.cc: In function 'int main()':
a.cc:31:33: error: cannot convert '__gnu_cxx::__normal_iterator<std::pair<std::pair<int, std::__cxx11::basic_string<char> >, int>*, std::vector<std::pair<std::pair<int, std::__cxx11::basic_string<char> >, int> > >' to 'tri*' {aka 'std::pair<std::pair<int, std::__cxx11::basic_string<char>... |
s055195728 | p00512 | C++ | #include <map>
#include <cstdio>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
bool cmp(const pair<string, int>& x, const pair<string, int>& y)
{
if (x.first.size() < y.first.size()){
return true;
}
return x.first < y.first;
}
int main()
{
map<string, int> m;
string pn;
int n, ... | a.cc: In function 'int main()':
a.cc:38:9: error: 'sort' was not declared in this scope; did you mean 'short'?
38 | sort(v.begin(), v.end(), cmp);
| ^~~~
| short
|
s703988900 | p00512 | C++ | #include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
class S{
public:
string s;
int t;
S(){}
S(string s, int t): s(s), t(t) {}
bool operator < (const S a) const {
if(s.length() == a.s.length()) return s < a.s;
return s.length() < a.s.length();
}
};
main(){
... | a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
20 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:36:3: error: 'sort' was not declared in this scope; did you mean 'short'?
36 | sort(ans.begin(), ans.end());
| ^~~~
| short
|
s971707093 | p00512 | C++ | #include <iostream>
#include <map>
using namespace std;
int main()
{
int n;
map<string, int> m;
cin >> n;
for (int i = 0; i < n; i++) {
string str;
int num;
cin >> str >> num;
if (m.count(str) == 0)
m[str] = num;
else
m[str] += num;
... | a.cc: In function 'int main()':
a.cc:24:18: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int')
24 | cout << m[i].first << " " << m[i].second << endl;
| ^
In file included from /usr/include/c++/14/map:63,
fro... |
s199006518 | p00512 | C++ | #include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
vector<pair<int, pair<string, int> > > v;
for (int i = 0; i < n; i++){
char pName[8];
int num;
scanf("%s %d", pName, num);
v.push_back(make_pair(strlen(pName), make_pair... | a.cc: In function 'int main()':
a.cc:19:39: error: 'strlen' was not declared in this scope
19 | v.push_back(make_pair(strlen(pName), make_pair((string)pName, num)));
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixabl... |
s953109806 | p00512 | C++ | #include<iostream>
#include<map>
#include<string>
#include<algorithm>
int main(){
int i;
int n;
map<string, int> p;
cin >> n;
int num;
string name;
map<string, int>::iterator it;
for(i = 0; i < n; i++){
cin >> name >> num;
if(p.find(name) != p.end()) p[name] += num;
else p[name] = num;
}
... | a.cc: In function 'int main()':
a.cc:9:3: error: 'map' was not declared in this scope
9 | map<string, int> p;
| ^~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note: 'std::map'
102 | ... |
s177922711 | p00513 | Java | #include<stdio.h>
int main(){
int a;
scanf("%d",&a);
int ret=0;
for(int i=0;i<a;i++){
int b;
scanf("%d",&b);
b=b*2+1;
bool ok=false;
for(int j=1;(2*j+1)*(2*j+1)<=b;j++){
if(b%(2*j+1)==0)ok=true;
}
if(!ok)ret++;
}printf("%d\n",ret);
} | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:4: error: class, interface, enum, or record expected
scanf("%d",&a);
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by defau... |
s146025602 | p00513 | C++ | #include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
int all = 0;
for(int i = 0; i < n; i++)
{
int q;
scanf("%d",&q);
bool w = true;
for(int j = 1; j <= (1 << 15))
{
if(0 == (q - j) % (j * 2 + 1))
{
w = false;
break;
}
}
if(w)
{
all++;
}
}
printf("%d\n",all);
return 0;
} | a.cc: In function 'int main()':
a.cc:13:30: error: expected ';' before ')' token
13 | for(int j = 1; j <= (1 << 15))
| ^
| ;
|
s457994334 | p00513 | C++ | #include <iostream>
using namespace std;
int main(){
int n,s,cnt=0;
cin >> n;
for(int i=0;i<n;i++){
cin >> s;
int flag=0;
for(int j=1;j<s;j++){
if((s-j)%(2j+1)==0){
if((s-j)/(2j+1)<s){
flag=1;
break;
}
}
}
if(flag==0) cnt++;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: invalid operands of types 'int' and '__complex__ int' to binary 'operator%'
10 | if((s-j)%(2j+1)==0){
| ~~~~~^~~~~~~
| | |
| int __complex__ int
a.cc:11:24: error: invalid operands of types '__complex__ ... |
s184070963 | p00513 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int n, x, sum;
int hantei(int p) {
int v = max((int)sqrt(p) * 5, p);
for (int i = 1; i <= sqrt(p); i++) {
int a = p - i;
if (a % (2 * i + 1) == 0 && a >= 1) {
return 0;
}
}
return 1;
}
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
ci... | a.cc: In function 'int hantei(int)':
a.cc:8:26: error: 'sqrt' was not declared in this scope
8 | int v = max((int)sqrt(p) * 5, p);
| ^~~~
|
s729666942 | p00513 | C++ | #include <stdio.h>
inline bool check(int n)
{
int rep = x > 100 ? 100 : x;
for(int x = 1; x < rep; x++)
{
if((n - x) % (2 * x + 1) == 0)
{
return true;
}
}
return false;
}
int main()
{
int n, q, c = 0;
scanf("%d", &q);
for(int i =... | a.cc: In function 'bool check(int)':
a.cc:5:15: error: 'x' was not declared in this scope
5 | int rep = x > 100 ? 100 : x;
| ^
|
s483598406 | p00513 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
inline bool check(int n)
{
int rep = min(x, 100);
for(int x = 1; x < rep; x++)
{
if((n - x) % (2 * x + 1) == 0)
{
return true;
}
}
return false;
}
int main()
{
int n, q, c = 0;
... | a.cc: In function 'bool check(int)':
a.cc:8:19: error: 'x' was not declared in this scope
8 | int rep = min(x, 100);
| ^
|
s648836015 | p00513 | C++ | #include<iostream>
using namespace std;
bool f(long long a) {
if(a % 2 =v 0) return false;
for(long long i = 3; i *i <= a; i += 2)
if(a % i == 0) return false;
return true;
}
int main() {
int n;
cin >> n;
int res=0;
for(int i=0; i<n; i++j {
long long a;
cin a;
if(f2ga+1)) res++;
}
cou... | a.cc: In function 'bool f(long long int)':
a.cc:4:13: error: 'v' was not declared in this scope
4 | if(a % 2 =v 0) return false;
| ^
a.cc:4:14: error: expected ')' before numeric constant
4 | if(a % 2 =v 0) return false;
| ~ ^~
| )
a.cc: In function 'int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.