submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s581694284 | p00150 | C++ | int main(void){
int i,j;
int isprime[1000];
//???????????????????????°????´???°?????¨??????
for(i=0;i<=1000;i++){
isprime[i]=1;
}
//????????????????????????????????????
isprime[0]=isprime[1]=0;
//2??????????????????
for(i=2;i<=1000;i++){
if(isprime[i]==1){
for(j=2*i;j<=1000;j+=i){
isprime[j]=0;
... | a.cc: In function 'int main()':
a.cc:22:25: error: 'print' was not declared in this scope; did you mean 'int'?
22 | print("(%d,%d)",i-2,i);
| ^~~~~
| int
|
s004855361 | p00150 | C++ | int main(void){
int i,j;
int isprime[1000];
for(i=0;i<=1000;i++){
isprime[i]=1;
}
isprime[0]=isprime[1]=0;
for(i=2;i<=1000;i++){
if(isprime[i]==1){
for(j=2*i;j<=1000;j+=i){
isprime[j]=0;
}
}
}
for(i=2;i<=1000;i++){
if(isprime[i-2]==1 && isprime[i]==1){
printf("(%d,%d)",i-2,i);
}
}
re... | a.cc: In function 'int main()':
a.cc:17:25: error: 'printf' was not declared in this scope
17 | printf("(%d,%d)",i-2,i);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cs... |
s803906683 | p00150 | C++ | #include <stdio.h>
int isprime(int n){
for(int i = 2 ; i*i<=n ;i++){
if(n%i==0)return 0;
}
return 1;
}
int main(){
int n ,i , fir ,sec;
while(scanf("%d" ,&n)){
if(n==0)break;
fir = 0 ,sec = 0;
for(i=n ;i>3 ;i--){
if(number[i] && number[i-2]){
fir = i-2;
sec = i;
brea... | a.cc: In function 'int main()':
a.cc:14:10: error: 'number' was not declared in this scope
14 | if(number[i] && number[i-2]){
| ^~~~~~
|
s486772518 | p00150 | C++ | 1
| a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s798227611 | p00150 | C++ | #import<algo.h>
int i,j,n,P[9999];
int main()
{
for(i=2;i*i<9999;i++)for(j=i;j<9999;P[j+=i]=1);
for(;std::cin>>n,n;printf("%d %d\n",i-2,i))
for(i=n;P[i]||P[i-2];i--);
} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<algo.h>
| ^~~~~~
a.cc:1:8: fatal error: algo.h: No such file or directory
1 | #import<algo.h>
| ^~~~~~~~
compilation terminated.
|
s326908009 | p00150 | C++ | #include <iostream>
using namespace std;
int dummy_prime(int n,int i){return i>1 ? n%i ? dummy_prime(n,i-1) : 0 : 1;}
int isprime(int n){return n>1 ? dummy_prime(n,(int)sqrt(n)) : 0;}
int main(){
int n;
while(cin >> n && n){
while(n>4){
if(isprime(n) && isprime(n-2)){
cout << n-2 << " " << n << endl;
... | a.cc: In function 'int isprime(int)':
a.cc:5:52: error: 'sqrt' was not declared in this scope
5 | int isprime(int n){return n>1 ? dummy_prime(n,(int)sqrt(n)) : 0;}
| ^~~~
|
s567505837 | p00150 | C++ | #include <iostream>
#include <cstdlib>
using namespace std;
int dummy_prime(int n,int i){return i>1 ? n%i ? dummy_prime(n,i-1) : 0 : 1;}
int isprime(int n){return n>1 ? dummy_prime(n,(int)sqrt(n)) : 0;}
int main(){
int n;
while(cin >> n && n){
while(n>4){
if(isprime(n) && isprime(n-2)){
cout << n-2 << " "... | a.cc: In function 'int isprime(int)':
a.cc:6:52: error: 'sqrt' was not declared in this scope
6 | int isprime(int n){return n>1 ? dummy_prime(n,(int)sqrt(n)) : 0;}
| ^~~~
|
s002422036 | p00150 | C++ | int i,j,k;char s[9];p(int n){if(n<2)return 0;else if(n==2)return 1;if(n%2==0)return 0;for(i=3;i*i<=n;i+=2)if(n%i==0)return 0;return 1;}main(){while(scanf("%d",&j)){if(!j)break;while(k++<j){if(p(k-1)&&p(k-3)){sprintf(s,"%d %d",k-3,k-1);}}puts(s);}} | a.cc:1:21: error: ISO C++ forbids declaration of 'p' with no type [-fpermissive]
1 | int i,j,k;char s[9];p(int n){if(n<2)return 0;else if(n==2)return 1;if(n%2==0)return 0;for(i=3;i*i<=n;i+=2)if(n%i==0)return 0;return 1;}main(){while(scanf("%d",&j)){if(!j)break;while(k++<j){if(p(k-1)&&p(k-3)){sprintf(s,"%d %d",k-3,k... |
s137770637 | p00150 | C++ | #include <iostream>
using namespace std;
bool t[10000] = {false};
int main()
{
int n, i;
t[0] = true;
for (i = 2; i * i <= 10000; i++)
{
if (!t[i-1])
{
for (j = i+i; j <= 10000; j+=i)
t[j-1] = true;
}
}
while (cin >> n, n)
{
for (i = n; i >= 5; i--)
{
if ((!t[i-1]) && (!t[i-3]))
{
cout... | a.cc: In function 'int main()':
a.cc:12:30: error: 'j' was not declared in this scope
12 | for (j = i+i; j <= 10000; j+=i)
| ^
|
s529329881 | p00150 | C++ | #include <iostream>
using namespace std;
bool isPrime[10001];
void setPrime( bool *p, int size )
{
memset(p, true, size);
p[0] = p[1] = false;
for(int i=2; i < size; ++i) {
if(!p[i]) continue;
for(int j=i+i; j < size; j+=i) {
p[j] = false;
}
}
}
int main( void )
{
setPrime(isPrime, 10001);
int n;
w... | a.cc: In function 'void setPrime(bool*, int)':
a.cc:9:9: error: 'memset' was not declared in this scope
9 | memset(p, true, size);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#in... |
s480858130 | p00150 | C++ | //10018
#include <iostream>
#include <cstdio>
using namespace std;
int p(int n){
for(!n%2){
return 0;
}
else{
for(int i=0;i*i<n;i-=2){
if(!n%1){
return 0;
}
}
return 1;
}
}
int main(){
cin >> n;
for(int k=n;k>0;k--){
if(p(n) && p(n-2)){
cout << n-2 << n << endl;
break;
}
}
} | a.cc: In function 'int p(int)':
a.cc:7:17: error: expected ';' before ')' token
7 | for(!n%2){
| ^
| ;
a.cc:10:9: error: expected primary-expression before 'else'
10 | else{
| ^~~~
a.cc:9:10: error: expected ';' before 'else'
9 | ... |
s809266270 | p00150 | C++ | #include <iostream>
using namespace std;
bool isPrime[10002];
void PrimeCalc()
{
memset(isPrime, 1, sizeof(isPrime));
isPrime[0] = isPrime[1] = false;
for(int i = 2; i < 10001; ++i)
{
if(isPrime[i])
{
for(int j = 2 * i; j < 10001; j += i)
{
isPrime[j] = false;
}
}
}
}
void solve()
{
PrimeCal... | a.cc: In function 'void PrimeCalc()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(isPrime, 1, sizeof(isPrime));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ ... |
s905386442 | p00150 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define MAX_N 10000
int prime[MAX_N];
bool is_prime[MAX_N+1];
int sieve(int n){
int p=0;
memset(is_prime,true,sizeof(is_prime));
is_prime[0]=is_prime[1]=false;
for(int i=2;i<=n;i++){
if(is_prime[i]){
prime[p++]=i;
for(int j=2*i;j... | a.cc: In function 'int sieve(int)':
a.cc:12:9: error: 'memset' was not declared in this scope
12 | memset(is_prime,true,sizeof(is_prime));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<vector>
+++ |... |
s568769848 | p00151 | C++ | /*Grid*/
#include<stdio.h>
void func(int,int);
int n;
int i,j;
char a[30][30];
int cnt,max;
int dx[8]={0,1,1,1,0,-1,-1,-1};
int dy[8]={1,1,0,-1,-1,-1,0,1};
int main(void)
{
//int i,j;
while(1){
scanf("%d",&n);
if(n==0) break;
for(i=0;i<n;i++) scanf("%s",a[i]);
//for(i=1;i<n;i++) printf("%s\n",a[i]);
max=0;
... | a.cc: In function 'void func(int, int)':
a.cc:41:67: error: expected primary-expression before ',' token
41 | if(max<cnt) max=cnt,/*printf("%d\n",cnt)*/,cnt=0,
| ^
|
s900350288 | p00151 | C++ | /*Grid*/
#include<stdio.h>
void func(int,int);
int n;
int i,j;
char a[255][255];
int cnt,max;
int dx[8]={0,1,1,1,0,-1,-1,-1};
int dy[8]={1,1,0,-1,-1,-1,0,1};
int main(void)
{
//int i,j;
while(1){
scanf("%d",&n);
if(n==0) break;
for(i=0;i<n;i++) scanf("%s",a[i]);
//for(i=1;i<n;i++) printf("%s\n",a[i]);
max=0... | a.cc: In function 'void func(int, int)':
a.cc:41:67: error: expected primary-expression before ',' token
41 | if(max<cnt) max=cnt,/*printf("%d\n",cnt)*/,cnt=0,
| ^
|
s919207355 | p00151 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
int n, a[255][255];
int check(int x, int y, int dx, int dy) {
int ret = 0;
while(0 <= x && x < n && 0 <= y && y < n) {
if(a[y][x] == 0) return ret;
x += dx, y += dy, ret++;
}
return ret;
}
int main() {
while(~scanf("%d", &n), n) {
for(int i = 0; i ... | a.cc: In function 'int main()':
a.cc:24:72: error: 'checK' was not declared in this scope; did you mean 'check'?
24 | ret = max(ret, checK(j, i, l, k));
| ^~~~~
| ... |
s250342572 | p00151 | C++ | #include<bits/stdc++.h>
using namespace std;
#define s second
#define f first
int dx[]={1,0,1,-1};
int dy[]={0,1,1,1};
int main(){
int n;
while(cin>>n,n){
string s[n];
for(int i=0;i<n;i++)cin>>s[i];
pair<pair<int,int>,pair<int,int> > a[n][n];
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
a[i][... | a.cc: In function 'int main()':
a.cc:21:16: error: no match for 'operator&&' (operand types are 'bool' and 'std::pair<std::pair<int, int>, std::pair<int, int> >')
21 | if(k==0&&a[y][x])a[y][x].f.f+=a[i][j].f.f;
| ~~~~^~~~~~~~~
| | |
| bool s... |
s122991172 | p00151 | C++ | #include<cstdio.h>
#include<iostream.h>
using namespace std;
int main(void){
int i,j,k,n,max,cnt,x,y;
int dx[4]={1,1,0,-1},dy[4]={0,-1,-1,-1};
char xy[225][225];
while(1){
max=0;
cin>>n;
if(n==0) break;
for(i=0;i<n;i++) cin>>xy[i];
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(xy[i][j]=='1'){
for(k=0... | a.cc:1:9: fatal error: cstdio.h: No such file or directory
1 | #include<cstdio.h>
| ^~~~~~~~~~
compilation terminated.
|
s266799602 | p00151 | C++ | #include<cstdio>
#include<iostream.h>
using namespace std;
int main(void){
int i,j,k,n,max,cnt,x,y;
int dx[4]={1,1,0,-1},dy[4]={0,-1,-1,-1};
char xy[225][225];
while(1){
max=0;
cin>>n;
if(n==0) break;
for(i=0;i<n;i++) cin>>xy[i];
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(xy[i][j]=='1'){
for(k=0;k... | a.cc:2:9: fatal error: iostream.h: No such file or directory
2 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s012432161 | p00151 | C++ | #include<cstdio.h>
#include<iostream>
using namespace std;
int main(void){
int i,j,k,n,max,cnt,x,y;
int dx[4]={1,1,0,-1},dy[4]={0,-1,-1,-1};
char xy[225][225];
while(1){
max=0;
cin>>n;
if(n==0) break;
for(i=0;i<n;i++) cin>>xy[i];
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(xy[i][j]=='1'){
for(k=0;k... | a.cc:1:9: fatal error: cstdio.h: No such file or directory
1 | #include<cstdio.h>
| ^~~~~~~~~~
compilation terminated.
|
s152397046 | p00151 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main(void){
int i,j,k,n,max,cnt,x,y;
int dx[]={1,1,0,-1},dy[]={0,1,1,1};
char xy[225][226];
while(1){
max=0;
cin>>n;
if(n==0) break;
for(i=0;i<n;i++) cin>>xy[i];
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(xy[i][j]=='1'){
for(k=0;k<4;k++)... | a.cc:30:26: error: stray '\' in program
30 | cout<<max\n;
| ^
a.cc: In function 'int main()':
a.cc:30:26: error: expected ';' before 'n'
30 | cout<<max\n;
| ^~
| ;
|
s272279939 | p00151 | C++ | #include <iostream>
#include <cmath>
using namespace std;
const int MAX_N = 255;
int n;
char grid[MAX_N][MAX_N];
int dp[MAX_N][MAX_N][4];
int main()
{
while(cin >> n && n) {
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> grid[i][j];
memset(dp, 0,... | a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
18 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cmath>
+++ |+#include <cstrin... |
s799056843 | p00151 | C++ | #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
const int MAX_N = 255;
int n;
char grid[MAX_N][MAX_N];
int dp[MAX_N][MAX_N][4];
int main()
{
while(cin >> n && n) {
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> grid[i][j];
... | a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
18 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+#include <cstri... |
s801205949 | p00151 | C++ | #include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
const int MAX_N = 255;
int n;
char grid[MAX_N][MAX_N];
int dp[MAX_N][MAX_N][4];
int main()
{
while(cin >> n && n) {
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> grid[i][j];
... | a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
18 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdlib>
+++ |+#include <cstr... |
s724031623 | p00151 | C++ | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int n;
const int MAX = 255;
int M[MAX][MAX];
int solve()
{
int mval = 0;
for(int i=0; i<n; i++)
{
int c = 0;
for(int j=0; j<n; j++)
{
if(M[i][j]==1)
{
c++;
}
else
{
if(c > mval) mval =c;
c = 0;
}
}... | a.cc: In function 'int main(int, char**)':
a.cc:128:33: error: 'memcpy' was not declared in this scope
128 | memcpy(c, &tmp[j], sizeof(char));
| ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#... |
s292496687 | p00151 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
using namespace std;
int n;
const int MAX = 255;
int M[MAX][MAX];
int solve()
{
int mval = 0;
for(int i=0; i<n; i++)
{
int c = 0;
for(int j=0; j<n; j++)
{
if(M[i][j]==1)
{
c++;
}
else
{
if(c... | a.cc: In function 'int main(int, char**)':
a.cc:130:33: error: 'memcpy' was not declared in this scope
130 | memcpy(c, &tmp[j], sizeof(char));
| ^~~~~~
a.cc:6:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#... |
s692735050 | p00151 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int n;
// arr[y][x]
int arr[260][260];
/*
0: ツ湘」
1: ツ債カ
2: ツ債カツ湘」
3: ツ右ツ湘」
*/
int dp[4][260][260];
int main() {
for(;;) {
scanf(" %d", &n);
if(!n) break;
for(int y = 0; y < n; y++) {
char line[260];
scanf(" %s", line);
for(int x = 0; x < n... | a.cc: In function 'int main()':
a.cc:30:17: error: 'memset' was not declared in this scope
30 | memset(dp, 0, sizeof dp);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
++... |
s599252904 | p00151 | C++ | #include<algorithm>
using namespace std;
int main(){
int n;
int field[255][255];
int d;
string tmp;
while(1){
cin >> n;
if(!n)break;
for(int i=0;i<n;i++){
cin >> tmp;
for(int j=0;j<n;j++)field[i][j] = tmp[j]-'0';
}
int ans = 0;
for(int i=0;i<n;i++){
for(int j=0;j<... | a.cc: In function 'int main()':
a.cc:8:3: error: 'string' was not declared in this scope
8 | string tmp;
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include<algorithm>
+++ |+#include <string>
2 | using namesp... |
s351141431 | p00151 | C++ | #include<iostream>
#include<algorithm>
#include<numeric>
#include<iterator>
#include<vector>
using namespace std;
typedef unsigned int val;
int tate(char mass[256][256],int n)
{
int count=0,a=0,b=0,ans=-1;
while(1)
{
if(b==n)break;
if(mass[a][b]=='0' || a==n)
{
if(ans<count) ans=count;
a=0;... | a.cc: In function 'int main()':
a.cc:70:33: error: cannot convert 'char (*)[260]' to 'char (*)[256]'
70 | if( ans < tate( mass, n ) ) ans = tate( mass, n );
| ^~~~
| |
| char (*)[260]
a.c... |
s149260535 | p00152 | C | #include <stdio.h>
int main(void){
int n, i, j;
int classnum[40];
int score[40][21];
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d", &classnum[i]);
for(j=0; | main.c: In function 'main':
main.c:14:2: error: expected expression at end of input
14 | for(j=0;
| ^~~
main.c:14:2: error: expected declaration or statement at end of input
main.c:14:2: error: expected declaration or statement at end of input
|
s105406988 | p00152 | C | #include <stdio.h>
int main (void)
{
int a,i,j=0;
int s[][22]={};
do{
scanf("%d",&a);
for(i=0;i<a;i++)
scnaf(s[j][] | main.c: In function 'main':
main.c:9:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
9 | scnaf(s[j][]
| ^~~~~
| scanf
main.c:9:12: error: expected expression before ']' token
9 | scnaf(s[j][]
| ^
main.c:9:12: error: expecte... |
s646023443 | p00152 | C++ | #pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DS... | In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:5:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long l... |
s452478075 | p00152 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
bool exist[10000][301];
int main(){
while(true){
int n;
cin >> n;
if(n == 0){
break;
}
for(int i = 0; i < 10000; i++){
for(int j = 0; j < 301; j++){
exist[i][j] = false;
}
}
int id, score... | a.cc: In function 'int main()':
a.cc:91:58: error: expected ';' before '}' token
91 | rest = 10
| ^
| ;
92 | ... |
s366220136 | p00152 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
pair<int,int> d[40];
int cnt,sparecnt,throwcnt,plus[2];
int numcnt;
void Sc(int u){
if(numcnt>9)plus[0]--;
if(numcnt>10)plus[0]--;
d[u].first+=cnt*plus[0];
plus[0]=plus[1];
plus[1]=1;
throwcnt++;
sparecnt+=cnt;
if(throwcnt==2){
if(sp... | a.cc: In function 'void Sc(int)':
a.cc:9:21: error: reference to 'plus' is ambiguous
9 | if(numcnt>9)plus[0]--;
| ^~~~
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/... |
s614939306 | p00152 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
pair<int,int> d[40];
int cnt,sparecnt,throwcnt;
int plus[2];
int numcnt;
void Sc(int u){
if(numcnt>9)plus[0]--;
if(numcnt>10)plus[0]--;
d[u].first+=cnt*plus[0];
plus[0]=plus[1];
plus[1]=1;
throwcnt++;
sparecnt+=cnt;
if(throwcnt==2){
... | a.cc: In function 'void Sc(int)':
a.cc:10:21: error: reference to 'plus' is ambiguous
10 | if(numcnt>9)plus[0]--;
| ^~~~
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... |
s195398717 | p00152 | C++ | #include <iostream>
#include <string>
#include <iostream>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef pair<int, string> Ps;
Ps data[40];
int cnt[11];
int main(){
int m, a, b, c, score;
while(cin >> m && m){
rep(i, m){
score = 0;
fill(cnt, cnt + 10, 0);
cin >> d... | a.cc: In function 'int main()':
a.cc:18:14: error: reference to 'data' is ambiguous
18 | cin >> data[i].second;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_b... |
s511103796 | p00152 | C++ |
#if 1
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <n... | a.cc:2: error: unterminated #if
2 | #if 1
|
s238589101 | p00152 | C++ | test | a.cc:1:1: error: 'test' does not name a type
1 | test
| ^~~~
|
s561899958 | p00152 | C++ | #include<iostream>
#include<map>
#include<functional>
using namespace std;
int main(void){
int n;
while(1){
scanf("%d",&n);
if(n==0)break;
multimap<int,int, greater<int> > s;
for(int i=0;i<n;i++){
int num,sc[10][3],sck[10],res=0;
memset(sc,0,sizeof(sc));
memset(sck,0,sizeof(sck));
scanf("%d",&num... | a.cc: In function 'int main()':
a.cc:14:25: error: 'memset' was not declared in this scope
14 | memset(sc,0,sizeof(sc));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<f... |
s860174318 | p00152 | C++ | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int da[25],sc[41],i,j,k,n,fr;
char ch[100];
while(cin >> n) {
if (n==0) break;
cin.ignore();
for (j=0;j<n;j++) {
gets(ch); k=fr=sc[j]=0;
for (i=0;i<25;i++) da[i]=0;
for (i=0;ch[i]!='\0';i++) if (ch[... | a.cc: In function 'int main()':
a.cc:13:6: error: 'gets' was not declared in this scope; did you mean 'getw'?
13 | gets(ch); k=fr=sc[j]=0;
| ^~~~
| getw
a.cc:26:2: error: 're' was not declared in this scope
26 | re
| ^~
a.cc:26:4: error: expected '}' at end of input
26 | re
... |
s340218321 | p00152 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
typedef pair<int,int> P;
vector<int> Point(string s){
stringstream ss(s);
int num;
vector<int> v;
while(ss >> num){
v.push_back(num);
}
return v;
}
int getScore(string s){
vector<int> a = Point(s);
... | a.cc: In function 'int main()':
a.cc:73:5: error: 'sort' was not declared in this scope; did you mean 'short'?
73 | sort(v.begin(),v.end());
| ^~~~
| short
|
s611174711 | p00153 | Java |
import java.util.Arrays;
import java.util.Scanner;
/**
* AOJ id=0153
* Triangle and Circle
* @author scache
*
*/
public class Main0153 {
public static void main(String[] args) {
Main0153 p = new Main0153();
}
public Main0153() {
Scanner sc = new Scanner(System.in);
while(true){
int[] x = new int[... | Main.java:11: error: class Main0153 is public, should be declared in a file named Main0153.java
public class Main0153 {
^
1 error
|
s361456590 | p00153 | C | #define hypot _hypot
float q;
A,B,C,D,E,F,R;
M(a,b,c,d,e,f){
e=c-a;
f=d-b;
q=fabs(-f*a+e*b)/hypot(e,f);
if(a*e+b*f<0&&c*e+d*f>0&&q<=R)
if(q<R)
return 2;
else
return 1;
return 0;
}
I(){
q=E*B-F*A;
return(C*F-D*E)*q>0&q*(A*D-B*C)>0;
}
main(v,w,o,c){
for(;scanf("%d%d%d%d%d%d%d%d%d",&A,&B,&C,&D,&E,&F,&v,&... | main.c:3:1: warning: data definition has no type or storage class
3 | A,B,C,D,E,F,R;
| ^
main.c:3:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:3:3: error: type defaults to 'int' in declaration of 'B' [-Wimplicit-int]
3 | A,B,C,D,E,F,R;
| ^
main.c:3:5: error: type ... |
s857223525 | p00153 | C | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>
using name... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s608959672 | p00153 | C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
int i,j,n,m;
int x1,y1,x2,y2,x3,y3,wx,wy,r;
int crosscheck(int tx,int ty,int sx,int sy,int wx,int wy,int rr){
int abx=sx-tx,aby=sy-ty;
int awx=wx-tx,awy=wy-ty;
int bwx=wx-sx,bwy=wy-sy;
int rr2=rr*rr;
int aw2=awx*awx+awy*awy;
int bw2=bwx*bwx+bwy*bwy;
in... | main.c:6:8: error: 'y1' redeclared as different kind of symbol
6 | int x1,y1,x2,y2,x3,y3,wx,wy,r;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:28,
from... |
s072647946 | p00153 | C++ | #include "stdafx.h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <fstream>
using namespace std;
struct Point{
int x;
int y;
};
struct Delta{
Point p[3];
};
struct Circle{
Point p;
int radius;
};
double distance(Point p1, Point p2){
return sqrt((p1.x-p2.x)*(p1.x-p2.... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s707961490 | p00153 | C++ | #include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// ------ Classes ------ //
class Point {
public:
long double px, py;
Point() : px(0), py(0) {};
Point(long double px_, long double py_) : px(px_), py(py_) {};
friend bool operator==(const Point& p1, const Point& p2) { ... | a.cc:56:17: error: 'Line' does not name a type
56 | Point prj(const Line& a, const Point& b) { return a.p1 + (a.p2 - a.p1) * dot(b - a.p1, a.p2 - a.p1) / norm(a.p2 - a.p1); }
| ^~~~
a.cc: In function 'Point prj(const int&, const Point&)':
a.cc:56:53: error: request for member 'p1' in 'a', which... |
s502327807 | p00153 | C++ | #include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// ------ Classes ------ //
class Point {
public:
long double px, py;
Point() : px(0), py(0) {};
Point(long double px_, long double py_) : px(px_), py(py_) {};
friend bool operator==(const Point& p1, const Point& p2) { ... | a.cc: In function 'long double dst(const Segment&, const Segment&)':
a.cc:72:13: error: 'its' was not declared in this scope
72 | if (its(a, b)) return 0;
| ^~~
|
s962625221 | p00153 | C++ | /*include*/
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#include<complex>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#de... | a.cc: In function 'int main()':
a.cc:305:42: error: cannot bind non-const lvalue reference of type 'L&' to an rvalue of type 'L'
305 | rep(i,3)if(intersectCS(c,L(g[i],g[(i+1)%3])))h=true;
| ^~~~~~~~~~~~~~~~~~
a.cc:125:24: note: initializing argument 2 o... |
s531658151 | p00153 | C++ |
B comp(const P& l, const P& r){ return (l.X == r.X) ? l.Y < r.Y : l.X < r.X; }
typedef pair<P, P> L; //line
typedef pair<P, P> LS; //line segment
typedef pair<P, D> C; //circle
typedef vector<P> Poly;
const D EPS = 1e-8;
//Decompotision Macro
#define DCl(a,b,l) P (a),(b);tie(a,b)=l;
#def... | a.cc:2:5: error: 'B' does not name a type
2 | B comp(const P& l, const P& r){ return (l.X == r.X) ? l.Y < r.Y : l.X < r.X; }
| ^
a.cc:3:13: error: 'pair' does not name a type
3 | typedef pair<P, P> L; //line
| ^~~~
a.cc:4:13: error: 'pair' does not name a type
4 | ty... |
s529655374 | p00153 | C++ | #include<complex>
#include<vector>
#include<algorithm>
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
bool operator < (const P& a, const P& b) {
return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}
}
double cross(const P& a, con... | a.cc: In function 'int main()':
a.cc:109:15: error: 'cin' was not declared in this scope
109 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>cx>>cy>>r,x1||y1){
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include... |
s756081622 | p00153 | C++ | #include<iostream>
#include<cfloat>
#include<cmath>
using namespace std;
#define EPS (1e-8)
#define equals(a, b) (fabs((a) - (b)) < EPS )
#define dle(a, b) (equals(a, b) || a < b )
static const double PI = acos(-1);
class Point{
public:
double x, y;
Point ( double x = 0, double y = 0): x(x), y(y){}... | a.cc: In function 'std::pair<Point, Point> getCrossPoints(Circle, Line)':
a.cc:94:5: error: 'assert' was not declared in this scope
94 | assert( isIntersect( c1, l ) );
| ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
3 | #i... |
s626055379 | p00153 | C++ | #include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
#define EPS 1e-8
using namespace std;
typedef complex<double> P;
typedef vector<P> G;
double cross(const P &a, const P &b){
return imag(conj(a)*b);
}
double dot(const P &a, const P &b){
return real(conj(a) * b);
}
struct L : pu... | a.cc: In function 'int main()':
a.cc:109:33: error: 'struct L' has no member named 'c'
109 | if(distanceSP(e[i]. c.p) <= r){
| ^
|
s820732887 | p00153 | C++ | #include <cstdio>
#include <iostream>
#include <complex>
using namespace std;
#define dump(n) cerr<<"# "<<#n<<"="<<(n)<<endl
const double EPS=1e-9;
const double INFTY=1e12;
typedef complex<double> Point;
struct Line{
Point pos,dir;
Line(){}
Line(Point p,Point d):pos(p),dir(d){}
};
int Signum(double x)
{
return... | a.cc: In function 'int main()':
a.cc:117:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
117 | cin>>real(p[i])>>imag(p[i]);
| ~~~^~~~~~~~~~~~
| | |
| ... |
s296605833 | p00153 | C++ | #include <cstdio>
#include <iostream>
#include <complex>
using namespace std;
#define dump(n) cerr<<"# "<<#n<<"="<<(n)<<endl
const double EPS=1e-9;
const double INFTY=1e12;
typedef complex<double> Point;
struct Line{
Point pos,dir;
Line(){}
Line(Point p,Point d):pos(p),dir(d){}
};
int Signum(double x)
{
return... | a.cc: In function 'int main()':
a.cc:117:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
117 | cin>>real(p[i])>>imag(p[i]);
| ~~~^~~~~~~~~~~~
| | |
| ... |
s375800451 | p00153 | C++ | #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
double EPS = 1e-10;
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
point(){}
point(double x,double y) : x(x) , y(y){}
poi... | a.cc: In function 'int inside(point, point*, int)':
a.cc:93:10: error: 'INT_MAX' was not declared in this scope
93 | lt.b.x=INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include<vector>
+++ |+#include... |
s739245524 | p00153 | C++ | #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<cfloat>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y... | a.cc: In function 'int inside(point, std::vector<point>, int)':
a.cc:99:3: error: 'segment' was not declared in this scope
99 | segment t;
| ^~~~~~~
a.cc:100:3: error: 't' was not declared in this scope
100 | t.a=t.b=p;
| ^
|
s702424605 | p00153 | C++ | #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<cfloat>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
poin... | a.cc: In function 'int crossCS(point, point, circle)':
a.cc:90:18: error: expected ')' before 'else'
90 | if(res>c.r || (ac else if(c.r-res=c.r)||(ac>=c.r && bc else return 2;
| ~ ^~~~~
| )
a.cc:90:69: error: expected ')' before ';' token
90 | if(res>c.r || (ac else if(... |
s891065816 | p00153 | C++ | #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<cfloat>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
poin... | a.cc: In function 'int inside(point, std::vector<point>, int)':
a.cc:101:14: error: expected ';' before 'ymx'
101 | for(int i=0;i ymx=max(ymx,ps[i].y);
| ^~~~
| ;
a.cc:101:35: error: expected ')' before ';' token
101 | for(int i=0;i ymx=max(ymx,ps[i].y);
| ~ ... |
s290916596 | p00153 | C++ | #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<cfloat>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
poin... | a.cc: In function 'int inside(point, std::vector<point>, int)':
a.cc:101:14: error: expected ';' before 'ymx'
101 | for(int i=0;i ymx=max(ymx,ps[i].y);
| ^~~~
| ;
a.cc:101:35: error: expected ')' before ';' token
101 | for(int i=0;i ymx=max(ymx,ps[i].y);
| ~ ... |
s391899534 | p00153 | C++ | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <bitset>
#include <string>
#include <complex>
using namespac... | a.cc: In function 'void solve()':
a.cc:126:31: error: cannot bind non-const lvalue reference of type 'L&' to an rvalue of type 'L'
126 | d[3] = distP2LS(cc.p, L(tr[0], tr[1]));
| ^~~~~~~~~~~~~~~
a.cc:86:26: note: initializing argument 2 of 'double distP2LS(P&, L&)'
86 ... |
s039303835 | p00153 | C++ | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <ctime>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <fstream>
#include... | a.cc: In function 'int main()':
a.cc:67:19: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
67 | while(cin >> a.real() >> a.imag() , a.real() != 0 || a.imag() != 0 ){
| ~~~ ^~ ~~~~~~~~
| | |
... |
s616055528 | p00154 | Java |
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Map.Entry;
public class Sample {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
int n = scanner.nextInt();
if (n == 0)
break;
Map<Integer, Integer> memo = new... | Main.java:7: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
^
1 error
|
s437183179 | p00154 | Java | public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
int n = scanner.nextInt();
if (n == 0)
break;
Map<Integer, Integer> memo = new HashMap<Integer, Integer>();
memo.put(0, 1);
for (int i = 0; i < n; i++) {
int a = scanner.nextInt();
int b = sc... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:43: error: class, interface, enum, or record expected
}
^
2 errors
|
s035894716 | p00154 | Java | import java.util.*;
public class AOJ_0154{
class Card{
int a;
int b;
Card(int a, int b){
this.a = a;
this.b = b;
}
}
void run(){
Scanner sc = new Scanner(System.in);
while(true){
int[] card_num = new int[101];
i... | Main.java:3: error: class AOJ_0154 is public, should be declared in a file named AOJ_0154.java
public class AOJ_0154{
^
1 error
|
s941533785 | p00154 | Java | import java.util.*;
public class AOJ_0154_2{
void run(){
Scanner sc = new Scanner(System.in);
while(true){
int m = sc.nextInt();
if(m==0){
break;
}
int[] value = new int[m];
int[] num = new int[m];
for(int i = 0... | Main.java:3: error: class AOJ_0154_2 is public, should be declared in a file named AOJ_0154_2.java
public class AOJ_0154_2{
^
1 error
|
s635424170 | p00154 | Java | import java.util.*;
public class AOJ_0154_2{
void run(){
Scanner sc = new Scanner(System.in);
while(true){
int m = sc.nextInt();
if(m==0){
break;
}
int[] value = new int[m];
int[] num = new int[m];
for(int i = 0... | Main.java:3: error: class AOJ_0154_2 is public, should be declared in a file named AOJ_0154_2.java
public class AOJ_0154_2{
^
1 error
|
s054702031 | p00154 | C++ | #include <iostream>
#include <cmath>
#include <string>
using namespace std;
const int MAX_M = 7, MAX_B = 10, MAX_N = 1000;
int m,g,n;
int a[MAX_M], b[MAX_M];
int dp[MAX_M + 1][MAX_N + 1];
int main()
{
while(cin >> m && m) {
for(int i = 0; i < m; i++)
cin >> a[i] >> b[i];
memset(dp, 0... | a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
18 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cmath>
+++ |+#include <cstrin... |
s729132330 | p00154 | C++ | #include<iostream>
using namespace std;
long long int dp[1001];
int a[8],b[8];
int main(void){
int n,g;
while(1){
memset(dp,0,sizeof(dp));
scanf("%d",&n);
if(n==0)break;
for(int i=0;i<n;i++){
scanf("%d%d",&a[i],&b[i]);
}
dp[0]=1;
for(int i=0;i<n;i++){
for(int j=1000;j>=0;j--){
for(int k=1;k<=... | a.cc: In function 'int main()':
a.cc:9:17: error: 'memset' was not declared in this scope
9 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+... |
s576206929 | p00154 | C++ | #include <iostream>
#include <queue>
#include <set>
#include <vector>
using namespace std;
int as[7];
int bs[7];
int m;
int sums[100 * 10 + 1];
void solve(int n, int sum) {
if (sum > 1000)
return;
if (n == m) {
sums[sum]++;
return;
}
for (int i = 0; i <= bs[n]; i++) {
solve(n + 1, sum + (i * as[n]));
}
}
... | a.cc: In function 'int main()':
a.cc:24:17: error: 'memset' was not declared in this scope
24 | memset(sums, 0, sizeof(sums));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <set>
+++... |
s877333365 | p00155 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_HEAP_SIZE 500001 /* 最大ヒープ領域(ヒープ配列を1オリジンで持つため500000+1) */
#define MAX_BUILDING_NUM 101 /* 最大ビル数(1オリジン) */
#define INFINITE_VAL 100000000
#define FIX 1
#define NOT_FIX 0
#define MAX_MOVING_DISTAN... | main.c: In function 'inputBuildingData':
main.c:42:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
42 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s050367333 | p00155 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <climits>
#include <queue>
using namespace std;
typedef pair<double,int> P;
const double INF = 1000000000;
struct edge { int to; double cost; };
vector<edge> G[1001];
void solve(int s, int g) {
double d[1001]; fill(d, d+1001, I... | a.cc: In function 'int main()':
a.cc:66:52: error: 'sqrt' was not declared in this scope
66 | G[b[i]].push_back((edge){b[j], sqrt(cost)});
| ^~~~
|
s977590425 | p00155 | C++ | #include<bits/stdc++.h>
using namespace std;
const int EPS = 1e-6;
struct Building{
double x,y;
}
struct Edge{
int to;
double dist;
Edge(){}
Edge(int to_c, double dist_c){
to = to_c; dist = dist_c;
}
};
struct Data{
int n, cost;
Data(){}
Data(int n_c, int cost_c){
n = n_c; cost = cost_c;
}
bool opera... | a.cc:8:2: error: expected ';' after struct definition
8 | }
| ^
| ;
a.cc:26:1: error: expected type-specifier before '}' token
26 | }
| ^
a.cc:26:2: error: expected ';' after struct definition
26 | }
| ^
| ;
a.cc: In function 'int main()':
a.cc:48:39: error: 'GetDistance' was... |
s633626025 | p00155 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
const double EPS = 1e-4;
struct Building{
int x, y;
};
struct Edge{
int to;
double cost;
Edge(){}
Edge(const int &_to, const double &_cost){
to = _to; cost = _cost;
}
};
struct Data{... | a.cc: In function 'double GetDistance(const Building&, const Building&)':
a.cc:38:16: error: 'sqrt' was not declared in this scope
38 | return sqrt(dx*dx + dy*dy);
| ^~~~
|
s242036981 | p00155 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
const double EPS = 1e-4;
struct Building{
int x, y;
};
struct Edge{
int to;
double cost;
Edge(){}
Edge(const int &_to, const double &_cost){
to = _to; cost = _cost;
}
};
struct Data{... | a.cc: In function 'double GetDistance(Building&, Building&)':
a.cc:38:16: error: 'sqrt' was not declared in this scope
38 | return sqrt(dx*dx + dy*dy);
| ^~~~
|
s769637511 | p00155 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include<cstring>
#include<functional>
using namespace std;
typedef pair<double, int> P;
priority_queue<P, vector<P>, greater<P>> Q;
#define MAX_N 1005
int x[MAX_N], y[MAX_N]; double dist[MAX_N];
vector<int>path[MAX_N]; vector<P>X[MAX_N];
void dijkstra(int a, int b) {... | a.cc: In function 'void dijkstra(int, int)':
a.cc:14:22: error: expected primary-expression before ';' token
14 | for (int i = ; i < MAX_N; i++) { path[i].clear(); }
| ^
|
s997722827 | p00155 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include<cstring>
#include<functional>
using namespace std;
typedef pair<double, int> P;
priority_queue<P, vector<P>, greater<P>> Q;
#define MAX_N 1005
int x[MAX_N], y[MAX_N]; double dist[MAX_N];
vector<int>path[MAX_N]; vector<P>X[MAX_N];
void dijkstra(int a, int b) {... | a.cc: In function 'void dijkstra(int, int)':
a.cc:14:22: error: expected primary-expression before ';' token
14 | for (int i = ; i < MAX_N; i++) { path[i].clear(); }
| ^
|
s910634520 | p00155 | C++ | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#d... | a.cc: In function 'void dijkstra(int)':
a.cc:78:27: error: no match for 'operator<' (operand types are 'std::pair<int, int>' and 'int')
78 | if(d[from]<p.fi) continue;
| ~~~~~~~^
| |
| std::pair<int, int>
In file i... |
s891629964 | p00155 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
struct Point : IComparable
{
internal int to;
internal double dist;
public Point(int to, double dist)
{
this.to = to;
this.dist = dist... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s319338920 | p00155 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>... | a.cc: In function 'int main()':
a.cc:77:45: error: 'a' was not declared in this scope
77 | rep(i,edge[now.second].size(a)){
| ^
a.cc:34:32: note: in definition of macro 'rep'
34 | #define rep(i,n) for(int i=0;i<n;i++)
| ... |
s785733595 | p00155 | C++ |
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
using namespace std;
const int N=1001;
//near equal?
int F(double x,double y){return fabs(x-y)<1e-9;}
//IÉÜÜêévÌCfbNX
int G(const vector<int>&I,int v){return find(I.begin(),I.end(),v)-I.begin()+1;}
int main()
{
int n,m,i,j,b,... | a.cc: In function 'int G(const std::vector<int>&, int)':
a.cc:12:41: error: 'find' was not declared in this scope
12 | int G(const vector<int>&I,int v){return find(I.begin(),I.end(),v)-I.begin()+1;}
| ^~~~
|
s094018449 | p00155 | C++ | #include <iostream>
#include <cmath>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdlib>
#include <ctime>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef pair<double, int> state;
double memo[100];
int pre[100];
int name[100];
double x[100];
double y[100]... | a.cc: In function 'int main()':
a.cc:39:7: error: 'memset' was not declared in this scope
39 | memset(pre, -1, sizeof(pre));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <ctime>
+++ |+#include <cstring... |
s949743442 | p00155 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <map>
#include <set>
#include <cstring>
#include <climits>
#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
usi... | a.cc: In function 'int main()':
a.cc:52:61: error: 'pow' was not declared in this scope
52 | double dis = sqrt( pow((float)(x[i] - x[j]), 2) + pow((float)(y[i] - y[j]), 2) );
| ^~~
a.cc:52:55: error: 'sqrt' was... |
s638157455 | p00155 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
using namespace std;
int n, x[1001], y[1001], m, s[1001], g[1001],... | a.cc: In function 'int main()':
a.cc:63:42: error: 'DBL_MAX' was not declared in this scope
63 | vtx[i] = DBL_MAX;
| ^~~~~~~
a.cc:10:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>... |
s253948065 | p00155 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <cassert>
using namespace std;
const int MAX_V = 1001;
const int INF = INT_MAX;
struct Edge {
int to;
int cost;
};
int ... | a.cc:16:19: error: 'INT_MAX' was not declared in this scope
16 | const int INF = INT_MAX;
| ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
11 | #include <cassert>
+++ |+#include <climits>
12 |
a.cc: In fu... |
s401285691 | p00155 | C++ | #include <iostrerm>
#include <memory>
using namespace std;
int x[1001], y[1001];
bool v[1001];
int p[1001];
int d[1001];
int edge[1001][1001];
int INF = (1 << 20);
void compute(int i, int j) {
int temp = (x[i] - x[j]) * (x[i] - x[j]) - (y[i] - y[j]) * (y[i] - y[j]);
if (temp <= 2500) edge[i][j] = temp;
}
void d... | a.cc:1:10: fatal error: iostrerm: No such file or directory
1 | #include <iostrerm>
| ^~~~~~~~~~
compilation terminated.
|
s129477783 | p00155 | C++ | #include <map>
using namespace std;
multimap<double,int> mp;
struct bir {
double x,y,m;
int to[1001],fr;
};
bir b[1000];
multimap<double,int>::iterator it;
int search(int s,int e) {
int n,i;
double m,k;
b[s].m=0; b[s].fr=-1;
mp.insert(multimap<double,int>::value_type(0,s));
while(!mp.empty()) {
it=mp.be... | a.cc: In function 'int search(int, int)':
a.cc:26:27: error: 'sqrt' was not declared in this scope
26 | k=sqrt((b[n].x-b[b[n].to[i]].x)*(b[n].x-b[b[n].to[i]].x)+(b[n].y-b[b[n].to[i]].y)*(b[n].y-b[b[n].to[i]].y));
| ^~~~
a.cc: In function 'int main()':
a.cc:39:8... |
s662955058 | p00156 | Java |
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Map.Entry;
public class Sample {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
int n = scanner.nextInt();
if (n == 0)
break;
Map<Integer, Integer> memo = new... | Main.java:7: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
^
1 error
|
s670649645 | p00156 | C | tdio.h> // printf(), fprintf(), scanf()
#include <stdlib.h> // exit()
#include <stdbool.h>
#define SZ_FIELD 100
#define QUE_SIZE 10000
typedef struct que_tbl
{
int x;
int y;
} que_t;
int N, M;
char field[SZ_FIELD][SZ_FIELD + 1];
que_t queue[QUE_SIZE];
int que_in;
int que_out;
void
cleanup(int eco... | main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | tdio.h> // printf(), fprintf(), scanf()
| ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
... |
s353664946 | p00156 | C | #include <iostream>
#include <vector>
#include <string>
#include <queue>
using namespace std;
const int INF = 1 << 30;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
class State
{
public:
int x, y, cost;
bool water;
State(int _x, int _y, int _cost, bool _water)
:x(_x), y(_y), cost(_cost), ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s804925782 | p00156 | C++ | def ReadMap(n, m):
Map = [0] * m
for i in range(m):
a = raw_input()
b = list(a)
if a.count('&')>0:
j = a.index('&')
PosCas = [j, i]
b[j] = '.'
Map[i] = b
return Map, PosCas
def fill(SP, c1, c2):
for x, y in SP:
try:
if Map[y][x] != c1:continue
except: continue
... | a.cc:1:1: error: 'def' does not name a type
1 | def ReadMap(n, m):
| ^~~
|
s869765366 | p00156 | C++ | #include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
#define MAX_N 1000
int X[MAX_N][MAX_N], dist[MAX_N][MAX_N], W, H, gx, gy; char c;
int main() {
while (true) {
cin >> W >> H; memset(dist, 127, sizeof(dist)); queue<pair<int, int> >Q;
memset(X, 127, sizeof(X));
if (W == ... | a.cc: In function 'int main()':
a.cc:25:25: error: 'Q' was not declared in this scope
25 | while (!Q.empty()) {
| ^
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
41 | }
| ^
|
s688962719 | p00156 | C++ | #include <iostream>
#include <queue>
#include <string>
using namespace std;
typedef pair<int, int> P;
const int INF = 10000;
const int MAX = 100;
const int dx[] = {0, -1, 0, 1};
const int dy[] = {-1, 0, 1, 0};
int m,n,sx,sy;
int step[MAX + 2][MAX + 2];
char field[MAX + 2][MAX + 2];
int main()
{
while(cin >> n >>... | a.cc: In function 'int main()':
a.cc:19:9: error: 'memset' was not declared in this scope
19 | memset(step, INF, sizeof(step));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <queue>
+++ |+#include <... |
s008549586 | p00156 | C++ | #include <cstdio>
#include <cstring>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
#define mp make_pair
typedef pair<int, int> P;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int N, M;
char maze[110][110];
unsigned int minp[110][110];
int main() {
for(;;) {
memset... | a.cc: In function 'int main()':
a.cc:79:37: error: 'INT_MAX' was not declared in this scope
79 | unsigned int minv = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 |... |
s634181553 | p00156 | C++ | #include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
#define mp make_pair
typedef pair<int, int> P;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int N, M;
char maze[110][110];
unsigned int minp[110][110];
int main() {
for(;;) {
memset(minp, -1, sizeof minp);
scan... | a.cc: In function 'int main()':
a.cc:71:37: error: 'INT_MAX' was not declared in this scope
71 | unsigned int minv = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 |... |
s808557210 | p00156 | C++ | #include<iostream>
#include<queue>
using namespace std;
int n,m;
int gx,gy;
int INF=1000000;
char fie[120][120];
int jp[120][120];
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
typedef pair<int,int> P;
typedef pair<P,int> PP;
void bfs(){
queue<PP> que;
for(int i=0;i<=m;i++){
for(int j=0;j<=n;j++){
jp[j][i]=INF;
... | a.cc: In function 'int main()':
a.cc:58:17: error: 'memset' was not declared in this scope
58 | memset(fie,'.',sizeof(fie));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<queue>
+++ ... |
s442577424 | p00156 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int H, W;
char grid[101][101];
int const dx[4] = {-1,1,0,0};
int const dy[4] = {0,0,-1,1};
int memo[101][101];
inline bool IN(int x, int y) {
return 0<=x && x<W && 0<=y && y<H;
}
int const INF = 1<<29;
int main() {
while(cin >>... | a.cc: In function 'int main()':
a.cc:36:5: error: 'memset' was not declared in this scope
36 | memset(memo, -1, sizeof(memo));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
+++ |+#include <cstring>
... |
s453307103 | p00157 | C | 6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 2
5 4
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
2 2
5 4
6 6
4
1 1
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 6
| ^
|
s537202143 | p00157 | C | #include<stdio.h>
int LIS(void);
int h[201], r[201], m, n;
int main(void)
{
int i, j, t;
while(1)
{
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++)
scanf("%d%d",&h[i] ,&r[i]);
for(i=0;i<n+m;i++)
{
for(j=0;j<n+m;j++)
{
if(h[i]<h[j])
{
t=h[i];
h[i]=h[j];
h[j]=t;
t=r[i];
r[i]=r[j];
r[j]=t;... | main.c: In function 'LIS':
main.c:117:26: error: expected ')' before '\U000030c4'
117 | if(r[k]<r[i] && h[k]<h[i]ツ && L[k]>=L[i])L[i]=L[k]+1;
| ~ ^~
| )
main.c:117:28: error: stray '\343' in program
117 | if(r[k]<r[i] && h[k]<h[i]<U+30C4><U+3000>&& L[k]>=L... |
s037863308 | p00157 | C | #include<stdio.h>
int LIS(void);
int h[201], r[201], m, n;
int main(void)
{
int i, j, t;
while(1)
{
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++)
scanf("%d%d",&h[i] ,&r[i]);
for(i=0;i<n+m;i++)
{
for(j=0;j<n+m;j++)
{
if(h[i]<h[j])
{
t=h[i];
h[i]=h[j];
h[j]=t;
t=r[i];
r[i]=r[j];
r[j]=t;
}
if(... | main.c: In function 'LIS':
main.c:102:26: error: expected ')' before '\U000030c4'
102 | if(r[k]<r[i] && h[k]<h[i]ツ && L[k]>=L[i])L[i]=L[k]+1;
| ~ ^~
| )
main.c:102:28: error: stray '\343' in program
102 | if(r[k]<r[i] && h[k]<h[i]<U+30C4><U+3000>&& L[k]>=L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.