submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s622754409 | p00202 | C++ | #include<iostream>
#define N 1000001
using namespace std;
int main(){
int p[N]={0};
for(int i=3;i<N;i+=2) p[i] = 1;
p[2] = 1;
for(int i=3;i<=1000;i+=2){
if(p[i]==1){
for(int j=2*i;j<N;j+=i) p[j] = 0;
}
}
int n,x;
while(cin >> n >> x){
if(n==0&&x==0) break;
int t[x+1];
for(int i=0... | a.cc:44:6: error: stray '#' in program
44 | Case # Verdict CPU Time Memory In Out Case Name
| ^
a.cc:45:6: error: stray '#' in program
45 | Case #1 : Accepted 00:92 8976 0 0 judge_data
| ^
a.cc:49:13: error: stray '#' in program
49 | Judge Input # ... |
s833364587 | p00202 | C++ | #include<iostream>
using namespace std;
#define MAX_N 1000000
int prime[MAX_N+1];
bool is_prime[MAX_N+1];
int main(){
int p = 0;
for(int i=0;i<=MAX_N;i++) is_prime[i] = true;
is_prime[0] = is_prime[1] = false;
for(int i=2;i<=MAX_N;i++){
if(is_prime[i]){
prime[p++] = i;
for(int j=2*i;j<=MAX_N;j... | a.cc: In function 'int main()':
a.cc:32:14: error: expected unqualified-id at end of input
32 | for(int
| ^
a.cc:32:14: error: expected ';' at end of input
32 | for(int
| ^
| ;
a.cc:32:14: error: expected primary-expression at end of input
a.cc:... |
s278649940 | p00202 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
//ツ素ツ青板青カツ青ャ
const int NUM = 1000000;
bool prime[NUM];
prime[0] = false;
prime[1] = false;
for(int i=2;i<NUM;i++)
prime[i] = true;
for(int i=2;i*i<NUM;i++)
for(int k=2;i*k<NUM;k++)
prime[i*k]=false;
while(true){
... | a.cc:24:21: error: stray '#' in program
24 | money[0] = true;#include<iostream>
| ^
a.cc: In function 'int main()':
a.cc:24:22: error: 'include' was not declared in this scope
24 | money[0] = true;#include<iostream>
| ^~~~~~~
a.cc:24:38: error: expected... |
s883204916 | p00202 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int main(){
bool sosuu[1000011];
bool dp[1000011];
for(int i=0;i<=1000000;i++){
sosu[i]=0;
}
for(int i=2;i<=500000;i++){
if(sosuu[i]==0){
for(int j=i;j<=1000000;j+=i){
... | a.cc: In function 'int main()':
a.cc:15:25: error: 'sosu' was not declared in this scope; did you mean 'sosuu'?
15 | sosu[i]=0;
| ^~~~
| sosuu
|
s115837972 | p00202 | C++ | #include <stdio.h>
#include <windows.h>
int n,m[30];
bool prime[1000000];
bool c[1000000];
void saiki(int total){
int i;
if(total==0){
return;
}
if(total<0){
return;
}
for( i=0 ; i<n ; i++){
total-=m[i];
if(c[total]==1)continue;
if(total>=0){
c[total]=1;
}
saiki(total);
}
}
int main(void)... | a.cc:2:10: fatal error: windows.h: No such file or directory
2 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s335066340 | p00202 | C++ | #include <stdio.h>
int n,m[30];
/*
bool prime[1000000];
*/
bool c[1000000];
void saiki(int total){
int i;
if(total<=0){
return;
}
for( i=0 ; i<n ; i++){
total-=m[i];
if(c[total]==1)continue;
if(total>=0){
c[total]=1;
}
saiki(total);
}
}
int check(int prime){
int flg=0,i;
if(prime%2==0)return ... | a.cc: In function 'int main()':
a.cc:62:34: error: 'x' was not declared in this scope
62 | scanf("%d%d",&n,&x);
| ^
|
s702980441 | p00202 | C++ | #include <stdio.h>
int n,m[30];
/*
bool prime[1000000];
*/
bool c[1000000];
void saiki(int total){
int i;
if(total<=0){
return;
}
for( i=0 ; i<n ; i++){
total-=m[i];
if(c[total]==1)continue;
if(total>=0){
c[total]=1;
}
saiki(total);
}
}
int check(int prime){
int flg=0,i;
if(prime%2==0)return ... | a.cc: In function 'int main()':
a.cc:62:34: error: 'x' was not declared in this scope
62 | scanf("%d%d",&n,&x);
| ^
|
s684487134 | p00202 | C++ | #include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
const int N = 1000000;
int prime[N+1];
int dish[30];
int n, x;
int max_val;
void setPrime()
{
memset(&prime[0], 0, sizeof(int) * (N+1));
prime[2] = 1;
for(int i=2; i<=N; i++)
{
bool is_prime = true;
int limit = sqrt(i);
for(int... | a.cc: In function 'void setPrime()':
a.cc:16:9: error: 'memset' was not declared in this scope
16 | memset(&prime[0], 0, sizeof(int) * (N+1));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <math.h>
... |
s735622867 | p00202 | C++ | #include<iostream>
using namespace std;
bool prime[1000001];
bool dp[1000001];
int menu[31];
void seive(int s){
for(int i=0;i<=s;i++)prime[i]=true;
prime[0]=prime[1]=false;
for(int i=2;i<=s;i++){
if(prime[2]==true){
for(int j=i*2;j<=s;j+=i){
prime[j]=false;
}
}
}
}
int main(void){
seive(1000000);
... | a.cc: In function 'int main()':
a.cc:25:17: error: 'memset' was not declared in this scope
25 | memset(dp,false,sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+... |
s439769978 | p00202 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAX = 1000000;
bool isPrime[MAX] = {0};
void sieve(){
bool find[MAX] = {0};
int i;
for(i=2;i*i < MAX;i++){
if(find[i]) continue;
isPrime[i] = true;
for(int j=i;... | a.cc:59:1: error: 'b' does not name a type
59 | b
| ^
|
s267917429 | p00202 | C++ | #include <iostream>
#define N 1000000
using namespace std;
int main(void){
bool isprime[N+1];
for(int i=0;i<=N;i++)
isprime[i]=true;
isprime[0]=isprime[1]=false;
for(int i=2;i<=N;i++)
if(isprime[i])
for(int j=2*i;j<=N;j+=i)
isprime[j]=false;
bool budget[N+1];
int n,m;
while(cin >> n>>m,n|m){
for(... | a.cc: In function 'int main()':
a.cc:24:50: error: 'tpm' was not declared in this scope; did you mean 'tmp'?
24 | if(budget[j]&&(j+tpm)<=m)
| ^~~
| tmp
|
s984305892 | p00202 | C++ | require 'Prime'
loop do
n, x = gets.split.map(&:to_i)
break if n.zero? && x.zero?
pb = [true]
n.times.map{ gets.to_i }.each do |p|
(0..x-p).each do |i|
pb[i+p] = true if pb[i]
end
end
na = true
x.step(2, -1) do |i|
if pb[i] && i.prime?
puts i
na = false
break
end
... | a.cc:1:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
1 | require 'Prime'
| ^~~~~~~
a.cc:8:6: error: too many decimal points in number
8 | (0..x-p).each do |i|
| ^~~~
a.cc:1:1: error: 'require' does not name a type
1 | require 'Prime'
|... |
s984088757 | p00202 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>
using namespace std;
vector<int> primes;
void make_primes( int lim ) {
vector<bool> vs( lim + 1 );
fill( vs.begin(), vs.end(), true );
vs[ 0 ] = vs[ 1 ] = false;
const int l = (int)sqrt( lim );
fo... | a.cc: In function 'void make_primes(int)':
a.cc:26:11: error: 'priems' was not declared in this scope; did you mean 'primes'?
26 | priems.push_back( i );
| ^~~~~~
| primes
|
s065609439 | p00202 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>
using namespace std;
vector<int> primes;
void make_primes( int lim ) {
vector<bool> vs( lim + 1 );
fill( vs.begin(), vs.end(), true );
vs[ 0 ] = vs[ 1 ] = false;
const int l = (int)sqrt( lim );
fo... | a.cc: In function 'void make_primes(int)':
a.cc:26:11: error: 'priems' was not declared in this scope; did you mean 'primes'?
26 | priems.push_back( i );
| ^~~~~~
| primes
|
s855516053 | p00202 | C++ | from datetime import datetime
def measure(f):
measure_start = datetime.now()
v = f()
print(datetime.now() - measure_start)
return v
input = raw_input
range = xrange
def init():
table = [True] * 1000001
table[0] = False
table[1] = False
n = len(table)
def prime(p):
for... | a.cc:1:1: error: 'from' does not name a type
1 | from datetime import datetime
| ^~~~
|
s656565644 | p00203 | Java |
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import scala.inline;
import scala.noinline;
public class Main {
public static void main(String[] args) throws IOException {
new Main().run();
}
private void run() throws IOException {
Scanner scanner = new Scanner(System.in);
w... | Main.java:6: error: package scala does not exist
import scala.inline;
^
Main.java:7: error: package scala does not exist
import scala.noinline;
^
2 errors
|
s320207554 | p00203 | Java | mport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.Integer.parseInt;
/**
* A New Plan of Aizu Ski Resort
* PCK2009 ??????9
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(n... | Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
Main.java:5: error: class, interf... |
s581467308 | p00203 | Java | import java.util.*;
public class Main {
Scanner sc;
int w,h;
int[][] map;
int[][] route;
void printMap(){
for(int i=0;i<h+2;i++) {
for(int j =0;j<w+2;j++) {
System.out.print(route[i][j] + " ");
}
System.out.print(" ");
for(int j =0;j<w+2;j++) {
System.out.print(map[i][j] + " ");
}
Sy... | Main.java:54: error: cannot find symbol
new Main.run();
^
symbol: class run
location: class Main
1 error
|
s104353334 | p00203 | Java | import java.util.Scanner;
public class Main2 {
static int X,Y,ans;
static int[][] field;
static int[][] count;
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while(true){
X=cin.nextInt();
Y=cin.nextInt();
ans=0;
... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s771443535 | p00203 | Java | import java.util.Scanner;
public class Main2 {
static int H,W;
static int[][] field;
static int[][] dp;
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
for(;;){
W=cin.nextInt();
H=cin.nextInt();
if(W+H==0)break;
field=new int[H+2][W];
dp=new int[H+2][W];
for(in... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s084307899 | p00203 | C | #include<iostream>
using namespace std;
int main(){
int x,y;
while(cin>>x>>y,x){
int D[16][16],P[16][16],ans=0;
for(int i=0;i<256;i++)P[i/16][i%16]=0;
for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
for(int i=0;i<x;i++)if(!D[0][i])P... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s243281635 | p00203 | C | #include<iostream>
using namespace std;
int main(){
int x,y;
while(cin>>x>>y,x){
int D[16][16],P[16][16],ans=0;
for(int i=0;i<256;i++)P[i/16][i%16]=0;
for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
for(int i=0;i<x;i++)if(!D[0][i])P... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s218916988 | p00203 | C | #include<iostream>
using namespace std;
int main(){
int x,y;
while(cin>>x>>y,x){
int D[16][16],P[16][16],ans=0;
for(int i=0;i<256;i++)P[i/16][i%16]=0;
for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
for(int i=0;i<x;i++)if(!D[0][i])P... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s411405185 | p00203 | C | main(){ans, num[15][15], w, h, i, j, map[15][15];while (1){scanf("%d%d", &w, &h);if (w + h == 0){break;}memset(map, -1, sizeof(map));for (i = 0; i < h; i++){for (j = 0; j < w; j++){scanf("%d", &map[i][j]);}}memset(num, 0, sizeof(num));for (i = 0; i < w; i++){if (map[0][i] != 1){num[0][i] = 1;}}for (i = 1; i < h; i++){f... | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){ans, num[15][15], w, h, i, j, map[15][15];while (1){scanf("%d%d", &w, &h);if (w + h == 0){break;}memset(map, -1, sizeof(map));for (i = 0; i < h; i++){for (j = 0; j < w; j++){scanf("%d", &map[i][j]);}}memset(num, 0, sizeof(num));for (i = 0;... |
s477048400 | p00203 | C | #include<stdio.h>
int dx[3] = {-1, 0, 1};
int dy[3] = {1, 1, 1};
int main(void)
{
int **map, f1, f2, f3, **temp, x, y, sum, px, py;
while(scanf("%d %d", &x, &y) && y > 0)
{
map = new int *[y];
temp = new int *[y];
sum = 0;
//マップ土地&動的計画作成
for(f1 = 0; f1 < y; f1++)
{
map[f1] = new int [x];
temp[... | main.c: In function 'main':
main.c:12:23: error: 'new' undeclared (first use in this function)
12 | map = new int *[y];
| ^~~
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:26: error: expected ';' before 'int'... |
s711211340 | p00203 | C | #include<stdio.h>
int dx[3] = {-1, 0, 1};
int dy[3] = {1, 1, 1};
int main(void)
{
int **map, f1, f2, f3, **temp, x, y, sum, px, py;
while(scanf("%d %d", &x, &y) && y > 0)
{
map = new int *[y];
temp = new int *[y];
sum = 0;
//マップ土地&動的計画作成
for(f1 = 0; f1 < y; f1++)
{
map[f1] = new int [x];
temp[... | main.c: In function 'main':
main.c:12:23: error: 'new' undeclared (first use in this function)
12 | map = new int *[y];
| ^~~
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:26: error: expected ';' before 'int'... |
s170783991 | p00203 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int maps[20][20];
int course[20][20];
int X, Y;
void out();
int way(int y, int x){
else if(course[y][x] > 0) return course[y][x];
else if(maps[y][x] == 1) return 0;
else if(y >= Y) return 1;
else if(maps[y][x] == 2 && maps[y + 2][x] != 1) return cour... | a.cc: In function 'int way(int, int)':
a.cc:11:3: error: 'else' without a previous 'if'
11 | else if(course[y][x] > 0) return course[y][x];
| ^~~~
|
s368002811 | p00203 | C++ | #include<algorithm>
using namespace std;
int maps[20][20];
int course[20][20];
int X, Y;
int way(int y, int x){
if(course[y][x] > 0) return course[y][x];
else if(maps[y][x] == 1) return 0;
else if(y >= Y) return 1;
else if(maps[y][x] == 2 && maps[y + 2][x] != 1) return course[y][x] = way(y + 2, x);
else{
... | a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope
30 | cin >> X >> Y;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<algorithm>
+++ |+#include <iostream>
2 | using n... |
s608654069 | p00203 | C++ | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;
int fie... | a.cc:80:11: error: redefinition of 'const int INF'
80 | const int INF = ~(1<<31) / 2;
| ^~~
a.cc:16:11: note: 'const int INF' previously defined here
16 | const int INF = ~(1<<31) / 2;
| ^~~
a.cc:82:5: error: redefinition of 'int field [15][15]'
82 | int field[15][15];
| ... |
s846308189 | p00203 | C++ | #include<iostream>
??
using namespace std;
??
int main() {
????????int x, y;
????????int skimap[15][15] = {};//x = j y = i
????????int dp[15][15] = {};//x = j y = i
????????while (cin >> x >> y, x * y) {//
????????????????int flyover = 0;
????????????????for (int i = 0; i < y; i++) {
????????????????????????for (int j ... | a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??
| ^
a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
|
s976910112 | p00203 | C++ | 5 5
0 0 0 0 1
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
5 5
0 0 1 0 0
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
15 15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 ... | a.cc:29:3: error: invalid digit "8" in octal constant
29 | 0 08
| ^~
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 5
| ^
a.cc:34:13: error: '$' does not name a type
34 | 512:{ei1629}$ cat AOJ203.cpp
| ^
In file included from /usr/include/c++/14/bits/stl... |
s052243213 | p00203 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int main(){
int n,m;
int masu[17][17];
int ura[17][17];
while(1){
scanf("%d%d",&n,&m);
if(n==0 && m==0){
break;
}
for(int i=0;i<17;i++){
for(int j=0;j<17;j++){
masu[i][j]=... | a.cc: In function 'int main()':
a.cc:34:70: error: expected ';' before '}' token
34 | case 2:if(ura[2][i]==0){masu[2][i]+=1};break;
| ^
| ... |
s270088512 | p00203 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int n,m;
int masu[17][17];
int ura[17][17];
int motom(){
for(int i=0;i<17;i++){
for(int j=0;j<17;j++){
masu[i][j]=0;
}
}
for(int i=1;i<=m;i++){
switch(ura[1][i]){
c... | a.cc:80:2: error: stray '#' in program
80 | }#include<cstdio>
| ^
a.cc:80:3: error: 'include' does not name a type
80 | }#include<cstdio>
| ^~~~~~~
a.cc:90:13: error: redefinition of 'int n'
90 | int n,m;
| ^
a.cc:11:13: note: 'int n' previously declared here
11 | ... |
s509758791 | p00203 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
int masu[17][17];
int ura[17][17];
cin>>n>>m;
for(int i=0;i<17;i++){
for(int j=0;j<17;j++){
masu[i][j]=ura[i][j]=0;
}
}
for(int i=0;i<n;i++){
for(int j=1;j<=m;j++){
cin>>masu[i][j];
}
}
for(int j=1;j<=m;j++){
if(masu[i][j]!=1){
... | a.cc: In function 'int main()':
a.cc:23:25: error: 'i' was not declared in this scope
23 | if(masu[i][j]!=1){
| ^
|
s256733642 | p00203 | C++ | 5 5
0 0 0 0 1
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
5 5
0 0 1 0 0
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
15 15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 ... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 5
| ^
|
s321206808 | p00203 | C++ | #include<iostream>
using namespace std;
int DP[17][17];
int field[17][17];
int x,y;
int main(){
while(true){
cin >> x >> y;
if(!x && !y)
return 0;
for(int i=1; i<=y; i++)
for(int k=1; k<=x; k++)
cin >> field[i][k];
for(int i=1; i<=x; i++)
field[y+1][i] = 0;
for(int i=1; i<=y+1; i++)
f... | a.cc: In function 'int main()':
a.cc:35:58: error: 'n' was not declared in this scope
35 | if(field[n][k] == 0){
| ^
a.cc: At global scope:
a.cc:53:1: error: expected declaration before '}' token
53 | }
... |
s406123283 | p00203 | C++ | #include<iostream>
using namespace std;
int DP[17][17];
int field[17][17];
int x,y;
int main(){
while(true){
cin >> x >> y;
if(!x && !y)
return 0;
for(int i=1; i<=y; i++)
for(int k=1; k<=x; k++)
cin >> field[i][k];
for(int i=1; i<=x; i++)
field[y+1][i] = 0;
for(int i=1; i<=y+1; i++)
f... | a.cc: In function 'int main()':
a.cc:35:58: error: 'n' was not declared in this scope
35 | if(field[n][k] == 0){
| ^
a.cc: At global scope:
a.cc:53:1: error: expected declaration before '}' token
53 | }
... |
s816961985 | p00203 | C++ | #include<iostream>
using namespace std;
int DP[17][17];
int field[17][17];
int x,y;
int main(){
while(true){
cin >> x >> y;
if(!x && !y)
return 0;
for(int i=1; i<=y; i++)
for(int k=1; k<=x; k++)
cin >> field[i][k];
for(int i=1; i<=x; i++)
field[y+1][i] = 0;
for(int i=1; i<=y+1; i++)
f... | a.cc: In function 'int main()':
a.cc:35:58: error: 'n' was not declared in this scope
35 | if(field[n][k] == 0){
| ^
a.cc: At global scope:
a.cc:53:1: error: expected declaration before '}' token
53 | }
... |
s240787724 | p00203 | C++ | #include <iostream>
using namespace std;
void solve(int f[20][20] , w , h ){
int dp[20][20] = {0};
for(int x=1 ; x <= w ; x++ ){
dp[1][x] = 1;
}
for(int y=1 ; y <= h-1 ; y++ ){
for(int x=1 ; x <= w ; x++ ){
if( f[y][x] == 0 ){
if( f[y+1][x-1] == 0 ) dp[y+1][... | a.cc:4:28: error: 'w' has not been declared
4 | void solve(int f[20][20] , w , h ){
| ^
a.cc:4:32: error: 'h' has not been declared
4 | void solve(int f[20][20] , w , h ){
| ^
a.cc: In function 'void solve(int (*)[20], int, int)':
a.cc:6:24: ... |
s159833178 | p00203 | C++ | #include<iostream>
using namespace std;
int w,h;
int s[40][40];
int dp[40][40];
int dx[]={-1,0,1};
int ret(int y,int x){
if(y>=h-1){
if(h-1==y&&s[y][x]==1)
return 0;
return 1;
}
if(dp[y][x]!=-1)
return dp[y][x];
if(s[y][x]==1)
return dp[y][x]=0;
if(s[y][x]==2){
return dp[y][x]=ret(y+2,x);
}
int ans=0;... | a.cc: In function 'int main()':
a.cc:38:17: error: 'memset' was not declared in this scope
38 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ ... |
s969300233 | p00203 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int x,y;
int fie[20][20];
long long int dp[20][20];
long long int ans=0;
int main(void){
while(1){
scanf("%d%d",&x,&y);
if(x==0 && y==0)break;
memset(fie,0,sizeof(fie));
memset(dp,0,sizeof(dp));
ans=0;
for(int i=0;i<y;i++){
for(int j=0;j<x;j++... | a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
15 | memset(fie,0,sizeof(fie));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
+++ |... |
s978389623 | p00203 | C++ | #include<iostream>
using namespace std;
int X, Y;
int status[17][18]; //status[x][y]
int memo[17][18];
int i, j;
int count;
int check(int x, int y);
int main(){
while(1){
count = 0;
cin >> X >> Y;
if(X == 0 && Y == 0){break;}
else{
//フィールドの入力
//i行目について( 1 <= i <= Y+2 )
for(i = 1; i <= Y+2; i... | a.cc: In function 'int main()':
a.cc:55:33: error: 'memset' was not declared in this scope
55 | memset(memo, 0, sizeof(memo));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstrin... |
s535652424 | p00203 | C++ | #include <iostream>
using namespace std;
int w,h;
int map[16][16];
int dp[16][16][4][2];
int rec(int x,int y,int state,bool str){
if(state == 1 || x < 0 || x >= w) return 0;
if(state == 2 && !str) return 0;
if(y >= h-1) return 1;
if(dp[y][x][state][str] != -1) return dp[y][x][state][str];
int res;... | a.cc: In function 'int main()':
a.cc:21:9: error: 'memset' was not declared in this scope
21 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstr... |
s044838995 | p00204 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define PIE atan(1.0)*4
typedef struct nd{
int id;
//
int x, y;
int r;
int v;
//
double polar_r;
double polar_t;
//
int state; // 0:接近中,1:撃破, 2:到達
struct nd *next;
struct nd *prev;
bool dummy;
} node;
void initList(node **top,... | main.c: In function 'main':
main.c:60:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
60 | scanf_s("%d %d", &invaridR, &ufoNum);
| ^~~~~~~
| scanf
|
s086295699 | p00204 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define PIE atan(1.0)*4
typedef struct nd{
int id;
//
int x, y;
int r;
int v;
//
double polar_r;
double polar_t;
//
int state; // 0:接近中,1:撃破, 2:到達
struct nd *next;
struct nd *prev;
bool dummy;
} node;
void initList(node **top,... | main.c: In function 'main':
main.c:61:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
61 | scanf_s("%d %d", &invaridR, &ufoNum);
| ^~~~~~~
| scanf
|
s480954790 | p00204 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define PIE atan(1.0)*4
typedef struct nd{
int id;
//
int x, y;
int r;
int v;
//
double polar_r;
double polar_t;
//
int state; // 0:接近中,1:撃破, 2:到達
struct nd *next;
struct nd *prev;
bool dummy;
} node;
void initList(node **top,... | main.c: In function 'main':
main.c:65:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
65 | scanf_s("%d %d", &invaridR, &ufoNum);
| ^~~~~~~
| scanf
|
s374627591 | p00204 | C | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <vector>
// ???, ????????????
typedef std::complex<double> Point;
typedef Point Vector;
namespace std {
bool operator < (const Point &a, const Point &b){
return a.real() != b.real() ? a.real(... | main.c:1:10: fatal error: algorithm: No such file or directory
1 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s035812217 | p00204 | C | #include <stdio.h>
#include <complex.h>
#include <math.h>
double complex coordinate(double complex z, int v, int t){
return t*v*(-z/cabs(z))+z;
}
double theta(double complex z, int r, int i){
return carg(z+(z/cabs(z))*r*i*I);
}
struct UFO{
char discrim;
int v;
int radius;
double complex z0;
};
int main(){
in... | main.c: In function 'main':
main.c:76:16: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
76 | return NULL;
| ^~~~
main.c:77:1: error: expected declaration or statement at end of input
77 | }
| ^
main.... |
s928913582 | p00204 | C | #include <cstdio>
#include <cmath>
#include <cfloat>
#include <cstring>
#include <cassert>
#include <vector>
#include <algorithm>
using namespace std;
/* double extention Library. */
const double EPS = 1e-8;
bool eq(double a, double b)
{
return (fabs(a - b) <= EPS);
}
bool lt(double a, double b)
{
return (a - b <... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s188339633 | p00204 | C++ | ### main
while true
rlimit, n = gets.strip.split(' ').map{|s| s.to_i}
break if rlimit == 0 && n == 0
rlimit2 = rlimit ** 2
ufos = []
n.times.each do
x0, y0, r, v = gets.strip.split(' ').map{|s| s.to_i}
d2 = x0 ** 2 + y0 ** 2
d = Math.sqrt(d2)
vx = -x0.to_f * v / d
vy = -y0.to_f * v / ... | a.cc:1:1: error: stray '##' in program
1 | ### main
| ^~
a.cc:1:3: error: stray '#' in program
1 | ### main
| ^
a.cc:25:6: error: invalid preprocessing directive #puts
25 | #puts "t=#{t}"
| ^~~~
a.cc:31:8: error: invalid preprocessing directive #p
31 | #p ['u0'] + u0
... |
s310829887 | p00204 | C++ | #include<iostream>
#include<cfloat>
#include<cassert>
#include<cmath>
#include<vector>
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 ( dou... | a.cc: In function 'std::pair<Point, Point> getCrossPoints(Circle, Line)':
a.cc:93:16: error: 'project' was not declared in this scope
93 | Vector v = project(l, c1.c);
| ^~~~~~~
a.cc: At global scope:
a.cc:195:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1... |
s822626278 | p00204 | C++ | #include<iostream>
#include<cfloat>
#include<cassert>
#include<cmath>
#include<vector>
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 ( dou... | a.cc: In function 'std::pair<Point, Point> getCrossPoints(Circle, Line)':
a.cc:118:29: error: no match for 'operator/' (operand types are 'Point' and 'double')
118 | Vector e = (l.p2 - l.p1)/abs(l.p2 - l.p1);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
| | |
| ... |
s955887736 | p00204 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
using namespace std;
const double eps = 1e-7;
int xs[100], ys[100], rs[100], vs[100];
bool shoot[100];
inline int sq(int x) {
return x*x;
}
int main() {
int R, N;
while (cin >> R >> N,... | a.cc: In function 'int main()':
a.cc:39:72: error: 'atan2' was not declared in this scope
39 | double x = xs[k] - vs[k] * cos(atan2(xs[k], ys[k]));
| ^~~~~
a.cc:39:68: error: 'cos' was not declared in... |
s714388222 | p00204 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PIE atan(1.0)*4
typedef struct nd{
int id;
//
int x, y;
int r;
int v;
//
double polar_r;
double polar_t;
//
int state; // 0:接近中,1:撃破, 2:到達
struct nd *next;
struct nd *prev;
bool dummy;
} node;
void initList(node **top, int num) {
// 極座標変換... | a.cc: In function 'int main(int, char**)':
a.cc:59:17: error: 'fscanf_s' was not declared in this scope; did you mean 'fscanf'?
59 | fscanf_s(stdin, "%d %d", &invaridR, &ufoNum);
| ^~~~~~~~
| fscanf
|
s409750602 | p00204 | C++ | from math import sqrt,fabs,ceil,floor,pow,exp,log,sin,cos,tan,asin,acos,atan,atan2,pi
eps=1e-10
inf=float("inf")
class Angle: #angle. kaku.
def __init__(self,th):
self.th = float(th)%(2*pi)
def __float__(self):
return self.th
def __eq__(self,other):
return abs(float(self)-float(other))<eps or abs(abs(float... | a.cc:8:17: error: stray '#' in program
8 | class Angle: #angle. kaku.
| ^
a.cc:30:17: error: stray '#' in program
30 | class Vector: #point, vector. ten, bekutoru.
| ^
a.cc:99:25: error: stray '#' in program
99 | class DirSegLine: #directed line segment. ... |
s813042691 | p00204 | C++ | from math import sqrt
class Ufo:
def __init__(self,px,py,d,vd,ui):
self.pd=sqrt(px**2+py**2)
self.px=float(px)
self.py=float(py)
self.ex=self.px/self.pd
self.ey=self.py/self.pd
self.d=float(d)
self.vd=float(vd)
self.vx=-self.vd*self.ex
self.vy=-self.vd*self.ey
self.i=ui
def move(self):
self.pd ... | a.cc:50:65: error: stray '#' in program
50 | d = u.pd*abs(laserex*u.ey-laserey*u.ex) #u kara laser ni orosita suisen no nagasa
| ^
a.cc:1:1: error: 'from' does not name a type
1 | from math import sqrt
| ^~~~
|
s252325968 | p00204 | C++ | from math import sqrt
class Ufo:
def __init__(self,px,py,d,vd,ui):
self.pd=sqrt(px**2+py**2)
self.px=float(px)
self.py=float(py)
self.ex=self.px/self.pd
self.ey=self.py/self.pd
self.d=float(d)
self.vd=float(vd)
self.vx=-self.vd*self.ex
self.vy=-self.vd*self.ey
self.i=ui
def move(self):
self.pd ... | a.cc:40:34: error: invalid preprocessing directive #print
40 | #print u.i, "due to invade"
| ^~~~~
a.cc:46:18: error: invalid preprocessing directive #print
46 | #print "focus",neu.i
| ^~~~~
a.cc:47:18: e... |
s132844161 | p00204 | C++ | from math import sqrt,cos,atan2
class Ufo:
def __init__(self,px,py,d,vd,ui):
self.pd=sqrt(px**2+py**2)
self.px=float(px)
self.py=float(py)
self.fpd=self.pd
self.fpx=self.px
self.fpy=self.py
self.ex=self.fpx/self.fpd
self.ey=self.fpy/self.fpd
self.d=float(d)
self.vd=float(vd)
self.vx=-self.vd*sel... | a.cc:43:34: error: invalid preprocessing directive #print
43 | #print u.i, "due to invade"
| ^~~~~
a.cc:50:18: error: invalid preprocessing directive #print
50 | #print "focus",neu.i
| ^~~~~
a.cc:51:18: e... |
s875874588 | p00204 | C++ | #include <iostream>
#include <vector>
#include <math.h>
class UFO
{
private:
double dist; /* ??????????????????????????§????????¢ */
int speed; /* ??\????????? */
double rad; /* ?????\?§???? */
int r; /* UFO????????? */
bool alive;
public:
UFO(int x, int y, int r,int v);
bool IsAlive();
double EchoDis... | a.cc: In function 'int UFOShootingDownOperation()':
a.cc:107:16: error: unable to find numeric literal operator 'operator""a'
107 | while (1a) {
| ^~
|
s432229492 | p00204 | C++ | #include <iostream>
#include <vector>
#include <math.h>
class UFO
{
private:
double dist; /* ??????????????????????????§????????¢ */
int speed; /* ??\????????? */
double rad; /* ?????\?§???? */
int r; /* UFO????????? */
bool alive;
public:
UFO(int x, int y, int r,int v);
bool IsAlive();
double EchoDis... | a.cc: In function 'int UFOShootingDownOperation()':
a.cc:107:16: error: unable to find numeric literal operator 'operator""a'
107 | while (1a) {
| ^~
|
s256290165 | p00204 | C++ | /*
jin_matakich's geometry libraly
*/
#include <bits/stdc++.h>
using namespace std;
#define x() real()
#define y() imag()
#define EPS (1e-10)
#define INF (1e12)
#define SQ(a) ((a) * (a))
#define EQ(a, b) (abs((a) - (b)) < EPS)
#define EQV(a, b) (EQ((a).x(), (b).x()) && EQ((a).y(), (b).y()))
enum {
COUNTER_CLOCKWIS... | a.cc: In function 'int main()':
a.cc:343:75: error: expected primary-expression before ')' token
343 | norm(us[i].first.p) - us[i].first.r < EPS)){
| ^
|
s846245417 | p00204 | C++ | /*include*/
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#include<complex>
#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
#define mp make_pair
... | a.cc: In function 'int main()':
a.cc:291:45: error: no match for 'operator*' (operand types are 'P' {aka 'std::complex<double>'} and 'int')
291 | L rz(P(0,0),c[mii].c*100000);
| ^~~~~~~
| |
... |
s650049802 | p00204 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
/* ??????????????¬ */
#include <complex>
typedef long double ld;
typedef complex<ld> Point;
#defin... | a.cc: In function 'int main()':
a.cc:658:124: error: expected ',' or ';' before ')' token
658 | Line l(Point(R*px/abs(it->c.p), R*py / abs(it->c.p)), Point(5000.l*it->c.p / abs(it->c.p))));
| ... |
s933828040 | p00204 | C++ | #include<iostream>
#define PI 3.141592653589793
using namespace std;
struct tagUFO{
tagUFO*pBefore;
tagUFO*pNext;
double x;//??§?¨?x
double y;//??§?¨?y
int r;//UFO?????????
int v;//UFO?????????(??????)
double Distance;
};
void AddUFO(tagUFO*p);
tagUFO*DeleteUFO(tagUFO*pDelete);
int ShotUFO(tagUFO*pAimedUFO, ... | a.cc: In function 'int main()':
a.cc:37:39: error: 'sqrt' was not declared in this scope
37 | p->Distance = sqrt(p->x*p->x + p->y*p->y);
| ^~~~
a.cc:54:47: error: 'sqrt' was not declared in this scope
54 | p->Dista... |
s925307080 | p00204 | C++ | #include <iostream>
#include <vector>
#include <stack>
#include <tuple>
#include <functional>
#include <type_traits>
#include <cmath>
#include <algorithm>
constexpr long double pi = 3.14159265359;
template <typename F, typename Func>
auto map(Func func, const F &vec) -> std::vector<typename decltype(func(*vec.begin()))... | a.cc:11:87: error: template argument 1 is invalid
11 | auto map(Func func, const F &vec) -> std::vector<typename decltype(func(*vec.begin()))>{
| ^
a.cc:11:87: error: template argument 2 is invalid
a.cc:11:87: error: template... |
s367515951 | p00204 | C++ | #include <cstdio>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
#define EPS 1e-6
typedef complex<double> P;
struct L : public vector<P> {
L(const P &a, const P &b) {
push_back(a); push_back(b);
}
};
struct C {
P p; double r;
C(const P &p,... | a.cc: In function 'int main()':
a.cc:80:15: error: 'cin' was not declared in this scope
80 | while(cin >> R >> N)
| ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
6 | #include <queue>
+++ |+#include <iostrea... |
s625529397 | p00204 | C++ | #include <cstdio>
#include <complex>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
using namespace std;
#define EPS 1e-6
typedef complex<double> P;
struct L : public vector<P> {
L(const P &a, const P &b) {
push_back(a); push_back(b);
}
};
struct C {
P p; double r;
C(const P &p, ... | a.cc: In function 'int main()':
a.cc:115:15: error: 'cin' was not declared in this scope
115 | while(cin >> R >> N, (R||N))
| ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
6 | #include <cmath>
+++ |+#include... |
s343630965 | p00204 | C++ | #include<iostream>
#include<vector>
#include<complex>
#include<list>
#define rep(i,n) for(int i=0;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
bool operator < (const ... | a.cc: In function 'P crosspoint(const L&, const L&)':
a.cc:91:21: error: 'assert' was not declared in this scope
91 | if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
| ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding... |
s527932314 | p00204 | C++ | define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#inc... | a.cc:1:1: error: 'define' does not name a type
1 | define _USE_MATH_DEFINES
| ^~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
... |
s335041013 | p00204 | C++ | import java.util.Scanner;
//UFO Shooting Down Operation
public class Main{
double dot(double[] a, double[] b){
return a[0]*b[0]+a[1]*b[1];
}
void run(){
Scanner sc = new Scanner(System.in);
while(true){
int R = sc.nextInt();
int n = sc.nextInt();
if((R|n)==0)break;
int[][] ufo = new int[n][4];
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main{
| ^~~~~~
|
s503336417 | p00204 | C++ | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
const double... | a.cc: In function 'int main()':
a.cc:151:96: error: cannot bind non-const lvalue reference of type 'std::vector<Point>&' to an rvalue of type 'std::vector<Point>'
151 | if(!check[i] && p[i].dot(p[j]) > 0 && circleLineIntersection(p[i], r[i], line, vector<Point>()) > 0)
| ... |
s443102418 | p00204 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
using namespace std;
const double EPS = 1e-9;
const double M_PI = 3.1415926535897932384626433832795;
c... | In file included from /usr/include/c++/14/cmath:47,
from a.cc:8:
a.cc:16:14: error: expected unqualified-id before numeric constant
16 | const double M_PI = 3.1415926535897932384626433832795;
| ^~~~
|
s161405004 | p00204 | C++ | #include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#define EPSILON 1e-9
#define ALL(x) (x).begin(), (x).end()
class point_t;
class vector_t {
public:
double x;
double y;
double z;
public:
vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};
vector_t(const ... | a.cc:87:44: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
87 | class point_circle_intersect : public std::unary_function<point_t, bool>
| ^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/str... |
s173967389 | p00204 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <cli... | a.cc:127:1: error: expected unqualified-id before '<' token
127 | <
| ^
|
s007145281 | p00204 | C++ | from sys import stdin
from math import sqrt,fabs
class Game:
class Ufo:
def __init__(self,x,y,r,v):
self.x = x*1.0
self.y = y*1.0
self.r = r*1.0
self.v = v*1.0
self.d = sqrt(x**2+y**2)
self.cs = self.x / self.d
self.si = self.y / self.d
self.vx = -self.v*self.cs
self.vy = -self.v*self.si
... | a.cc:56:18: error: invalid preprocessing directive #print
56 | #print str(len(curInrs)) + " ufos invaded!"
| ^~~~~
a.cc:59:26: error: invalid preprocessing directive #print
59 | #print ufo
| ^~~~~
a.cc:76:18: error: inva... |
s577867713 | p00204 | C++ | from math import sqrt,fabs
class Ufo:
def __init__(self,x,y,r,v):
self.x = x*1.0
self.y = y*1.0
self.r = r*1.0
self.v = v*1.0
self.d = sqrt(x**2+y**2)
self.cs = self.x / self.d
self.si = self.y / self.d
self.vx = -self.v*self.cs
self.vy = -sel... | a.cc:57:10: error: invalid preprocessing directive #print
57 | #print str(len(curInrs)) + " ufos invaded!"
| ^~~~~
a.cc:60:14: error: invalid preprocessing directive #print
60 | #print ufo
| ^~~~~
a.cc:77:10: error: invalid preprocessing directive #print
77... |
s101275372 | p00204 | C++ |
#include<complex>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
template<class T> T sqr(T x){
return x*x;
}
const double eps=1e-9;
int main(){
for(int R,N;cin>>R>>N,R;){
int x0[100],y0[100],r[100],v[100];
vector<int> rem(N);
for(int i=0;i<N;i++){
cin>>x0[i]>>y0[i]>... | a.cc: In function 'int main()':
a.cc:16:15: error: 'cin' was not declared in this scope
16 | for(int R,N;cin>>R>>N,R;){
| ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include<cmath>
+++ |+#include <iostream... |
s028765229 | p00205 | Java | import java.util.*;
public class Main1 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
out: while (true) {
int[] x;
x = new int[5];
for (int i = 0; i < 5; i++) {
x[i] = s.nextInt();
if (x[0] == 0)
break out;
}
boolean[] j = { false, false, false };
... | Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
1 error
|
s729214150 | p00205 | C | #include<stdio.h>
int main(void)
{
int g = 0, c = 0, p = 0, n, i, a[5];
while (scanf_s("%d", &n))
{
if (n == 0)
{
break;
}
a[0] = n;
if (n == 1)
{
g++;
}
if (n == 2)
{
c++;
}
if (n == 3)
{
p++;
}
for (i = 1;i < 5;i++)
{
scanf_s("%d", &n);
a[i] = n;
if (n == 1)
{... | main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | while (scanf_s("%d", &n))
| ^~~~~~~
| scanf
|
s121896595 | p00205 | C | main(){for(;1-scanf("%d%d%d%d%d",p,p+1,p+2,p+3,p+4);)for(i=0;i<5;i++,puts(w?l?"3":"1":l?"2":"3"))for(j=w=l=0;j<5;j++)p[i]-p[j]?p[i]%3+1==p[j]?w++:l++:0;} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){for(;1-scanf("%d%d%d%d%d",p,p+1,p+2,p+3,p+4);)for(i=0;i<5;i++,puts(w?l?"3":"1":l?"2":"3"))for(j=w=l=0;j<5;j++)p[i]-p[j]?p[i]%3+1==p[j]?w++:l++:0;}
| ^~~~
main.c: In function 'main':
main.c:1:15: error: implicit declaration of functio... |
s131718280 | p00205 | C | #include<stdio.h>
int main(){
int a[5],g,c,p,i;
while(scanf("%d",&a[0]),a[0]){
g=0;
c=0;
p=0;
if(a[0]==1)
g++;
else if(a[0]==2)
c++;
else if(a[0]==3)
p++;
for(i=1;i<5;i++){
scanf("%d",&a[i]);
if(a[i]==1)
g++;
else if(a[i]==2)
c++;
else if(a[i]==3)
p++;
... | main.c: In function 'main':
main.c:46:17: error: expected declaration or statement at end of input
46 | }
| ^
|
s917400360 | p00205 | C | #include<stdio.h>
int main(){
int a[500]={0},i,kaisuu,k;
int flg1,flg2,flg3,l;
int j,cnt=0;
cnt=0;
a[500]={0};
kaisuu=0;
for(i=1;i<500;i++){
scanf("%d",&a[i]);
if(a[i]==0)break;
cnt++;
}
kaisuu=cnt/5;
for(i=0;i<kaisuu;i++){
for(l=i*5+1;... | main.c: In function 'main':
main.c:7:16: error: expected expression before '{' token
7 | a[500]={0};
| ^
|
s998124704 | p00205 | C | #include<stdio.h>
int main(){
int a[500]={0},i,kaisuu,k;
int flg1,flg2,flg3,l;
int j,cnt=0;
cnt=0;
a[500]={0};
kaisuu=0;
for(i=1;i<500;i++){
scanf("%d",&a[i]);
if(a[i]==0)break;
cnt++;
}
kaisuu=cnt/5;
for(i=0;i<kaisuu;i++){
for(l=i*5+1;... | main.c: In function 'main':
main.c:7:16: error: expected expression before '{' token
7 | a[500]={0};
| ^
|
s668314341 | p00205 | C | main(){for(;;){d[5],s=0,i=0;for(;i<5;i++){h;scanf("%d",&h);if(!h)exit(0);s|=d[i]=1<<h;}for(i=0;i<5;i++){k=d[i];printf("%d\n",s==14|s==k?3:(s^k)==k*2|(s^k)==k/4?1:2);}}} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){for(;;){d[5],s=0,i=0;for(;i<5;i++){h;scanf("%d",&h);if(!h)exit(0);s|=d[i]=1<<h;}for(i=0;i<5;i++){k=d[i];printf("%d\n",s==14|s==k?3:(s^k)==k*2|(s^k)==k/4?1:2);}}}
| ^~~~
main.c: In function 'main':
main.c:1:16: error: 'd' undeclared (... |
s269798010 | p00205 | C | #include<stdio.h>
int main(){
while(1){
int i,a,b,c,d,e,A,B,C,D,E,x[5]={},X,Y,Z,p;
scanf("%d",&a);
if(a==0){
break;
}
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);
x[0]=a;
x[1]=b;
x[2]=c;
x[3]=d;
x[4]=e;
X=a;
for(i=0;i<5;i++){
if(X!=x[i]){
if(Y!=x[i]&&Y==0){
... | main.c: In function 'main':
main.c:73:1: error: expected declaration or statement at end of input
73 | }
| ^
|
s786663788 | p00205 | C++ | #include<iostream>
int main(){
int a[5];
bool r,s,p;
bool as,bs,cs,ds;
while(1){
for(int i=0;i<5;i++){
std::cin>>a[i];
if(a[i]==1)
r=true;
else if(a[i]==2)
s=true;
else
p=true;
}
if(r==true && s==true && p==true)ds==true;
if(r==true && s==true){
as==true;
bs==false;
}
if(r=... | a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
38 | }
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s795914151 | p00205 | C++ | #include<iostream>
using namespace std;
int main(){
int X[5];
while(1){
int con1=0,con2=0,con3=0;
cin >> X[0];
if(X[0] == 0) break;
for(int i=1;i<5;i++){
cin >> X[i];
}
for(int i=0;i<5;i++){
if(X[i] == 1) con1++;
if(X[i] == 2) con2++;
if(X[i] == 3) con3++;
}
if(((con1 != 0)&&(con2 != 0)&&(c... | a.cc: In function 'int main()':
a.cc:23:137: error: expected primary-expression before ')' token
23 | if(((con1 != 0)&&(con2 != 0)&&(con3 != 0))||((con1 == 0)&&(con2 == 0))||((con2 == 0)&&(con3 == 0))||((con1 == 0)&&(con3 == 0))||){
| ... |
s584234118 | p00205 | C++ | #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;
... | a.cc: In function 'int main()':
a.cc:47:14: error: expected ';' before numeric constant
47 | p 3;
| ^ ~
| ;
|
s759615439 | p00205 | C++ | type hand = Rock | Paper | Scissors
type result = Win | Lose | Draw
module HandSet = Set.Make (
struct
type t = hand
let compare (a : hand) b = compare a b
end)
let hand_of_int = function
| 1 -> Some Rock
| 2 -> Some Sciss... | a.cc:1:1: error: 'type' does not name a type; did you mean 'typeof'?
1 | type hand = Rock | Paper | Scissors
| ^~~~
| typeof
a.cc:61:25: error: expected constructor, destructor, or type conversion before ')' token
61 | print_newline ())
| ^
a.cc:65:1: error: expe... |
s299819145 | p00205 | C++ | 3
3
3 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s008426482 | p00205 | C++ | #include<iostream>
using namespace std;
int main(){
int h[5];
int f[4];
while(1){
for(int i=0;i<4;i++) f[i]=0;
for(int i=0;i<5;i++){
cin>>h[i];
if(h[i]==0) break;
f[h[i]]=1;
}
if(h[0]==0) break;
int x[2], cnt=0;
for(int i=1;i<4;i++){
if(f[i]==1)
x[cnt++]... | a.cc: In function 'int main()':
a.cc:49:12: error: expected '}' at end of input
49 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s088877619 | p00205 | C++ | i,f,d[5],*p;main(n){for(;i>4||scanf("%d",p=d+i)**d;i=++i%10,f*=!!i)n=((f^f/2^f/4)&1?2:!(d[i%5]*2&f))+49,i<5?f|=(*p=9<<*p-1):puts(&n);} | a.cc:1:1: error: 'i' does not name a type
1 | i,f,d[5],*p;main(n){for(;i>4||scanf("%d",p=d+i)**d;i=++i%10,f*=!!i)n=((f^f/2^f/4)&1?2:!(d[i%5]*2&f))+49,i<5?f|=(*p=9<<*p-1):puts(&n);}
| ^
a.cc:1:17: error: expected constructor, destructor, or type conversion before '(' token
1 | i,f,d[5],*p;main(n){for(;i>4|... |
s734715125 | p00205 | C++ | #include <iostream>
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(c) (c), (c)+5
#define Contains(c, x) (find(all(c), (x)) != (c)+5)
using namespace std;
int main()
{
int a[5], b[5];
while (true) {
cin >> a[0]; if (a[0] == 0) break;
REP(i, 1, 5) c... | a.cc: In function 'int main()':
a.cc:5:29: error: no matching function for call to 'find(int [5], int*, int)'
5 | #define Contains(c, x) (find(all(c), (x)) != (c)+5)
| ~~~~^~~~~~~~~~~~~
a.cc:13:13: note: in expansion of macro 'Contains'
13 | if (Contains(a, 1) && Contains(a,... |
s556779970 | p00205 | C++ | #include <iostream>
#include <vector>
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(c) (c).begin(), (c).end()
#define Contains(c, x) (find(all(c), (x)) != (c).end())
using namespace std;
int main()
{
vector<int> a(5), b(5);
while (true) {
cin >> a[0]; if... | a.cc: In function 'int main()':
a.cc:6:29: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
6 | #define Contains(c, x) (find(all(c), (x)) != (c).end())
| ~~~~^~~~~~~~~~~~~
a.cc:14:13: note: in expansion of macro 'Contains'
1... |
s591960064 | p00205 | C++ | #include <iostream>
using namespace std;
int main(){
int human[5];
while(cin>>human[0],human[0]){
bool hand[3]={};
for(int i=1;i<5;i++){
cin>>human[i];
if(human[i]==1) hand[0]++;
else if(human[i]==2) hand[1]++;
else hand[2]++;
}
if((hand[0]==true&&hand[0]==hand[1]&&hand[0]==hand[2])||(hand[0]==fa... | a.cc: In function 'int main()':
a.cc:10:47: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
10 | if(human[i]==1) hand[0]++;
| ~~~~~~^
a.cc:11:52: error: use of an operand of type 'bool' in 'operator++' is forbidden in... |
s699995676 | p00205 | C++ |
#include <iostream>
using namespace std;
int main(){
int human[5];
while(cin>>human[0],human[0]){
if(human[0]==1) hand[0]++;
else if(human[0]==2) hand[1]++;
else hand[2]++;
bool hand[3]={0,0,0};
for(int i=1;i<5;i++){
cin>>human[i];
if(human[i]==1) hand[0]++;
else if(human[i]==2) hand[1]++;
els... | a.cc: In function 'int main()':
a.cc:8:33: error: 'hand' was not declared in this scope; did you mean 'rand'?
8 | if(human[0]==1) hand[0]++;
| ^~~~
| rand
a.cc:9:38: error: 'hand' was not declared in this scope; did you mean... |
s659345384 | p00205 | C++ | int i,n,d=0b10110001000000;main(c,v){for(;;){for(v=c=i=0;i-5;++i){scanf("%d",&n);if(!n)exit(0);v|=n<<i*2;c|=1<<n;}for(n=((d>>c)&3),i=0;i-5;++i){printf("%d\n",v>>i*2&3-n?(n?2:3):1);}}} | a.cc:1:32: error: expected constructor, destructor, or type conversion before '(' token
1 | int i,n,d=0b10110001000000;main(c,v){for(;;){for(v=c=i=0;i-5;++i){scanf("%d",&n);if(!n)exit(0);v|=n<<i*2;c|=1<<n;}for(n=((d>>c)&3),i=0;i-5;++i){printf("%d\n",v>>i*2&3-n?(n?2:3):1);}}}
| ^... |
s993941342 | p00205 | C++ | #include<iostream>
#include<vector>
int main(){
while(1){
std::vector<int> vec(5);
std::vector<int> vec2(5);
int a;
std::cin>>a;
if(a==0)break;
vec[0]=a;
int d,e,f;
if(a==1)d++;
if(a==2)e++;
if(a==3)f++;
for(int i=1;i<5;i++){
int b;
if(b==1)d++;
if(b==2)e++;
if(b==3)f++;
std::cin>>... | a.cc: In function 'int main()':
a.cc:22:34: error: redeclaration of 'std::vector<int> vec2'
22 | std::vector<int> vec2(5);
| ^~~~
a.cc:6:34: note: 'std::vector<int> vec2' previously declared here
6 | std::vector<int> vec2(5);
| ... |
s122954845 | p00205 | C++ | #include<iostream>
using namespace std;
int main(){
long x[5],h[4],i;
while(cin>>x[0]){
if(x[0]==0)break;
for(i=1;i<=3;i++)h[i]=0;
h[x[0]]++;
for(i=1;i<5;i++){cin>>x[i];h[x[i]]++;}
for(j=0,i=1;i<=3;i++)if(h[i]==0)j++;
if(j==2||j==0){
for(i=0;i<5;i++)cout<<"3"<<endl;
else if(j==1){
for(i=1;i<=3;i++)if(h[i]==0)break;
if(... | a.cc: In function 'int main()':
a.cc:10:5: error: 'j' was not declared in this scope
10 | for(j=0,i=1;i<=3;i++)if(h[i]==0)j++;
| ^
a.cc:11:4: error: 'j' was not declared in this scope
11 | if(j==2||j==0){
| ^
a.cc:13:1: error: expected '}' before 'else'
13 | else if(j==1){
| ^~~~
a.cc:... |
s645418011 | p00205 | C++ | #include<stdio.h>
int main(void)
{
int t[5]={0},t2=0,t3=0,t1=0,k,i;
while(scanf("%d",&k)!=0){
t2=0; t3=0; t1=0;
for(i=0;i<5;i++){
scnaf("%d",&t[i]);
if(t[i]==1)
t1++;
else if(t[i]==2)
t2++;
else if(t[i]==3)
t3++;
}
if(t1==0){
if(t2==0 or t3==0)
for(i=0;i<5;i++) t[i]=3;
else
for(i=0;i<5;i++... | a.cc: In function 'int main()':
a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
12 | scnaf("%d",&t[i]);
| ^~~~~
| scanf
a.cc:54:9: error: expected ';' before '}' token
54 | return 0
| ^
| ;
55 | }
| ~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.