submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s999725517 | p00836 | Java | import java.io.*;
import java.util.*;
class Eratos{
public static void main(String[] args) throws IOException{
ArrayList<Integer> prime_list = new ArrayList<Integer>();
for(int j = 2;j <= 10000; j++){
for(int n = 2; n <= j;n++){
if(j == n){
prime_list.... | Main.java:46: error: incompatible types: unexpected return value
return 0;
^
1 error
|
s745076665 | p00836 | Java | package Vol012;
import java.util.Arrays;
import java.util.Scanner;
public class AOJ12_57
{
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in);
boolean a[] =new boolean[10001];
Arrays.fill(a, true);
a[0]=a[1]=false;
for(int i=2; i*i<=10000; i++)
{
if(!a[i])
continue;
for(... | Main.java:5: error: class AOJ12_57 is public, should be declared in a file named AOJ12_57.java
public class AOJ12_57
^
1 error
|
s295963852 | p00836 | C | #include<stdio.h>
int main(){
int num[1000],i=0,j,k,ans=0,culc;
int a[1000];
for(i=0;i<1000;i++){
a[i]=1;
}
for(i=2;i<1000;i++){//?´???°?????????????????????0?????\??????
for(j=2;(i*j)<1000;j++){//?????°???0?????\??????
a[i*j]=0;
... | main.c:46:1: error: expected identifier or '(' before '}' token
46 | }
| ^
main.c:47:1: error: expected identifier or '(' before '}' token
47 | }
| ^
|
s035752564 | p00836 | C | #include<stdio.h>
int main(){
int num[1000],i=0,j,k,ans=0,culc;
int a[1000];
for(i=0;i<1000;i++){
a[i]=1;
}
for(i=2;i<1000;i++){
for(j=2;(i*j)<1000;j++){
a[i*j]=0;
}
}
a[0]=0;
a[1]=0;
i=0;
while(1){
scanf("%d",&num[i]);
if(num[i]==0)break;
i++;
}
for(k=0;num[k]!=0... | main.c:41:1: error: expected identifier or '(' before '}' token
41 | }
| ^
|
s542588671 | p00836 | C | #include<stdio.h>
int main(){
int num[1000],i=0,j,k,ans=0,culc;
int a[1000];
for(i=0;i<1000;i++){
a[i]=1;
}
for(i=2;i<1000;i++){//?´???°?????????????????????0?????\??????
for(j=2;(i*j)<1000;j++){//?????°???0?????\??????
a[i*j]=0;
... | main.c: In function 'main':
main.c:43:1: error: expected declaration or statement at end of input
43 | }
| ^
|
s760449037 | p00836 | C | #include <bits/stdc++.h>
using namespace std;
int a[10009];
vector<int> p;
map<int,int> m;
void sieve()
{
int i,j,t1,t2;
for(i=0;i<10003;i++)
a[i]=1;
a[0]=a[1]=0;
for(i=2;i<=10000;i++)
{
if(a[i]==1)
{
p.push_back(i);
for(j=2*i;j<=10000;j+=i)
... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s657225652 | p00836 | C | #include<iostream>
using namespace std;
int a[10000]={0};
int main(){
a[0]=a[1]=1;
for(int i=2;i<10000;i++){
if(a[i]==0){
for(int j=i*2;j<10000;j+=i)
a[j]=1;
}
}
int n=1,c=0;
while(n!=0){
c=0;
cin>>n;
if(a[n]==0)
c++;
for(int i=n-1;i>0;i--){
int s=0;
int j=i;
if(a[j]==0){
while(j>=0 && s... | main.c:1:17: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s401873520 | p00836 | C | #include <bits/stdc++.h>
using namespace std;
int prime[10004];
int A[10004], X[10004];
int main() {
int N;
for(int i=2; i<=10000; i++)
for(int j=i*i; j<=10000; j+= i)
prime[j] = 1;
int k = 0;
for(int i=2; i<=10000; i++)
if(!prime[i])
A[++k] ... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s111583870 | p00836 | C | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <stdio.h>
#include <queue>
//#include "windows.h"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define nd secon... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s550062190 | p00836 | C | #include <iostream>
#include <string.h>
using namespace std;
int n;
int count;
int number[10000];
int isprime(int a)
{
for(int i=2;i*i<=a;i++)
{
if(a%i==0)return 0;
}
return 1;
}
void prime(int k)
{
int j=0;
for(int i=2;i<=k;i++)
{
if(isprime(i))
number[j++]=i;
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s059215649 | p00836 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
static const int maxn = 10001;
int isp[maxn];
vector<int> p;
void eratosthenes() {
//init
fill(isp, isp + maxn, 1);
int i, j;
int maxi = sqrt(maxn);
for (i = 2; i <= maxi; i++) {
j = i + i;
while (j < maxn) {
isp[j] = 0;
j ... | a.cc: In function 'void eratosthenes()':
a.cc:17:20: error: 'sqrt' was not declared in this scope
17 | int maxi = sqrt(maxn);
| ^~~~
|
s744668374 | p00836 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;int p[10001],M=10001,i,j,c;vector<int>s(1,0);main(){for(i=1;++i<M;)for(j=i+i;j<M;j+=i)p[j]=1;for(i=1;++i<M;)if(!p[i])s.push_back(i+s.back());for(;cin>>j,j;cout<<c<<endl){for(c=0,vector<int>::iterator t=s.begin();;t!=s.end();t++)c+=count(t,s.end... | a.cc:4:66: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | using namespace std;int p[10001],M=10001,i,j,c;vector<int>s(1,0);main(){for(i=1;++i<M;)for(j=i+i;j<M;j+=i)p[j]=1;for(i=1;++i<M;)if(!p[i])s.push_back(i+s.back());for(;cin>>j,j;cout<<c<<endl){for(c=0,vector<int>::iterator t=s.b... |
s570327426 | p00836 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;int p[10001],M=10001,i,j,c;vector<int>s(1,0);main(){for(i=1;++i<M;)for(j=i+i;j<M;j+=i)p[j]=1;for(i=1;++i<M;)if(!p[i])s.push_back(i+s.back());for(;cin>>j,j;cout<<c<<endl){for(c=0,vector<int>::iterator t=s.begin();t!=s.end();t++)c+=count(t,s.end(... | a.cc:4:66: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | using namespace std;int p[10001],M=10001,i,j,c;vector<int>s(1,0);main(){for(i=1;++i<M;)for(j=i+i;j<M;j+=i)p[j]=1;for(i=1;++i<M;)if(!p[i])s.push_back(i+s.back());for(;cin>>j,j;cout<<c<<endl){for(c=0,vector<int>::iterator t=s.b... |
s660211727 | p00837 | C | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <deque>
#include <queue>
#include <vector>
using namespace std;
int m, c, n;
int cost[20];
int dc[20], srn[20], sqr[20][100];
queue<int> req;
deque<int> sto[20];
void init()
{
for (int i = 1; i <= 20; i++)
sto[i].clear();
while (req.size() > 0)
... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s390991327 | p00837 | C++ | #include <cstdlib>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
for(int m, c, n; cin >> m >> c >> n && m;) {
vector<unordered_map<int, int>> desks(m);
queue<int> que;
vector<int> index(n, 0)... | a.cc: In function 'int main()':
a.cc:69:46: error: 'INT_MAX' was not declared in this scope
69 | int r_time = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include ... |
s533839908 | p00838 | C | #include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
#define INF 1000000000
const int mov[24][6]={
{0,1,2,3,4,5},{0,2,4,1,3,5},{0,4,3,2,1,5},{0,3,1,4,2,5},
{3,1,0,5,4,2},{3,0,4,1,5,2},{3,4,5,0,1,2},{3,5,1,4,0,2},
{5,1,3,2,4,0},{5,3,4,1,2,0... | main.c:3:9: fatal error: iostream: No such file or directory
3 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s600852099 | p00838 | C++ | 3
scarlet green blue yellow magenta cyan
blue pink green magenta cyan lemon
purple red blue yellow cyan green
2
red green blue yellow magenta cyan
cyan green blue yellow magenta red
2
red green gray gray magenta cyan
cyan green gray gray magenta red
2
red green blue yellow magenta cyan
magenta red blue yellow cyan gree... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s621067516 | p00839 | C++ | #include <array>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
typedef array<int, 2> A;
typedef pair<A, A> E;
typedef unsigned hash_t;
hash_t rolling_hash(const string ... | a.cc: In function 'std::unordered_map<unsigned int, int> bfs(int, const std::vector<std::__cxx11::basic_string<char> >&, const std::vector<std::pair<std::array<int, 2>, std::array<int, 2> > >&)':
a.cc:64:54: error: 'reverse' was not declared in this scope
64 | if(d1 == d2) rev... |
s433358639 | p00840 | C | #include <cstdio>
#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 ... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s305536350 | p00840 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
struct data{
double lm, rm, m;//l-min, r-max
int bit;
data(double l=0, double r=0, double m=0, int b=0):lm(l),rm(r),m(m),bit(b){}
};
int n;
double r;
vector<double> v;
void solve(){
vector<data> res[7];
double ans = -1.0;
fo... | a.cc: In function 'void solve()':
a.cc:17:14: error: template argument 1 is invalid
17 | vector<data> res[7];
| ^
a.cc:17:14: error: template argument 2 is invalid
a.cc:19:31: error: request for member 'push_back' in 'res[1]', which is of non-class type 'int'
19 | for(int i=0;i<n;i++) res[1... |
s566882181 | p00840 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
using namespace std;
const double EPS = 1e-9;
struct data{
double lm, rm, m;//l-min, r-max
int bit;
data(double l=0, double r=0, double m=0, int b=0):lm(l),rm(r),m(m),bit(b){}
};
bool equal(double a, double b){
... | a.cc: In function 'void solve()':
a.cc:30:14: error: template argument 1 is invalid
30 | vector<data> res[7];
| ^
a.cc:30:14: error: template argument 2 is invalid
a.cc:32:31: error: request for member 'push_back' in 'res[1]', which is of non-class type 'int'
32 | for(int i=0;i<n;i++) res[1... |
s337192809 | p00840 | C++ | #include<vector>
#include<algorithm>
#include<string>
#include<cctype>
#include<cmath>
#include<cstdio>
#define all(c) (c).begin(),(c).end()
#define D(x) cout << #x " is " << x << endl
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef long ... | a.cc: In function 'int main()':
a.cc:45:3: error: 'cin' was not declared in this scope
45 | cin >> T;
| ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
6 | #include<cstdio>
+++ |+#include <iostream>
7 |
a.cc:59:16: error:... |
s971958201 | p00841 | C++ | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
inline double calc(int x, int r, double v, double e, double f) {
if(x >= r) return 1.0 / (v - e * (x - r));
return 1.0 / (v - f * (r - x));
}... | a.cc: In function 'int main()':
a.cc:33:72: error: 'INT_MAX' was not declared in this scope
33 | vector<vector<double>> dp(n + 1, vector<double>(n + 1, INT_MAX));
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<cl... |
s626973596 | p00841 | C++ | #include<cstdio>
using namespace std;
typedef double D;
int n,a[110],r;
D b,v,e,f;
D dp[10100][110];
const D EPS = 1e-8;
int main(){
while(scanf("%d",&n),n){
a[0] = 0;
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
scanf("%lf%d%lf%lf%lf",&b,&r,&v,&e,&f);
for(int i=0;i<=a[n];i++)
for(int j=0... | a.cc: In function 'int main()':
a.cc:33:19: error: 'ESP' was not declared in this scope; did you mean 'EPS'?
33 | if(dp[i][j] + ESP >= 1e15)continue;
| ^~~
| EPS
|
s944676617 | p00842 | C++ | #include <cstdlib>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
constexpr int MAX_N = 30;
int dist[MAX_N][MAX_N];
int base_dist[MAX_N];
vector<int> ans;
bool rec(const vector<int> &nodes) {
if(nodes.size() == 1) {
for(int i = 0; i < base_dist[nodes.front()] - 1; ++i) {
ans.emp... | a.cc: In function 'int main()':
a.cc:104:17: error: 'sort' was not declared in this scope; did you mean 'short'?
104 | sort(ans.begin(), ans.end());
| ^~~~
| short
|
s508615266 | p00845 | C | //2006年アジアA How I Wonder What You Are!
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define EPS 1e-10
typedef struct{
double x,y,z;
}Position;
double dot(P a,P b){
return a.x * b.x + a.y * b.y + a.z * b.z;
}
double dist(P a){
return sqrt(a.x*a.x + a.y*a.y + a.z*a.z);
}
double getTheta(P a,P b){
ret... | main.c:12:12: error: unknown type name 'P'
12 | double dot(P a,P b){
| ^
main.c:12:16: error: unknown type name 'P'
12 | double dot(P a,P b){
| ^
main.c:16:13: error: unknown type name 'P'
16 | double dist(P a){
| ^
main.c:20:17: error: unknown type name ... |
s138648379 | p00847 | C++ | #include<iostream>
#include<set>
#include<array>
using namespace std;
typedef array<array<signed char,3>,3> Die;
int main(){
for(int x,y;cin>>x>>y,x;){
char g[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>g[i][j];
}
}
set<Die> s[32],u;
Die d{};
d[y-1][x-1]=-1;
s[0... | a.cc: In function 'int main()':
a.cc:61:7: error: 'e' was not declared in this scope
61 | e[i].clear();
| ^
|
s061141065 | p00847 | C++ | #include<iostream>
#include<unordered_set>
#include<array>
using namespace std;
typedef array<array<signed char,3>,3> Die;
int main(){
for(int x,y;cin>>x>>y,x;){
char g[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>g[i][j];
}
}
unordered_set<Die> s[32],u;
Die d{};
d[y... | a.cc: In function 'int main()':
a.cc:17:28: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::array<std::array<signed char, 3>, 3>; _Hash = std::hash<std::array<std::array<signed char, 3>, 3> >; _Pred = std::equal_to<std::array<std::array<signed char, ... |
s132600823 | p00847 | C++ | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | a.cc: In function 'int calcDiff(Info)':
a.cc:90:49: error: no match for 'operator!=' (operand types are 'Dice' and 'Dice')
90 | if(info.board[row][col] != goal.board[row][col]){
| ~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~
| ... |
s309833131 | p00847 | C++ | // 2006ツ年ツアツジツアツ地ツ凝ヲツ予ツ選C : Cubic Eight Puzzle
#include <iostream>
#include <vector>
using namespace std;
char dx[] = {-1,1,0,0};
char dy[] = {0,0,-1,1};
char dice[6][2] = {
{4,2}, {3,5}, {5,0}, {1,4}, {0,3}, {2,1}
};
int board[9], goal[9];
inline int compress(int space){
int res = space;
for(int i=0;i<9;i++){... | a.cc: In function 'void initialize(int)':
a.cc:30:3: error: 'memset' was not declared in this scope
30 | memset(board,0,sizeof(board));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <cst... |
s383669536 | p00847 | C++ | // 2006ツアツジツアツ地ツ凝ヲツ予ツ選C : Cubic Eight Puzzle
#include <iostream>
using namespace std;
char dx[] = {-1,1,0,0};
char dy[] = {0,0,-1,1};
char dice[6][2] = {
{4,2}, {3,5}, {5,0}, {1,4}, {0,3}, {2,1}
};
int board[9], goal[9];
void dfs(int x, int y, int px, int py, int step, int &res){
if(step >= res) return;
int spa... | a.cc: In function 'void dfs(int, int, int, int, int, int&)':
a.cc:29:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
29 | if(step+dif-1<ans) dfs(nx, ny, x, y, step+1, ans);
| ^~~
| abs
a.cc: In function 'int ... |
s666001591 | p00847 | C++ | #include <iostream>
#include <cstring>
using namespace std;
char dx[] = {-1,1,0,0};
char dy[] = {0,0,-1,1};
char dice[6][2] = {
{4,2}, {3,5}, {5,0}, {1,4}, {0,3}, {2,1}
};
int board[9], goal[9];
void dfs(int x, int y, int px, int py, int step, int &res){
if(step >= res) return;
int space = 3*x+y;
for(int i=0;i<... | a.cc: In function 'void dfs(int, int, int, int, int, int&)':
a.cc:28:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | if(step+dif-1<ans) dfs(nx, ny, x, y, step+1, ans);
| ^~~
| abs
|
s185125636 | p00847 | C++ | #include <iostream>
#include <cstring>
using namespace std;
char dx[] = {-1,1,0,0};
char dy[] = {0,0,-1,1};
char dice[6][2] = {
{4,2}, {3,5}, {5,0}, {1,4}, {0,3}, {2,1}
};
int board[9], goal[9];
void dfs(int x, int y, int px, int py, int step, int &res){
if(step >= res) return;
int space = 3*x+y;
for(int i=0;i<... | a.cc: In function 'void dfs(int, int, int, int, int, int&)':
a.cc:28:62: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | if(step+dif-1<res) dfs(nx, ny, x, y, step+1, ans);
| ^~~
| ... |
s538773695 | p00847 | C++ | import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
Scanner sc;
Main() {
sc = new Scanner(System.in);
}
String turnR(int p, String d) {
char[] c = d.toCharArray();
int p2 = c[c.length - 1] - '0';
if ('3' <= c[p * 2 + 1] && c[p * 2... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.HashMap;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.HashSet;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-... |
s207893922 | p00848 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> pn;
vector<bool> is_p;
void enum_prime()
{
is_p.resize(1515, true);
is_p[0] = is_p[1] = false;
for(int i = 2; i <= 1515; i++) {
if(!is_p[i]) continue;
pn.push_back(i);
for(int j = i+i; j <= 1515; j+=i) is_p[j] = false;... | a.cc: In function 'int solve(int, int, int)':
a.cc:31:7: error: conflicting declaration 'int ret'
31 | int ret = solve(n, p - 1, k);
| ^~~
a.cc:28:8: note: previous declaration as 'int& ret'
28 | int& ret = dp[n][p][k];
| ^~~
|
s822653021 | p00848 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(i=0;i<n;i++)cin>>a[i];
for(i=0;i<n;i++){
if(a[i]==0)
}
} | a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=0;i<n;i++)cin>>a[i];
| ^
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=0;i<n;i++){
| ^
a.cc:10:3: error: expected primary-expression before '}' token
10 | }
| ^
|
s139669887 | p00848 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)(n); i++)
bool isPrime(int n) {
if( n < 2 ) return false;
if( n == 2 ) return true;
if( n % 2 == 0 ) return false;
for(int d = 3; d * d <= n; d += 2 ) {
if( n % d == 0 ) return false;
}
r... | a.cc: In function 'int main()':
a.cc:29:3: error: 'memset' was not declared in this scope
29 | 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<vector>
+++ |+#include <cstring>
4 | u... |
s033360408 | p00848 | C++ | ans[1][1]=0
ans[1][2]=1
ans[1][3]=1
ans[1][4]=0
ans[1][5]=1
ans[1][6]=0
ans[1][7]=1
ans[1][8]=0
ans[1][9]=0
ans[1][10]=0
ans[1][11]=1
ans[1][12]=0
ans[1][13]=1
ans[1][14]=0
ans[1][15]=0
ans[1][16]=0
ans[1][17]=0
ans[1][18]=0
ans[1][19]=1
ans[1][20]=0
ans[1][21]=0
ans[1][22]=0
ans[1][23]=1
ans[1][24]=0
ans[1][25]=0
ans[... | a.cc:1:1: error: 'ans' does not name a type
1 | ans[1][1]=0
| ^~~
|
s473769294 | p00848 | C++ | // 2006ツアツジツアツ地ツ凝ヲツ予ツ選D : Sum of Different Primes
#include <iostream>
using namespace std;
int main(){
int prime[187];
// [ツ債計ツ値][ツ催古」ツづ可使ツづつスツ素ツ青板づ景ndex][ツ使ツづつスツ素ツ青板づ個青脳
static int memo[1121][187][15];
memset(memo, 0, sizeof(memo));
int size = 1;
// 1120ツ暗按可コツづ個素ツ青板づーツ仰づ淞づつィツつュ
prime[0] = 2;
for(int ... | a.cc: In function 'int main()':
a.cc:10:3: error: 'memset' was not declared in this scope
10 | memset(memo, 0, sizeof(memo));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <iostream>
+++ |+#include <cstring>
... |
s839525927 | p00848 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int MAX_PRIME=10000;
int prime[MAX_PRIME+1];
bool isPrime[MAX_PRIME+1];
int p;
void erats(){
// primeツδ環スツトツづーツ渉可甘コツ可サ
fill(isPrime,isPrime+MAX_PRIME,true);
p = 0;
isPrime[0] = isPrime[1] = false;
for(int i = 2... | a.cc: In function 'int main()':
a.cc:52:9: error: 'memset' was not declared in this scope
52 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <queue>
+++ |+#include <cstring... |
s328554537 | p00848 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int MAX_PRIME=2000;
int prime[MAX_PRIME+1];
bool isPrime[MAX_PRIME+1];
int p;
void erats(){
// primeツδ環スツトツづーツ渉可甘コツ可サ
fill(isPrime,isPrime+MAX_PRIME,true);
p = 0;
isPrime[0] = isPrime[1] = false;
for(int i = 2;... | a.cc: In function 'int main()':
a.cc:52:9: error: 'memset' was not declared in this scope
52 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <queue>
+++ |+#include <cstring... |
s946741863 | p00848 | C++ | import java.util.*;
public class Main{
static int[] p = new int[1130];
static int pnum;
static int[][][] dp;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
calcPrimes();
int n = sc.nextInt();
int k = sc.nextInt();
while(n!=0){
dp = new int[1121][15][188];
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s260967764 | p00848 | C++ | #include<iostream>
#include<cstring>
#define pb push_back
#include<vector>
using namespace std;
int n,k;
__int64 dp[20][2000];
vector<int> p;
int main(){
vector<bool> used(1130,true);
for(int i=2;i<=1120;i++){
if(used[i]){
for(int j=i*2;j<=1120;j+=i){
used[j]=false;
}
p.pb(i);
}
}
while(cin>>n>>k,n... | a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'?
7 | __int64 dp[20][2000];
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:20:24: error: 'dp' was not declared in this scope; did you mean 'p'?
20 | memset(dp,0,sizeof(dp));
| ... |
s256076443 | p00848 | C++ | #include<iostream>
#include<vector>
using namespace std;
inline bool isPrime(int x){
for(int i=2;i*i<=x;i++){
if(x%i == 0)return false;
}
return true;
}
int n,k;
vector<int> prime;
int memo[1200][20];
int main(){
for(int i=2;i<=1120;i++){
if(isPrime(i))prime.push_back(i);
}
while(cin >> n >> k,n)... | a.cc: In function 'int main()':
a.cc:21:5: error: 'memset' was not declared in this scope
21 | memset(memo,0,sizeof(memo));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<vector>
+++ |+#include <cstring>
... |
s947590734 | p00848 | C++ | #include <iostream>
#include <vector>
using namespace std;
int dp[15][1130];
bool isPrime[1130];
vector<int> prime;
void PrimeCalc()
{
memset(isPrime, 1, sizeof(isPrime));
isPrime[0] = isPrime[1] = false;
for(int i = 2; i < 1130; ++i)
{
if(isPrime[i])
{
prime.push_back(i);
for(int j = 2 * i; j < 1130; j... | a.cc: In function 'void PrimeCalc()':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | memset(isPrime, 1, sizeof(isPrime));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>
+++ |... |
s047142224 | p00850 | Java | import java.util.Scanner;
//Power Calculus
public class AOJ1271 {
int n;
int[] k;
boolean[] u;
boolean reach(long b, long x, int rest){
long r = b+x;
while(rest--!=0)r+=r;
return n<=r;
}
boolean dfs(int d, int x, int max, int len){
if(d==0){
return u[n];
}
if(d==1){
return u[Math.abs(x-n)];
... | Main.java:4: error: class AOJ1271 is public, should be declared in a file named AOJ1271.java
public class AOJ1271 {
^
1 error
|
s380297920 | p00850 | C | #include <cstdio>
#define MAX_N 1024
#define MAX_D 20
int exp[MAX_D] = {1}, ans[MAX_N];
void dfs(int d)
{
if (d > MAX_D)
{
return;
}
for (int i = 0; i <= d; i++)
{
exp[d + 1] = exp[i] + exp[d]; // 乘法
if (exp[... | main.c:1:14: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s958948446 | p00850 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int X;
int ANSWER;
bool exists[1<<13];
int estimate[1<<13];
int cur[13], maxi;
bool init() {
scanf("%d", &X);
return X > 0;
}
bool dfs(int depth) {
if (depth + estimate[maxi] > ANSWER) {
return false;
}
if (exists[X]) {
return t... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s030300449 | p00850 | C++ | #include <iostream>
#include <vector>
#include <array>
#define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i))
#define repeat(i,n) repeat_from(i,0,n)
#define repeat_from_reverse(i,m,n) for (int i = (n)-1; (i) >= (m); --(i))
#define repeat_reverse(i,n) repeat_from_reverse(i,0,n)
using namespace std;
constexpr int... | a.cc: In function 'int main()':
a.cc:42:24: error: 'n' was not declared in this scope
42 | while(scanf("%d", &n) && n){
| ^
|
s216896620 | p00850 | C++ | #include <iostream>
#include <vector>
#include <array>
#define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i))
#define repeat(i,n) repeat_from(i,0,n)
#define repeat_from_reverse(i,m,n) for (int i = (n)-1; (i) >= (m); --(i))
#define repeat_reverse(i,n) repeat_from_reverse(i,0,n)
using namespace std;
constexpr int... | a.cc: In function 'int main()':
a.cc:42:24: error: 'n' was not declared in this scope
42 | while(scanf("%d", &n) && n){
| ^
|
s873091337 | p00851 | C++ | #include<iostream>
#include<cmath>
#include<complex>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define pb push_back
typedef complex<int> P;
const double eps = 1e-10;
double cross(P a,P b){
return (dou... | a.cc: In function 'void search(int, int, int, int*, int*, P*, std::vector<std::complex<int> >*)':
a.cc:116:19: error: lvalue required as left operand of assignment
116 | in[now].real()=in[now-1].real()+cand[i][j].real();
| ~~~~~~~~~~~~^~
a.cc:117:19: error: lvalue required as left operand of assignm... |
s082401547 | p00853 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define pb push_back
const int N = 50;
class Edge{
public:
int t,c;
};
class state{
public:
int now;
int cost;
vecto... | a.cc: In function 'void dijkstra(int, int, int, int)':
a.cc:57:15: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
57 | if (find(ALL(now.path),edge[now.now][i].t)==
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/i... |
s712590883 | p00854 | Java | import java.util.*;
class Main{
public static void main(String[]z){
Scanner cin=new Scanner(System.in);
int n,k,m;
for(;;System.out.println((r+m)%n+1)){
n=cin.nextInt();k=cin.nextInt();m=cin.nextInt();
if(n==0)break;
for(r=i=0;++i<n;r%=i)r+=k;
}
}
} | Main.java:6: error: cannot find symbol
for(;;System.out.println((r+m)%n+1)){
^
symbol: variable r
location: class Main
Main.java:9: error: cannot find symbol
for(r=i=0;++i<n;r%=i)r+=k;
^
symbol: variable r
location: class Main
Main.java:9: error: cannot find symbol
... |
s272418902 | p00854 | Java | import java.util.LinkedList;
import java.util.Scanner;
//And Then There Was One
public class AOJ1275 {
void run(){
Scanner sc = new Scanner(System.in);
for(;;){
int n = sc.nextInt(), k = sc.nextInt(), m = sc.nextInt();
if((n|k|m)==0)break;
LinkedList<Integer> l = new LinkedList<Integer>();
for(int i=... | Main.java:5: error: class AOJ1275 is public, should be declared in a file named AOJ1275.java
public class AOJ1275 {
^
1 error
|
s072533481 | p00854 | C++ | #include <vector>
#include <cstdio>
using namespace std;
int joseph(int n,int diff,int initial){
int r=0,i=1;
for(;i<n;i++)r=(r+diff)%i;
return (r+1+initial)%n+1;
}
int main(){
int n,k,m;
for(;scanf("%d%d%d",&n,&k,&m),n;){
vector<int>v(n);
for(int i=0;i<n;i++)v[i]=i+1;
printf("%d\n",joseph(v,k,m-1));
}
} | a.cc: In function 'int main()':
a.cc:16:38: error: cannot convert 'std::vector<int>' to 'int'
16 | printf("%d\n",joseph(v,k,m-1));
| ^
| |
| std::vector<int>
a.cc:5:16: not... |
s567421595 | p00854 | C++ | #include <vector>
#include <cstdio>
using namespace std;
int joseph(int n,int diff,int initial){
int r=0,i=1;
for(;i<n;i++)r=(r+diff)%i;
return (r+1+initial)%n+1;
}
int main(){
int n,k,m;
for(;scanf("%d%d%d",&n,&k,&m),n;printf("%d\n",joseph(v,k,m-1)));
} | a.cc: In function 'int main()':
a.cc:13:62: error: 'v' was not declared in this scope
13 | for(;scanf("%d%d%d",&n,&k,&m),n;printf("%d\n",joseph(v,k,m-1)));
| ^
|
s713083364 | p00854 | C++ | #include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<list>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
vector<int>ta;
int n,m... | a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope
16 | cin>>n>>k>>m;
| ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
8 | #include<list>
+++ |+#include <iostream>
9 | using... |
s252308590 | p00854 | C++ | #include<iostream>
#include<vector>
using namespace std;
#define MAX 10001
int n,k,m;
void init(){
for(int i=0;i<MAX;i++)bit[i]=0;
}
int main(){
while(1){
cin>>n>>k>>m;
if(n==0&&k==0&&m==0)break;
init();
vector<int> t;
for(int i=1;i<=n;i++)t.push_back(i);
m--;
for(int i=0;i<n-1;i... | a.cc: In function 'void init()':
a.cc:8:25: error: 'bit' was not declared in this scope
8 | for(int i=0;i<MAX;i++)bit[i]=0;
| ^~~
|
s980469407 | p00854 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int N, K, M; cin >> N >> K >> M;
if (N == 0 and K == 0 and M == 0) break;
M--;
vector<int> stones(N); REP(i, N) stones[i] = i;
while (stones.size() > 1) {
stones.erase(stones.begin() + M);
M = (M + K - 1 + stones.... | a.cc: In function 'int main()':
a.cc:10:32: error: 'i' was not declared in this scope
10 | vector<int> stones(N); REP(i, N) stones[i] = i;
| ^
a.cc:10:28: error: 'REP' was not declared in this scope
10 | vector<int> stones(N); REP(i, N) stones[i] = i;
| ... |
s463511729 | p00854 | C++ | #include<bits/stdc++.h>
#define vector list
using namespace std;
??
signed main(){
????????int a,b,c;
????????while(cin>>a>>b>>c,a|b|c){
????????????????vector<int>V;
????????????????for(int c=0;c<a;c++){
????????????????????????V.push_back(c+1);
????????????????????????}
????????????????auto d=V.begin();
?????????????... | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
|
s700500110 | p00854 | C++ | #include <iostream>
using namespace std;
josephus(int n, int k){
if(n==1) return 0;
return (josephus(n-1,k)+k)%n;
}
int main(){
while(1){
int n,k,m;
cin >> n >> k >> m;
if(n==0) break;
cout << (josephus(n-1,k)+m)%n + 1 << endl;
}
return 0;
} | a.cc:4:1: error: ISO C++ forbids declaration of 'josephus' with no type [-fpermissive]
4 | josephus(int n, int k){
| ^~~~~~~~
|
s520894424 | p00854 | C++ | #include <iostream>
using namespace std;
int main(){
const int nmax = 10000;
register int n, k ,m;
int next[nmax+1];
while(cin >> n >> k >> m){
if(n == 0 && k == 0 && m == 0) break;
for(int i = 1; i < n; i++){
next[i] = i+1;
}
next[n] = 1;
next[m-1] = next[m];
while(next[m] != m){
for(int j = 1; j... | a.cc: In function 'int main()':
a.cc:5:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
5 | register int n, k ,m;
| ^
a.cc:5:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
5 | register int n, k... |
s005545533 | p00854 | C++ | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include... | a.cc: In function 'int main()':
a.cc:47:55: error: expected primary-expression before 'break'
47 | if(st[i])printf("%d\n",st[i]),break;
| ^~~~~
|
s330783447 | p00854 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int n,k,m;
//f(n + 1,n) = f(n,n - 1) - [(n - 1) - (k - 1)% n] % n
void solve(){
int res = 0;
for(int i = 2;i < n;i ++){
res = (res - ((i - 1) - (k - 1) % i + i)%i + i)% i;
}
int res = (res + m) % n + 1;
}
int main(){
while(scanf("%d%d%d",&n,&k,&m)... | a.cc: In function 'void solve()':
a.cc:12:13: error: redeclaration of 'int res'
12 | int res = (res + m) % n + 1;
| ^~~
a.cc:7:13: note: 'int res' previously declared here
7 | int res = 0;
| ^~~
|
s743821274 | p00854 | C++ | #include <iostream>
#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=x && x<w && 0<=y && y<h)
const int INF = 1... | a.cc: In function 'int main()':
a.cc:20:17: error: 'vector' was not declared in this scope
20 | vector<int> v;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#incl... |
s468374747 | p00855 | Java | import java.util.ArrayList;
import java.util.Scanner;
public class AOJ1276 {
public static void main(String[] args) {
init(1300000);
Scanner sc = new Scanner(System.in);
while(true) {
int n = sc.nextInt();
if (n==0) {
break;
}
if (isPrime(n) || n == 1) {
System.out.println(0);
}else{
... | Main.java:4: error: class AOJ1276 is public, should be declared in a file named AOJ1276.java
public class AOJ1276 {
^
1 error
|
s507197824 | p00855 | C | 10
11
27
2
492170
0 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 10
| ^~
|
s109495438 | p00855 | C | #include<stdio.h>
int prime[1300001];
void isprime(void){
int i,j,n,c;
for(i = 4;i<1300001;i += 2)prime[i] = 1;
for (i = 3;i * i <= 1300001;i += 2){
if (prime[i] == 0){
for (j = i + i; j <= 1300001; j += i){
prime[j] = 1;
}
}
}
}
int main(void)... | main.c: In function 'main':
main.c:26:22: error: implicit declaration of function 'IS_PRIME' [-Wimplicit-function-declaration]
26 | for (i = n; !IS_PRIME(i); i--)gap++;
| ^~~~~~~~
main.c:26:39: error: 'gap' undeclared (first use in this function)
26 | for (i = n; !IS_PRI... |
s336811466 | p00855 | C | #include<stdio.h>
int prime[1300001];
void isprime(void){
int i,j,n,c;
for(i = 4;i<1300001;i += 2)prime[i] = 1;
for (i = 3;i * i <= 1300001;i += 2){
if (prime[i] == 0){
for (j = i + i; j <= 1300001; j += i){
prime[j] = 1;
}
}
}
}
int main(void)... | main.c: In function 'main':
main.c:26:22: error: implicit declaration of function 'IS_PRIME' [-Wimplicit-function-declaration]
26 | for (i = n; !IS_PRIME(i); i--)a++;
| ^~~~~~~~
|
s553257341 | p00855 | C++ | #include<iostream>
using namespace std;
int primes[400003];
bool is(int n){
if(n==2)return true;
for(int i=3;i*i<=n;i++)if(n%i==0)return false;
return true;
}
int main(){
int cnt=0,ii=2;
while(true){
if(cnt==400003)break;
if(is(ii)){
primes[cnt]=ii;
cnt++;
}
ii++;
}
int n;
while(cin>>n){
if(n==0)break;
... | a.cc: In function 'int main()':
a.cc:31:12: error: 'i' was not declared in this scope
31 | if(i<=1)cout<<0<<endl;
| ^
|
s311839193 | p00855 | C++ |
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<iostream>
using namespace std;
int primes[200003];
bool is(int n){
for(int i=2;i*i<=n;i++)if(n%i==0)return false;
return true;
}
int main(){
int cnt=0,ii=2;
while(true){
if(cnt==200003)break;
if(is(ii)){
... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 3
| ^
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,
from a... |
s510973841 | p00855 | C++ |
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<iostream>
using namespace std;
int primes[200003];
bool is(int n){
for(int i=2;i*i<=n;i++)if(n%i==0)return false;
return true;
}
int main(){
int cnt=0,ii=2;
while(true){
if(cnt==200003)break;
if(is(ii)){
... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 3
| ^
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,
from a... |
s469092223 | p00855 | C++ | #include<iostream>
using namespace std;
int X, Y, A, i, j;
int main() {
while (true) {
cin >> A;
for (i = A; i >= 2; i--) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { goto E; } }X = i; goto F; E:; }
F:; for (i = A; i < 99999999; i++) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { goto G; } }Y = i; goto ... | a.cc: In function 'int main()':
a.cc:7:61: error: 'sqrt' was not declared in this scope
7 | for (i = A; i >= 2; i--) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { goto E; } }X = i; goto F; E:; }
| ^~~~
a.cc:8:63: error: 'sqrt' wa... |
s117970642 | p00855 | C++ | #include<iostream>
using namespace std;
int X, Y, A, i, j;
int main() {
while (true) {
cin >> A; if (A == 0) { break; }
for (i = A; i >= 2; i--) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { goto E; } }X = i; goto F; E:; }
F:; for (i = A; i < 99999999; i++) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { ... | a.cc: In function 'int main()':
a.cc:7:61: error: 'sqrt' was not declared in this scope
7 | for (i = A; i >= 2; i--) { for (j = 2; j <= sqrt(i); j++) { if (i%j == 0) { goto E; } }X = i; goto F; E:; }
| ^~~~
a.cc:8:63: error: 'sqrt' wa... |
s480038569 | p00855 | C++ | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main{
Scanner sc=new Scanner(System.in);
void run(){
boolean[] p=new boolean[2000000];
Arrays.fill(p, true);
p[0]=p[1]=false;
for(int i=2; i<p.length; i++){
if(p[i]){
for(int j=i*2; j<p.length; j+=i){
p[j]=false;
}
}
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.lang.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1... |
s408985678 | p00855 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
using namespece std;
vector<int> P;
const int pmax=1299709;
bool iscomp[pmax+1];
void init()
{
P.reserve(100000);
for(int i=2;i<pmax+1;i++){
if(iscomp[i])continue;
P.push_back(i);
for(int j=2;i*j<pmax+1;j++)
iscomp[i*j]=true;
}
}
int main()
{
init(... | a.cc:4:7: error: expected nested-name-specifier before 'namespece'
4 | using namespece std;
| ^~~~~~~~~
a.cc:5:1: error: 'vector' does not name a type
5 | vector<int> P;
| ^~~~~~
a.cc: In function 'void init()':
a.cc:10:9: error: 'P' was not declared in this scope
10 | P.reserve(100... |
s429488839 | p00855 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> P;
const int pmax=1299709;
bool iscomp[pmax+1];
void init()
{
P.reserve(100000);
for(int i=2;i<pmax+1;i++){
if(iscomp[i])continue;
P.push_back(i);
for(int j=2;i*j<pmax+1;j++)
iscomp[i*j]=true;
}
}
int main()
{
init(... | a.cc: In function 'int main()':
a.cc:24:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
24 | if(n==0)return;
| ^~~~~~
a.cc:25:36: error: no matching function for call to 'lower_bound(int&)'
25 | int pos=lower_bound... |
s860196008 | p00855 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> P;
const int pmax=1299709;
bool iscomp[pmax+1];
void init()
{
P.reserve(100000);
for(int i=2;i<pmax+1;i++){
if(iscomp[i])continue;
P.push_back(i);
for(int j=2;i*j<pmax+1;j++)
iscomp[i*j]=true;
}
}
int main()
{
init(... | a.cc: In function 'int main()':
a.cc:24:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
24 | if(n==0)return;
| ^~~~~~
|
s648867586 | p00855 | C++ | #include <iostream>
using namespace std;
#define max 1000000;
int prime[max];
void mk_prime(){
for( int i = 0; i < max; i++){
prime[i] = 1;
}
prime[0] = 0;
prime[1] = 0;
for( int i = 2; i < max; i++ ){
if( prime[i] == 1 ){
for( int j = 2 * i; j < max; j += i ){
... | a.cc:3:20: error: expected ']' before ';' token
3 | #define max 1000000;
| ^
a.cc:5:11: note: in expansion of macro 'max'
5 | int prime[max];
| ^~~
a.cc:5:14: error: expected unqualified-id before ']' token
5 | int prime[max];
| ^
a.cc: In function... |
s253074345 | p00856 | Java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
public class hanafudashuffle {
static PrintWriter out;
static InputReader ir;
static final int INF=(int)1e9;
st... | Main.java:8: error: class hanafudashuffle is public, should be declared in a file named hanafudashuffle.java
public class hanafudashuffle {
^
1 error
|
s244351407 | p00856 | C | double P[102][101];
char L[101],B[101];
main(){
int N,T,l,b,x,t,n,k;
for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
memset(P,0,sizeof(P));
memset(L,0,sizeof(L)+sizeof(B));
for(;l--;)scanf("%d",&x),L[x]=1;
for(;b--;)scanf("%d",&x),B[x]=1;
for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
for(k=1;k<=6... | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:5:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
| ^~~~~
main.c:1:1: note: i... |
s673153940 | p00856 | C | double P[102][101];
char L[101],B[101];
main(){
int N,T,l,b,x,t,n,k;
for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
memset(P,0,sizeof(P));
memset(L,0,sizeof(L));
memset(B,0,sizeof(B));
for(;l--;)scanf("%d",&x),L[x]=1;
for(;b--;)scanf("%d",&x),B[x]=1;
for(P[t=0][0]=1;;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++){
... | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:5:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
| ^~~~~
main.c:1:1: note: i... |
s975103342 | p00856 | C | #include <cstdio>
double P[102][101];
char L[101],B[101];
int main(){
int N,T,l,b,x,t,n,k;
for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
memset(P,0,sizeof(P));
memset(L,0,sizeof(L));
memset(B,0,sizeof(B));
for(;l--;)scanf("%d",&x),L[x]=1;
for(;b--;)scanf("%d",&x),B[x]=1;
for(P[t=0][0]=1;t<T;P[t+1][N]+=P[t][N],t... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s269201146 | p00856 | C++ | #include<iostream>
using namespace std;
int board[101];
double prob[101]; | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s219356838 | p00856 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define SZ(n) (int)n.size()
#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x)cerr ... | a.cc: In function 'int main()':
a.cc:30:28: error: 'bre' was not declared in this scope
30 | if(bre[i][j]==1){dp[i+1][j]+=dp[i][j]*(1.0/6.0);continue;}
| ^~~
a.cc:36:48: error: 'bre' was not declared in this scope
36 | if(ta[... |
s100538490 | p00856 | C++ | #include<iostream>
using namespace std;
int main(int argc, char *argv[]){
int n, t, l, b, skip = 1, back = 2;
while(cin >> n >> t >> l >> b, n){
n++;
int measure[n];
double probably[2][n];
double for_skip[n];
memset(measure, 0, sizeof(measure));
memset(for_skip, 0, sizeof(for_skip));
me... | a.cc: In function 'int main(int, char**)':
a.cc:11:5: error: 'memset' was not declared in this scope
11 | memset(measure, 0, sizeof(measure));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#... |
s097692789 | p00856 | C++ | // Aoj_1277.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int map[100 + 1];
double dp[100 + 1][100 + 1];
int N,T,L,B;
int main()
{
int lose;
int back;
while (cin >> N >> T >> L >> B && N != 0 || T != 0 ... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s610527171 | p00856 | C++ | 7 10 0 6 | a.cc:1:2: error: expected unqualified-id before numeric constant
1 | 7 10 0 6
| ^
|
s047031875 | p00856 | C++ | #include <iostream>
#include <cstdio>
const float kProbability = 1.0f / 6.0f;
const int kMaxSquare = 101;
const int kMaxTurn = 101s;
enum BoardState{
BLANK, LOSE, BACK
};
BoardState board[kMaxSquare];
float bp(const int N, const int T){
float prob[kMaxTurn][kMaxSquare];
for (int i = 0; i <= T; i++)
for (int j ... | a.cc:6:22: error: unable to find numeric literal operator 'operator""s'
6 | const int kMaxTurn = 101s;
| ^~~~
a.cc: In function 'float bp(int, int)':
a.cc:15:20: error: size of array 'prob' is not an integral constant-expression
15 | float prob[kMaxTurn][kMaxSquare];
| ... |
s646493813 | p00856 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int N, T, L, B;
while(cin >> N >> T >> L >> B && N>0){
bool lose[100], back[100];
int index;
for(int i=0;i<L;i++){
cin >> index;
lose[index]=true;
}
for(int i=0;i<B;i++){
cin >> index;
back[index]... | a.cc: In function 'int main()':
a.cc:34:22: error: 'tr' was not declared in this scope; did you mean 'to'?
34 | pr+=p[L][tr-1];
| ^~
| to
a.cc:36:23: error: 'tr' was not declared in this scope; did you mean 'to'?
36 | pr+=p[to][tr-2];
... |
s214662540 | p00856 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int N, T, L, B;
while(cin >> N >> T >> L >> B && N>0){
bool lose[100], back[100];
int index;
for(int i=0;i<L;i++){
cin >> index;
lose[index]=true;
}
for(int i=0;i<B;i++){
cin >> index;
back[index]... | a.cc: In function 'int main()':
a.cc:40:15: error: 'tr' was not declared in this scope; did you mean 'pr'?
40 | p[lg][tr]=pr/6.0;
| ^~
| pr
|
s230291318 | p00856 | C++ | #include<iostream>
#include<vector>
using namespace std;
typedef vector<int> vi;
typedef vector<char> vc;
double dp[110][110];
int main() {
while (true) {
memset(dp, 0, sizeof(dp));
int n, l, t, b;
cin >> n >> t >> l >> b;
if (n == 0 && t == 0 && l == 0 && b == 0) {
return 0;
}
vc A(n + 1, 'n');
for ... | a.cc: In function 'int main()':
a.cc:10:17: error: 'memset' was not declared in this scope
10 | 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<vector>
+++ |... |
s058759464 | p00856 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max()/2;
const int MOD = 1e9+7;
const double EX=1.0/6.0;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,t,l,b;
while(cin>>n>>t>>l>>b... | a.cc: In function 'int main()':
a.cc:57:6: error: expected '}' at end of input
57 | }
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s841325675 | p00856 | C++ | #include <iostream>
using namespace std;
int main(){
int N, T, L, B;
while(cin >> N >> T >> L >> B, N){
bool lose[101], back[101];
memset(lose, false, sizeof(lose));
memset(back, false, sizeof(back));
for(int i=0;i<L;i++){
int idx; cin >> idx; lose[idx] = true;
}
for(int i=0;i<B;i++){
int idx; cin... | a.cc: In function 'int main()':
a.cc:9:17: error: 'memset' was not declared in this scope
9 | memset(lose, false, sizeof(lose));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostrea... |
s015748505 | p00856 | C++ | #include <cstdio>
double P[102][101];
char L[101],B[101];
int main(){
int N,T,l,b,x,t,n,k;
for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;){
memset(P,0,sizeof(P));
memset(L,0,sizeof(L));
memset(B,0,sizeof(B));
for(;l--;)scanf("%d",&x),L[x]=1;
for(;b--;)scanf("%d",&x),B[x]=1;
for(P[t=0][0]=1;t<T;P[t+1][N]+=P[t][N],t... | a.cc: In function 'int main()':
a.cc:7:17: error: 'memset' was not declared in this scope
7 | memset(P,0,sizeof(P));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <cstdio>
+++ |+#in... |
s388507913 | p00857 | C++ | #include<iostream>
#include<complex>
#include<cmath>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define mp make_pair
const double eps = 1e-10;
typedef complex<double> P;
class Tri{
public:
P d[3];
};
pair<P,P> CC_intersection(P a,P b,double r1,double r2){
... | a.cc: In function 'P vector_mapping(P, P, P)':
a.cc:80:3: error: 'assert' was not declared in this scope
80 | assert(!(isnan(C)));
| ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
3 | #include<cmath>
+++ |+#include <cassert>
... |
s241117523 | p00858 | Java | import java.util.*;
import java.awt.geom.*;
import ICPClibrary.Geometry.Point3D;
public class Main {
double EPS = 1.0e-08;
int INF = 1 << 24;
Comparator< Point2D > com = new Comparator< Point2D >() {
public int compare(Point2D o1, Point2D o2) {
if(o1.getX() < o2.getX()) return -1;
else if(o1.getX() > o2.get... | Main.java:4: error: package ICPClibrary.Geometry does not exist
import ICPClibrary.Geometry.Point3D;
^
1 error
|
s401462389 | p00858 | C++ |
#include <bits/stdc++.h>
// -----------------------------------------------------------------------
// commonly used template
#if !defined commonly_used_template
#define commonly_used_template
#define REP(i,a,b) for(int i=a; i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-7)
int const INF = 1<<29;
#endif... | a.cc: In function 'int main()':
a.cc:262:14: error: 'f' was not declared in this scope
262 | if(f.to == -1) { continue; }
| ^
|
s814482850 | p00858 | C++ | #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <b... | a.cc:21:2: error: #else without #if
21 | #else
| ^~~~
a.cc:23:2: error: #endif without #if
23 | #endif
| ^~~~~
a.cc: In function 'int {anonymous}::ccw(P, P, P)':
a.cc:90:1: warning: no return statement in function returning non-void [-Wreturn-type]
90 | }
| ^
a.cc: At global scope:
a.cc:263... |
s613579168 | p00858 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,P> P1;
#define fr first
#define sc second
#d... | a.cc:60:42: error: 'int y1 [202]' redeclared as different kind of entity
60 | static int x1[202],y1[202],x2[202],y2[202];
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.