submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s079141691 | p00180 | C++ | #include <iostream>
#include <vector>
using namespace std;
struct Edge {
int from, to, cost;
Edge() : from(0), to(0), cost(0) { }
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) { }
};
struct UnionFind {
vector<int> data;
UnionFind(int n) : data(n, -1) { }
bool same(int i, int j) {
... | a.cc: In function 'int main()':
a.cc:38:5: error: 'sort' was not declared in this scope; did you mean 'short'?
38 | sort(edges.begin(), edges.end(), [](const Edge& a, const Edge& b) {
| ^~~~
| short
|
s446663356 | p00180 | C++ | #include <iostream>
#incldue <cstdio>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;
#define INF 999999
int n, m;
int a, b, c;
int cost[100][100];
int mincost[100];
bool used[100];
void init()
{
rep(i,100) rep(j,100)
{
cost[i][j] = INF;
}
}
int prim()
{
rep(i,n)
{
minco... | a.cc:2:2: error: invalid preprocessing directive #incldue; did you mean #include?
2 | #incldue <cstdio>
| ^~~~~~~
| include
|
s602590928 | p00180 | C++ | #include "Graph.hpp"
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
Graph creat_graph(int n, int m);
int search_prim(Graph prim, int n);
vector<int> ans;
vector<vector<int>> cost(100,vector<int>(100,0));
int main(){
int n,m;
while(cin >> n >> m, n){
Graph prim = creat_grap... | a.cc:1:10: fatal error: Graph.hpp: No such file or directory
1 | #include "Graph.hpp"
| ^~~~~~~~~~~
compilation terminated.
|
s382925449 | p00180 | C++ |
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
Graph creat_graph(int n, int m);
int search_prim(Graph prim, int n);
vector<int> ans;
vector<vector<int>> cost(100,vector<int>(100,0));
class Graph {
private:
const static int INF = 1000000;
std::vector<std::vector<int> > edge_;
unsigne... | a.cc:7:1: error: 'Graph' does not name a type
7 | Graph creat_graph(int n, int m);
| ^~~~~
a.cc:8:17: error: 'Graph' was not declared in this scope; did you mean 'isgraph'?
8 | int search_prim(Graph prim, int n);
| ^~~~~
| isgraph
a.cc:8:29: error: expected prim... |
s271671907 | p00180 | C++ | import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Da... | a.cc:51:20: error: stray '\' in program
51 | replace x y = map (\z -> if z==x then y else z)
| ^
a.cc:53:15: error: stray '@' in program
53 | binMap f (x:xs@(y:_)) = f x y : binMap f xs
| ^
a.cc:58:10: error: stray '`' in program
58 | infixl 7 `divCeil`
| ... |
s798482828 | p00180 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
class Load{
public:
int n,m,o,p;
load(){p=0;}
load(int a,int b){n=a;m=b;p=0;}
};
int n,m;
Load load[100];
int prim(){
vector<int> visit;
visit.push_back(0);
int cont=0;
while(1){
if(visit.size()==n){
break;
}
int maxi=100000... | a.cc:10:9: error: ISO C++ forbids declaration of 'load' with no type [-fpermissive]
10 | load(){p=0;}
| ^~~~
a.cc:11:9: error: ISO C++ forbids declaration of 'load' with no type [-fpermissive]
11 | load(int a,int b){n=a;m=b;p=0;}
| ^~~~
a.cc: In member function 'int Loa... |
s068484073 | p00180 | C++ | #include<iostream>
#include<vector>
#include<cstdio>
#include<cmath>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
using namespace std;
typedef unsigned long long ull;
int main(){
int n,m;
while(scanf("%d%d",&n,&m),n+m){
int cost[n][n];
bool f[n];
memset(cost, 0, sizeof(cost));
memset(f, 0, si... | a.cc: In function 'int main()':
a.cc:17:5: error: 'memset' was not declared in this scope
17 | memset(cost, 0, sizeof(cost));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<cmath>
+++ |+#include <cstring>
... |
s338825282 | p00180 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int data[101][101];
int prim( int n )
{
vector<int> key( n, numeric_limits<int>::max() );
key[0] = 0;
vector<int> pq;
vector<bool> inQueue( n, true );
for( int i = 0;i < n;i++ ){
pq.push_back( key[i] );
}
while( !pq.empty() ){
vect... | a.cc: In function 'int prim(int)':
a.cc:11:29: error: 'numeric_limits' was not declared in this scope
11 | vector<int> key( n, numeric_limits<int>::max() );
| ^~~~~~~~~~~~~~
a.cc:11:44: error: expected primary-expression before 'int'
11 | vector<int> key( n, numer... |
s413569205 | p00180 | C++ | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int data[101][101];
int prim( int n )
{
vector<int> key( n, numeric_limits<int>::max() );
key[0] = 0;
vector<int> pq;
vector<bool> inQueue( n, true );
for( int i = 0;i < n;i++ ){
pq.push_back( key... | a.cc: In function 'int prim(int)':
a.cc:13:29: error: 'numeric_limits' was not declared in this scope
13 | vector<int> key( n, numeric_limits<int>::max() );
| ^~~~~~~~~~~~~~
a.cc:13:44: error: expected primary-expression before 'int'
13 | vector<int> key( n, numer... |
s599623485 | p00180 | C++ | #include<iostream>
#include<vector>
#include<set>
using namespace std;
#define NONE 0
int prim(int n, vector< vector<int> >v)
{
set<int>selected;
set<int>::iterator it;
int mincost,mini;
int i;
int ans=0;
selected.insert(0);
while(selected.size()!=n){
mincost=INT_MAX;
mini=NONE;
for(it=se... | a.cc: In function 'int prim(int, std::vector<std::vector<int> >)':
a.cc:19:13: error: 'INT_MAX' was not declared in this scope
19 | mincost=INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include<set... |
s194996420 | p00180 | C++ | #include <stdio.h>
#define MAX 101
struct Dis
{
int pa[MAX];
int used[MAX];
int n;
Dis(int n):n(n)
{
for(int i=0;i<n;i++)
{
pa[i]=i;
used[i]=0;
}
}
void use(int i)
{
used[i]=1;
}
int root(int a)
{
if(pa[a]==a)... | a.cc: In function 'int main()':
a.cc:87:27: error: too few arguments to function 'int getMin(int)'
87 | int min=getMin();
| ~~~~~~^~
a.cc:54:5: note: declared here
54 | int getMin(int m)
| ^~~~~~
a.cc: In function 'int getMin(int)':
a.cc:71:1: warning: control reach... |
s437082113 | p00180 | C++ | #include<algorithm>
#include<vector>
using namespace std;
struct edge{int u,v,cost;};
int par[101],rank[101];
edge es[200];
int V,E;
void init_union_find(int n){for(int i=0;i<n;i++)par[i]=i,rank[i]=0;}
int find(int x){
if(par[x]==x)return x;
else return par[x]=find(par[x]);
}
void unite(int x,int y){
x=find... | a.cc: In function 'void init_union_find(int)':
a.cc:12:58: error: reference to 'rank' is ambiguous
12 | void init_union_find(int n){for(int i=0;i<n;i++)par[i]=i,rank[i]=0;}
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
... |
s596800845 | p00181 | Java | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll m, n;
ll w[110];
bool check(ll mid){
ll sum=0, count=1;
for(ll i=1; i<=n; i++){
if(w[i]>mid) return false;
sum+=w[i];
if(sum>mid){
count++;
sum=... | Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
^
Main.java:4: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:6: error: class, interface, enum, or record expected
... |
s711793272 | p00181 | Java |
import java.util.Scanner;
//Persistence
public class AOJ0181 {
static int[] w;
static int n, m;
static boolean f(int W){
int need = 1;
int s = 0;
for(int i=0;i<n;i++){
if(w[i]>W)return false;
if(s+w[i]>W){
need++;
s = 0;
}
s+=w[i];
}
return need <= m;
}
public static void main(... | Main.java:5: error: class AOJ0181 is public, should be declared in a file named AOJ0181.java
public class AOJ0181 {
^
1 error
|
s578035816 | p00181 | C | #include <cstdio>
using namespace std;
int bookin(int* books,int m,int w,int n);
int main(void)
{
int n,m;
for(;;){
scanf("%d %d",&m,&n);
if(n==0)return 0;
int books[n];
for(int i=0;i<n;i++){
scanf("%d",&books[i]);
}
int low = 1,high=1500000;
for(int i=0;i<100;i++){
int mid... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s040527891 | p00181 | C | 3 9
500
300
800
200
100
600
900
700
400
4 3
1000
1000
1000
0 0 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 3 9
| ^
|
s602733269 | p00181 | C | #include<stdio.h>
#include<math.h>
int w[100];
int m, n;
int func(int h) {
int i=0, sum = 0,count=0;
while(i<n && count < m){
if (h >= sum + w[i])
sum += w[i++];
else {
sum = 0;
count++;
}
}
return i == n && count < m;
}
int binsearch_func(int low, int hight) {
int i;
for (i = 0; i < 100;... | main.c: In function 'binsearch_func':
main.c:29:16: error: implicit declaration of function 'max'; did you mean 'fmax'? [-Wimplicit-function-declaration]
29 | return max(low,hight);
| ^~~
| fmax
|
s095432644 | p00181 | C | //suhan lee, saitama university;
#include <iostream>
using namespace std;
int putbook(int *list,int bookwi,int stair,int width){
int dara[20];
int j=0;
for(int i=0;i<20;i++)
dara[i]=0;
for(int i=0;i<bookwi;i++)
if(dara[j]+list[i]<=width)
dara[j]+=list[i];
else if(list[i]>width){
//cout... | main.c:2:10: fatal error: iostream: No such file or directory
2 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s899997995 | p00181 | C++ | ?
1
2
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define INF 99999999
... | a.cc:1:1: error: expected unqualified-id before '?' token
1 | ?
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:47:
/usr/include... |
s093216951 | p00181 | 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;
//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Downloa... | a.cc: In function 'int main()':
a.cc:34:56: error: 'asa' was not declared in this scope; did you mean 'as'?
34 | num += asa[b];
| ^~~
| as
|
s412225854 | p00181 | C++ | import Control.Monad
import Control.Applicative
main :: IO ()
main = do
[m, n] <- getInts
if (m == 0 && n == 0) then return ()
else do
ss <- getIntLines n
print $ rolve m ss
main
rolve m ss = bin_search (kuwa ss m) 0 1000000
kuwa xs m n = func xs m n n
where
func (x:xs) m n l
| m <= 0 =... | a.cc:1:1: error: 'import' does not name a type
1 | import Control.Monad
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s174006559 | p00181 | C++ | import Control.Applicative
main :: IO ()
main = do
[m, n] <- getInts
if (m == 0 && n == 0) then return ()
else do
ss <- getIntLines n
print $ rolve m ss
main
rolve m ss = bin_search (kuwa ss m) 0 1000000
kuwa xs m n = func xs m n n
where
func (x:xs) m n l
| m <= 0 = False
| m > 0 ... | a.cc:1:1: error: 'import' does not name a type
1 | import Control.Applicative
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s563212247 | p00181 | C++ |
main :: IO ()
main = do
[m, n] <- getInts
if (m == 0 && n == 0) then return ()
else do
ss <- getIntLines n
print $ rolve m ss
main
rolve m ss = bin_search (kuwa ss m) 0 1000000
kuwa xs m n = func xs m n n
where
func (x:xs) m n l
| m <= 0 = False
| m > 0 && xs == [] && n - x >= 0 =... | a.cc:2:1: error: 'main' does not name a type
2 | main :: IO ()
| ^~~~
|
s816958048 | p00181 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,a[101];
bool nibun(int x){
int s=0,q=0,t=0;
r(i,n){
if(s+a[i]<=x)s+=a[i];
else s=0,q++,i--,t++;
if(t>1000)return 0;
}
return m>=q+1;
}
main(){
while(cin>>m>>n,m){
y=1e9;
r(i,n)cin>>a[i];
int l=0,r=1500001;
wh... | a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
14 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:16:11: error: 'y' was not declared in this scope; did you mean 'yn'?
16 | y=1e9;
| ^
| yn
|
s018410716 | p00181 | C++ | #include <iostream>
#include <map>
using namespace std;
int m,n,*b,*l,mp;
map<int,int> hk;
int max(){
int tmp = l[0];
for(int i=1; i<m; i++)
if(tmp < l[i])
tmp = l[i];
return tmp;
}
void solve(){
mp = 0;
int k;
l[0] = 0;
for(int i=0; i<n; i++){
k = i+1;
l[0] += b[i];
for(int j=1; j<m-1; j++){
l[... | a.cc: In function 'void solve()':
a.cc:31:91: error: expected ')' before ';' token
31 | if((l[0] - l[j] >= 0 && l[0] - l[j] < l[j] + b[k+1] - l[0];)||(l[j] >= l[0])){
| ~ ^
| ... |
s143524217 | p00181 | C++ | #include <iostream>
#include <map>
using namespace std;
int m,n,*b,*l,mp;
map<int,int> hk;
int max(){
int tmp = l[0];
for(int i=1; i<m; i++)
if(tmp < l[i])
tmp = l[i];
return tmp;
}
void erase(){
for(int i=1; i<m; i++)
l[i] = 0;
}
void solve(int x, int y){
l[x] = 0;
for(int i=y; i<n; i++){
l[x] += b[... | a.cc: In function 'void solve(int, int)':
a.cc:33:20: error: 'hl' was not declared in this scope; did you mean 'l'?
33 | if(hl[mp-1] < hk[mp])
| ^~
| l
a.cc:34:30: error: label 'FIN' used but not defined
34 | goto FIN;
... |
s809626742 | p00181 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int n, m;
int data[100];
int mid, l, r;
bool check(){
int w = 0;
for(int i=0;i<m;i++){
int sum = 0;
for(;w<n;w++){
if(sum + data[w] > mid) break;
sum += data[w];
}
if(w>=n) break;
}
if(w >= n) return true;... | a.cc: In function 'bool check()':
a.cc:15:19: error: reference to 'data' is ambiguous
15 | if(sum + data[w] > mid) break;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include... |
s823279111 | p00181 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
... | a.cc: In function 'int height(const vint&, int)':
a.cc:48:45: error: 'INT_MAX' was not declared in this scope
48 | if(w < v[i]) return INT_MAX;
| ^~~~~~~
a.cc:24:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by ... |
s793986283 | p00181 | C++ |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>... | a.cc: In function 'int height(vint&, int)':
a.cc:49:45: error: 'INT_MAX' was not declared in this scope
49 | if(w < v[i]) return INT_MAX;
| ^~~~~~~
a.cc:25:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding... |
s892883746 | p00181 | C++ | #include<iostream>
using namespace std;
int m, n;
hon[100];
int f(int w) {
int honIdx = 0;
for (int i = 0; i < m; i++) {
int curW = w;
while (hon[honIdx] <= curW) {
curW -= hon[honIdx];
honIdx++;
if (honIdx == n) return 1;
}
}
return 0;
}
int binsearch_lower_bound() {
int low = 0; // 範囲の下限
in... | a.cc:6:1: error: 'hon' does not name a type
6 | hon[100];
| ^~~
a.cc: In function 'int f(int)':
a.cc:12:24: error: 'hon' was not declared in this scope
12 | while (hon[honIdx] <= curW) {
| ^~~
a.cc: In function 'int main()':
a.cc:38:32: error: 'hon' was not decl... |
s356801298 | p00182 | Java | import java.util.Arrays;
import java.util.Scanner;
//Beaker
public class Main {
int n;
int[] a;
boolean[] have, t;
boolean dfs(int k, int rest){
if(rest==0){
for(int i=0;i<n;i++)t[i]=have[i];
return greedy();
}
if(rest < a[k])return false;
have[k] = true;
if(dfs(k+1, rest-a[k]))return true;
ha... | Main.java:62: error: cannot find symbol
new AOJ0182().run();
^
symbol: class AOJ0182
location: class Main
1 error
|
s116700314 | p00182 | C++ | #include<iostream>
#include<vector>
#include<bitset>
#include<set>
#include<tuple>
#include<algorithm>
#include<functional>
using namespace std;
const int N = 50;
int n;
vector<int> beaker;
bitset<N> full;
bitset<N> used;
bool pour(int water, int start);
bool check();
bool pour(int water, int start) {
for(int i... | a.cc: In function 'int main()':
a.cc:60:9: error: 'memo' was not declared in this scope
60 | memo.clear();
| ^~~~
|
s118507757 | p00182 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define FREE 0
#define TRIED 1
#define LOCKED 2
#define DONE 3
//0182
int main(){
int n,x;
while(cin >> n, n){
vector<int> v1;
int capacity=0;
char used[10]={0}; //0:free 1:tried 2:locked 3:done
//char *used = new char[n];
for(int i=0; i<n; ++i)... | a.cc: In function 'int main()':
a.cc:25:17: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(v1.begin(),v1.end(), greater<int>());
| ^~~~
| short
|
s274215989 | p00182 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
using namespace std;
#de... | a.cc: In function 'int main()':
a.cc:83:25: error: 'visited' was not declared in this scope
83 | visited[i].clear();
| ^~~~~~~
|
s554815866 | p00182 | C++ | #include<cstdio>
#include<algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
bool dfs(int i);
int n,a[50];
bool vis[50],fil[50];
bool dfs2(int i,int j,int rem){ // partition
if(rem==0) return dfs(i+1);
if(j==n) return false;
if(!vis[j] && a[j]<=rem){
vis[j]=fil[j]=true;
if(dfs2(i,j+1,... | a.cc: In function 'int main()':
a.cc:46:28: error: 'greater' was not declared in this scope
46 | sort(a,a+n,greater<int>());
| ^~~~~~~
a.cc:46:36: error: expected primary-expression before 'int'
46 | sort(a,a+n,greater<int>());
| ... |
s554555181 | p00182 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <cstdio>
using namespace std;
clock_t start, end;
vector<int> v;
int dn[100]={};
int dfs(int x,int r){
end=clock();
if( (double)(end - start) > 0.1 * CLOCKS_PER_SEC ){
return 0;
}
if( !dn[x] ) return 0;
if( r < 0 ) return 0;
... | a.cc: In function 'int dfs(int, int)':
a.cc:13:9: error: reference to 'end' is ambiguous
13 | end=clock();
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,... |
s096213558 | p00183 | C | #include<stdio.h>
int main(){
int b[3][3];
int i,j;
while(1){
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf("%d",&b[i][j]);
if(board[i][j]==0)return 0;
}
}
if(b[0][0]==b[0][1]&&b[0][1]==b[0][2]&&b[0][2]==b[0][0]){
... | main.c: In function 'main':
main.c:11:20: error: 'board' undeclared (first use in this function)
11 | if(board[i][j]==0)return 0;
| ^~~~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
|
s931247699 | p00183 | C | #include <stdio.h>
int main(void) {
char input[3][4];
int win;
while(1) {
gets(input[0]);
if(input[0][0]=='0')break;
gets(input[1]);
gets(input[2]);
win=0;
for(i=0;i<3;i++) {
if(input[i][0]==input[i][1] &&
input[i][1]==input[i][2] &&
input[i][0]!='+') {
printf("%c\n",input[i][0]);
... | main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(input[0]);
| ^~~~
| fgets
main.c:12:21: error: 'i' undeclared (first use in this function)
12 | ... |
s963342297 | p00183 | C | #include <stdio.h>
int main(void) {
char input[3][4];
int win;
int i;
while(1) {
gets(input[0]);
if(input[0][0]=='0')break;
gets(input[1]);
gets(input[2]);
win=0;
for(i=0;i<3;i++) {
if(input[i][0]==input[i][1] &&
input[i][1]==input[i][2] &&
input[i][0]!='+') {
printf("%c\n",input[i][... | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
8 | gets(input[0]);
| ^~~~
| fgets
|
s378880373 | p00183 | C | #include <stdio.h>
int main(void) {
char input[3][12];
int win;
int i;
while(1) {
fgets(input[0],sizeof(input[0],stdin);
if(input[0][0]=='0')break;
fgets(input[1],sizeof(input[1],stdin);
fgets(input[2],sizeof(input[2],stdin);
win=0;
for(i=0;i<3;i++) {
if(input[i][0]==input[i][1] &&
input[i][1]... | main.c: In function 'main':
main.c:8:54: error: expected ')' before ';' token
8 | fgets(input[0],sizeof(input[0],stdin);
| ~ ^
| )
main.c:8:17: error: too few arguments to function 'fg... |
s923620955 | p00183 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end... | a.cc: In function 'int main()':
a.cc:26:103: error: expected ';' before '}' token
26 | else if(in[i][0]==in[i][1]&&in[i][1]==in[i][2]&&in[i][0]!='+'){cout<<in[i][0]<<endl;h=true;break}
| ^
| ... |
s133557749 | p00183 | C++ | #include<iostream>
#include<cmath>
#include<vector>
#include<string>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;
int main(void){
char maze[3][3];
... | a.cc: In function 'int main()':
a.cc:15:14: error: 'mazze' was not declared in this scope; did you mean 'maze'?
15 | while(cin>>mazze[0][0]){
| ^~~~~
| maze
|
s206248477 | p00183 | C++ | include <bits/stdc++.h>
using namespace std;
int main()
{
string str1, str2, str3;
while (cin >> str1, str1 != "0"){
bool b, w;
b = w = false;
cin >> str2 >> str3;
if (str1[0] == str1[1] && str1[0] == str1[2]){
if (str1[0] == 'b') b = true;
if (str1[0] == 'w') w = true;
}
els... | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
6 | string str1, str2, str3;
| ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope
7 | while (cin >> str1... |
s748066461 | p00183 | C++ | #include <cstdio>
#include <string>
using namespace std;
int main(void)
{
string board[3];
string set[2];
string y_comp;
string t_comp;
string l_comp;
string r_comp;
char str[4];
bool flag = false;
set[0] = "bbb";
set[1] = "www";
while (1){
for (int i = 0; i < 3; i++){
scanf("%s", str);
if (str[... | a.cc: In function 'int main()':
a.cc:45:53: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
45 | else if (r_comp == set[1] || l_comp == str[1]) printf("w\n");
| ~~~~~~ ^~ ~~~~~~
... |
s069166888 | p00183 | C++ | bbw
wbw
+b+
bwb
wbw
wbw
0 | a.cc:1:1: error: 'bbw' does not name a type
1 | bbw
| ^~~
|
s189962266 | p00184 | C | #include <stdio.h>
int sum[7];
int main(void)
{
int i, j, n, g;
while (scanf("%d", &n), n != 0){
for (j = 0; j < n; j++){
sacnf("%d", &g);
if (G / 10 > 6){
sum[6]++;
}
else {
sum[g / 10]++;
}
}
for (i = 0; i < 7; i++){
printf("%d\n", sum[i]);
sum[i] = 0;
}
}
return 0;
} | main.c: In function 'main':
main.c:10:25: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
10 | sacnf("%d", &g);
| ^~~~~
| scanf
main.c:11:29: error: 'G' undeclared (first use i... |
s071880892 | p00184 | C | #include <stdio.h>
int sum[7];
int main(void)
{
int i, j, n, g;
while (scanf("%d", &n), n != 0){
for (j = 0; j < n; j++){
sacnf("%d", &g);
if (g / 10 > 6){
sum[6]++;
}
else {
sum[g / 10]++;
}
}
for (i = 0; i < 7; i++){
printf("%d\n", sum[i]);
sum[i] = 0;
}
}
return 0;
} | main.c: In function 'main':
main.c:10:25: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
10 | sacnf("%d", &g);
| ^~~~~
| scanf
|
s659650601 | p00184 | C | #include <stdio.h>
int main(void)
{
int n,i;
int sum=0,a;
int b[11]={0};
while(scanf("%d",&n)&&n!=0){
for(i=0;i<n;i++){
scanf("%d",&a);
b[a%10]++;
}
b[6]=b[6]+b[7]+b[8]+b[9]+b[10];
printf("%d\n",n);
for(i=0;i<7;i++){
printf("%d\n",b[i]);
}
return 0 ;
} | main.c: In function 'main':
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s009956531 | p00184 | C | #include <stdio.h>
int main(void)
{
int n,i;
int sum=0,a;
int b[11]={0};
while(scanf("%d",&n)&&n!=0){
for(i=0;i<n;i++){
scanf("%d",&a);
if(a<60)
b[a%10]++;
else
b[6]++;
}
b[6]=b[6]+b[7]+b[8]+b[9]+b[10];
printf("%d\n",n);
for(i=0;i<7;i++){
printf("%d\n",b[i]);
}
return 0 ;
} | main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
23 | }
| ^
|
s970820856 | p00184 | C | #include <stdio.h>
int main(void)
{
int n, a, c1, c2, c3, c4, c5, c6, c7;
scanf("%d", &n);
c1 = c2 = c3 = c4 = c5 = c6 = c7 = 0;
while (n--){
scanf("%d", &a);
if (a < 10){
c1++;
}0
else if (a < 20){
c2++;
}
else if (a < 30){
c3++;
}
else if (a < 40){
c4++;
}
else if (a < 50){
... | main.c: In function 'main':
main.c:15:19: error: expected ';' before 'else'
15 | }0
| ^
| ;
16 | else if (a < 20){
| ~~~~
|
s454193980 | p00184 | C | #include <stdio.h>
int main(void)
{
int n;
int age;
int a_g[7] = {0};
int i;
while (1) {
scanf("%d", &n);
if (n == 0) {
break;
}
else {
for (i = 0; i < n; i++) {
scanf("%d", &age);
if ((age >= 0) && (age <= 9)) {
a_g[0]++;
}
else if ((age >= 10) && (age <=... | main.c: In function 'main':
main.c:60:20: error: subscripted value is neither array nor pointer nor vector
60 | age[7] = {0};
| ^
main.c:60:26: error: expected expression before '{' token
60 | age[7] = {0};
| ^
|
s045367106 | p00184 | C | #include<stdio.h>
int main(void)
{
int dataset = 0;
int age;
int i;
int s;
int pnum[7];
scanf("%d",&dataset);
for(i = 0;i < dataset;i++)
{
scanf("%d",&age);
s = (age / 10);
punm[s]++;
}
for(i = 0;i < 7;i++)
{
printf("%d\n",punm[i]);
}
return 0;
} | main.c: In function 'main':
main.c:15:17: error: 'punm' undeclared (first use in this function); did you mean 'pnum'?
15 | punm[s]++;
| ^~~~
| pnum
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
|
s672850690 | p00184 | C | #include<stdio.h>
int main(void)
{
int dataset = 0;
int age;
int i;
int s;
int pnum[7];
scanf("%d",&dataset);
for(i = 0;i < dataset;i++)
{
scanf("%d",&age);
s = (age / 10);
pnum[s]++;
}
for(i = 0;i < 7;i++)
{
printf("%d\n",punm[i]);
}
return 0;
} | main.c: In function 'main':
main.c:19:31: error: 'punm' undeclared (first use in this function); did you mean 'pnum'?
19 | printf("%d\n",punm[i]);
| ^~~~
| pnum
main.c:19:31: note: each undeclared identifier is reported only once... |
s247751359 | p00184 | C | #include<stdio.h>
int main(void)
{
int dataset = 0;
int age;
int i;
int s;
int pnum[7] = 0;
scanf("%d",&dataset);
for(i = 0;i < dataset;i++)
{
scanf("%d",&age);
if(age >= 70)
{
age = 60;
}
s = (age / 10);
pnum[s]++;
}
for(i = 0;i < 7;i++)
{
printf("%d\n",pnum[i]);
}
return 0;
} | main.c: In function 'main':
main.c:9:23: error: invalid initializer
9 | int pnum[7] = 0;
| ^
|
s313307512 | p00184 | C | #include<stdio.h>
int main(){
int a[200000],b[7],i,j,c;
while(1){i=0;
b[0]=0;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=0;b[6]=0;
scanf("%d",&c);
if(c==0)break;
while(i-c<0){
scanf("%d",&a[i]);
if(a[i]>=0&&a[i]<10)b{0}++;
if(a[i]>=10&&a[i]<20)b[1]++;
if(a[i]>=20&&a[i]<30)b[2]++;
if(a[i]>=30&&a[i]<40)b[3]++;
if(a[i]>=40&&a[i]<50)... | main.c: In function 'main':
main.c:10:22: error: expected ';' before '{' token
10 | if(a[i]>=0&&a[i]<10)b{0}++;
| ^
| ;
|
s899743573 | p00184 | C | #include<stdio.h>
int main(){
int n,a[7];
while(scanf("%d",&n),n){
for(i=0;i<n;i++){
scanf("%d",&x);
if(x<10)
a[0]++;
else if(x<20)
a[1]++;
else if(x<30)
a[2]++;
else if(x<40)
a[3]++;
else if(x<50)
a[4]++;
else if(x<60)
a[5]++;
else a[6]++;
}
for(i=0;i<7;i++)
printf("%d\n",a[i]);
}
return 0;
} | main.c: In function 'main':
main.c:5:5: error: 'i' undeclared (first use in this function)
5 | for(i=0;i<n;i++){
| ^
main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:13: error: 'x' undeclared (first use in this function)
6 | scanf("%d",&x);
... |
s959688550 | p00184 | C | // include
// ----------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
// repetition
// ----------------------------------------------------------------------------
#define FOR(i, a, b) fo... | main.c: In function 'main':
main.c:90:5: error: expected declaration or statement at end of input
90 | }
| ^
|
s413924107 | p00184 | C | #include<stdio.h>
int main(){
int i;
int n;
int old;
int und = 0;
int a[7] = 0, 0, 0, 0, 0, 0, 0;
while(n != 0){
scanf("%d", &n);
for(i = n + 1; i > 0; i--){
scanf("%d", &old);
if(old < 10){
a[0]++;
}else if(old < 20){
a[1]++;
}else if(old < 30){
a[2]++;
}else i... | main.c: In function 'main':
main.c:8:20: error: invalid initializer
8 | int a[7] = 0, 0, 0, 0, 0, 0, 0;
| ^
main.c:8:23: error: expected identifier or '(' before numeric constant
8 | int a[7] = 0, 0, 0, 0, 0, 0, 0;
| ^
|
s236720328 | p00184 | C | #include<stdio.h>
int main(){
int i;
int n;
int old;
int a = 0, 0, 0, 0, 0, 0, 0;
while(n != 0){
scanf("%d", &n);
for(i = n + 1; i > 0; i--){
scanf("%d", &old);
if(old < 10){
a[0]++;
}else if(old < 20){
a[1]++;
}else if(old < 30){
a[2]++;
}else if(old < 40){
... | main.c: In function 'main':
main.c:7:20: error: expected identifier or '(' before numeric constant
7 | int a = 0, 0, 0, 0, 0, 0, 0;
| ^
main.c:14:42: error: subscripted value is neither array nor pointer nor vector
14 | a[0]++;
| ... |
s772104061 | p00184 | C | #include<stdio.h>
int main(){
int i;
int n;
int old;
int a[7] = 0, 0, 0, 0, 0, 0, 0;
while(n != 0){
scanf("%d", &n);
for(i = n + 1; i > 0; i--){
scanf("%d", &old);
if(old < 10){
a[0]++;
}else if(old < 20){
a[1]++;
}else if(old < 30){
a[2]++;
}else if(old < 40){
... | main.c: In function 'main':
main.c:7:20: error: invalid initializer
7 | int a[7] = 0, 0, 0, 0, 0, 0, 0;
| ^
main.c:7:23: error: expected identifier or '(' before numeric constant
7 | int a[7] = 0, 0, 0, 0, 0, 0, 0;
| ^
|
s933348007 | p00184 | C++ | #incude<stdio.h>
int main(){
int n[8]={};
int N,x;
while(1){
scanf("%d",&N);if(N==0)break;
for(int i=0;i<N;i++)
{
scanf("%d",&x);
if(x<10)n[0]++;
else if(x<20)n[1]++;
else if(x<30)n[2]++;
else if(x<40)n[3]++;
else if(x<50)n[4]++;
else if(x<60)n[5]++;
else if(x>=60)n[6]++;
}
for(int i=0;i<7;i++)
printf("%d\n",n[i]);
... | a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
1 | #incude<stdio.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:8:1: error: 'scanf' was not declared in this scope
8 | scanf("%d",&N);if(N==0)break;
| ^~~~~
a.cc:22:1: error: 'printf' was not declar... |
s749267846 | p00184 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
using namespace std;
#define pb(n) push_back(n)
#define mk(n,m) make_pair(n,m)
#define fi first
#define se second
#define all(r) r.beg... | a.cc: In function 'int main()':
a.cc:47:45: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
47 | v[i]++;
| ~~~~^~
a.cc:54:29: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_... |
s439546162 | p00184 | C++ | using System;
class Program {
static void Main() {
for (string line; (line = Console.ReadLine()) != "0";) {
var n = int.Parse(line);
var ages = new int[7];
for (var i = 0; i < n; i++) {
var age = int.Parse(Console.ReadLine());
ages[age >=... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:19:2: error: expected ';' after class definition
19 | }
| ^
| ;
a.cc: In static member function 'static void Program::Main()':
a.cc:5:14: error: 'string' was not declared in this scope
5 ... |
s288279419 | p00184 | C++ | #include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>
using namespace std;
int main (void)
{
for (int u = 0; u < 100; u++)
{
long n;
cin >> n;
int a[10000],p... | a.cc: In function 'int main()':
a.cc:37:49: error: redeclaration of 'int u'
37 | int o = 0,p = 0,q = 0,r = 0,s = 0,t = 0,u = 0;
| ^
a.cc:17:18: note: 'int u' previously declared here
17 | for (int u = 0; u < 100; u++)
| ^... |
s301656832 | p00184 | C++ | #include<iostream>
int main() {
int am[7]={0,0,0,0,0,0,0};
int i,k;
while(1) {
std::cin>>i;
if(i==0)break;
for(int j=0;j<i;j++) {
std::cin>>k;
if(k>60)k=60;
am[k/10]++;
}
for(i=0;i<7;i++) std::coutam[i]<<"\n",am[i]=0;
}
} | a.cc: In function 'int main()':
a.cc:13:27: error: 'coutam' is not a member of 'std'; did you mean 'cout'?
13 | for(i=0;i<7;i++) std::coutam[i]<<"\n",am[i]=0;
| ^~~~~~
| cout
|
s664498267 | p00184 | C++ | #include <stdio.h>
int main(void)
{
int data[7] = {0};
int n;
int d;
scanf("%d", &n);
for (int i = 0; i < n; i++){
scanf("%d", &d);
if (d >= 60){
data[6]++;
}
else {
data[d / 10]++;
}
for (int i = 0; i < 7; i++){
printf("%d\n", data[i]);
}
return (0);
} | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s296341900 | p00184 | C++ | #include<iostream>
using namespace std;
int m,n;
int p[7]
int main(){
cin >> n;
if(!n)
return 0;
for(int i=0; i<7; i++)
p[i] = 0;
for(int i=0; i<n; i++){
cin >> m;
if(m>=70)
m = 60;
p[m%10]++;
}
for(int i=0; i<7; i++)
cout << p[i] << endl;
} | a.cc:7:1: error: expected initializer before 'int'
7 | int main(){
| ^~~
|
s906354809 | p00184 | C++ | while true do
n = gets.to_i
break if n == 0
people_num = [ 0, 0, 0, 0, 0, 0, 0, ]
n.times do
age = gets.to_i
if age < 10 then
people_num[0] += 1
elsif age < 20 then
people_num[1] += 1
elsif age < 30 then
people_num[2] += 1
elsif age < 40 then
people_num[3] += 1
... | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while true do
| ^~~~~
|
s185035418 | p00184 | C++ | #include <iostream>
int main() {int n, x;while(std::cin>>n,n){int dat[7]={};for(int i=0;i<n;i++){cin>>x;if(x/10>6)x=60;dat[x/10]++;}for(int i=0;i<7;i++)std::cout<<dat[i]<<'\n';}} | a.cc: In function 'int main()':
a.cc:2:78: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
2 | int main() {int n, x;while(std::cin>>n,n){int dat[7]={};for(int i=0;i<n;i++){cin>>x;if(x/10>6)x=60;dat[x/10]++;}for(int i=0;i<7;i++)std::cout<<dat[i]<<'\n';}}
| ... |
s997639893 | p00185 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] pri = new int[1000002];
for(int i=2;i<=1000000;i++){
pri[i] = i;
}
for(int i=2;i<=1000000;i++){
for(int j=i+i;j<=1000000;j+=i){
pri[j]=0;
}
}
while(true){
in... | Main.java:30: error: reached end of file while parsing
}
^
1 error
|
s096138864 | p00185 | C | #include <stdio.h>
int a[1000000];
int ans[500]
int main(void)
{
int n, i, j, s = 0;
for (i = 1; i < 10000000; i++){
for (i = 2; i * j < 10000000; j++){
a[i * j] = 1;
}
}
while(scanf("%d", &n) != 0){
for (i = 1; i < 10000000; i++){
for(j = 10000000; j > 0; j--){
if (a[i] + ... | main.c:4:13: error: expected ';' before 'int'
4 | int ans[500]
| ^
| ;
5 |
6 | int main(void)
| ~~~
main.c: In function 'main':
main.c:20:11: error: 'ans' undeclared (first use in this function)
20 | ans[s]++;
| ^~~
main.c:20:... |
s767150501 | p00185 | C | ???#include<stdio.h>
#include<math.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n<>0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scan... |
s071864570 | p00185 | C | ???#include<stdio.h>
#include<math.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n<>0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scan... |
s501115634 | p00185 | C | ???#include<stdio.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n!=0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j== 0)break;
... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
|
s971421734 | p00185 | C | ???#include<stdio.h>
#include<math.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n!=0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scan... |
s311960450 | p00185 | C | ???#include<stdio.h>
#include<math.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n!=0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scan... |
s365149550 | p00185 | C | ???#include<stdio.h>
#include<math.h>
int main(){
int n,p,q,i,j,count=0;
// FILE *fo;
// fo=fopen("data.txt","r");
// fscanf(fo,"%d",&n);
scanf("%d",&n);
while(n!=0){
for(p=1;p<=(n/2);p++){
q=n-p;
for(i=p/2;i>=2;i--)
if(p % i== 0)break;
if(i==1){
for(j=q/2;j>=2;j--)
if(q % j... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ???#include<stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | ???#include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scan... |
s221688071 | p00185 | C | j,p[1<<20],n;main(i){for(;++i<999;)if(!p[i])for(j=i+i;j<1<<20;j+=i)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++; | main.c:1:1: warning: data definition has no type or storage class
1 | j,p[1<<20],n;main(i){for(;++i<999;)if(!p[i])for(j=i+i;j<1<<20;j+=i)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++;
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-in... |
s651055105 | p00185 | C | j,p[1<<20],n;main(i){for(;++i<999;)if(!p[i])for(j=i+i;j<1<<20;j+=i)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++; | main.c:1:1: warning: data definition has no type or storage class
1 | j,p[1<<20],n;main(i){for(;++i<999;)if(!p[i])for(j=i+i;j<1<<20;j+=i)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++;
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-in... |
s577902779 | p00185 | C | #include<stdio.h>
#include<math.h>
#define N 1000000
int prime[N];
int main(){
int i,n,c,j;for(i=0;i<N;i++)prime[i]=1;
prime[0] = prime[1] = 0;
for(i=4;i<N;i+=2)prime[i]=0;
for(i=3;i<N;i+=2){
if(prime[i] == 0 )continue;
for(j=i+i;j<N;j+=i)prime[j]=0;
}
for(;scanf("%d",&n)&&n;){c=0;for(i=0;i<=n/2;i++){if(prime... | main.c: In function 'main':
main.c:13:101: error: 'count' undeclared (first use in this function)
13 | for(;scanf("%d",&n)&&n;){c=0;for(i=0;i<=n/2;i++){if(prime[i]&&prime[n-i])c++;}printf("%d\n",count);}return 0;}
| ... |
s511131003 | p00185 | C | #include<stdio.h>
#include<string.h>
int main(){
int n,i,j,ans;
bool f[1000005];f[0]=f[1]=false;
memset(f,true,sizeof(f));
for(i=3;i<1000005;i++){
if(f[i]){
for(j=2;i*j<1000005;j++){
f[i*j]=false;}
}
}
while(scanf("%d",&n)!=EOF){
if(n==0)break;ans=0;
for(i=3;i<=n/2;i++){
if(f[i] && f[n-i])ans++;... | main.c: In function 'main':
main.c:5:9: error: unknown type name 'bool'
5 | bool f[1000005];f[0]=f[1]=false;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
... |
s911359896 | p00185 | C | #include<stdio.h>
#include<string.h>
int main(){
int n,i,j,ans;
bool f[1000005];f[0]=f[1]=false;
memset(f,true,sizeof(f));
for(i=3;i<1000005;i++){
if(f[i]){
for(j=2;i*j<1000005;j++){
f[i*j]=false;}
}
}
while(scanf("%d",&n)!=EOF){
if(n==0)break;ans=0;
for(i=3;i<=n/2;i++){
if(f[i] && f[n-i])ans++;... | main.c: In function 'main':
main.c:5:9: error: unknown type name 'bool'
5 | bool f[1000005];f[0]=f[1]=false;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
... |
s835930396 | p00185 | C | #include<stdio.h>
#include<string.h>
int main(){
int n,i,j,ans;
bool f[500005];
memset(f,true,sizeof(f));
f[0]=f[1]=false;
for(i=3;i<500005;i++){
if(f[i]){
for(j=2;i*j<500005;j++){
f[i*j]=false;}
}
}
while(scanf("%d",&n)!=EOF){
if(n==0)break;ans=0;
for(i=3;i<=n/2;i++){
if(f[i] && f[n-i])ans++;
... | main.c: In function 'main':
main.c:5:9: error: unknown type name 'bool'
5 | bool f[500005];
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
3 | int main(){
... |
s751921500 | p00185 | C++ | #include <cstdio>
#define MAX 1000000
bool prime[MAX];
void make()
{
fill(prime, prime + MAX, true);
prime[0] = prime[1] = false;
for (int i = 2; i*i < MAX; i++) {
if (prime[i]) {
for (int j = 2*i; j < MAX; j += i) {
prime[j] = false;
}
}
}
}
int main()
{
make();
int n;
... | a.cc: In function 'void make()':
a.cc:9:5: error: 'fill' was not declared in this scope
9 | fill(prime, prime + MAX, true);
| ^~~~
|
s614619435 | p00185 | C++ | #include<iostream>
using namespace std;
#include<cmath>
bool isprime(int n) {
if (n == 2)return true;
if (n % 2 == 0)return false;
for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false;
return true;
}
int main() {
int n; while (cin >> n, n) {
int cnt = 0;
for (int i = 2; i <= n / 2; i++) {
if (isp... | a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:10:12: note: to match this '{'
10 | int main() {
| ^
|
s439531875 | p00185 | C++ | #include<iostream>
using namespace std;
#include<cmath>
bool isprime(int n) {
if (n == 2)return true;
if (n % 2 == 0)return false;
for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false;
return true;
}
int main() {
int n; while (cin >> n, n) {
int cnt = 0;
for (int i = 2; i <= n / 2; i++) {
if (isp... | a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:10:12: note: to match this '{'
10 | int main() {
| ^
|
s830629795 | p00185 | C++ | j,p[1<<20],n;
main(i)
{
for(;++i<999;)
if(!p[i])
for(j=i+i;j<1<<20;j+=i)
p[j]=1;
for(;scanf("%d",&n),j=0,n;printf("%d\n",j))
for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++;
exit(0);
} | a.cc:1:1: error: 'j' does not name a type
1 | j,p[1<<20],n;
| ^
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(i)
| ^
|
s673083446 | p00185 | C++ | j,p[1<<20],n;
main(i)
{
for(;++i<999;)
if(!p[i])
for(j=i+i;j<1<<20;j+=i)
p[j]=1;
for(;scanf("%d",&n),j=0,n;printf("%d\n",j))
for(i=2;i<=n/2;i++)if(!p[i]&!p[n-i])j++;
exit(0);
} | a.cc:1:1: error: 'j' does not name a type
1 | j,p[1<<20],n;
| ^
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(i)
| ^
|
s797562329 | p00185 | C++ | j,p[1<<20],n;main(i){for(;++i<999;)for(j=i;!p[i]&(j+=i)<1<<20;)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=1;++i<=n/2;)j+=!p[i]&!p[n-i];exit(0);} | a.cc:1:1: error: 'j' does not name a type
1 | j,p[1<<20],n;main(i){for(;++i<999;)for(j=i;!p[i]&(j+=i)<1<<20;)p[j]=1;for(;scanf("%d",&n),j=0,n;printf("%d\n",j))for(i=1;++i<=n/2;)j+=!p[i]&!p[n-i];exit(0);}
| ^
a.cc:1:18: error: expected constructor, destructor, or type conversion before '(' token
1 | j,p[1<... |
s655550624 | p00185 | C++ | #include<stdio.h>
#define MAX 100000
#define sqrtMAX 317
int main(void)
{
int n;
int *b;
b = malloc((MAX+1)*sizeof(int));
int *p;
p = malloc((MAX+1)*sizeof(int));
int *c;
c = malloc((MAX+1)*sizeof(int));
/*
int b[MAX+1] = {0};
int p[MAX+1] = {0};
int c[MAX+1] = {0};
*/
int i, j;
int count;
... | a.cc: In function 'int main()':
a.cc:10:7: error: 'malloc' was not declared in this scope
10 | b = malloc((MAX+1)*sizeof(int));
| ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
1 | #include<stdio.h>
+++ |+#include <cstdlib... |
s598729858 | p00185 | C++ | #include <iostream>
using namespace std;
bool IsPrime[1000001];
void calc()
{
memset(IsPrime, 1, sizeof(IsPrime));
IsPrime[0] = false;
IsPrime[1] = false;
for(int i = 2; i < 1000001; ++i)
{
if(IsPrime[i])
{
for(int j = 2 * i; j < 1000001; j += i)
{
IsPrime[j] = false;
}
}
}
}
void solve()
{
... | a.cc: In function 'void calc()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(IsPrime, 1, sizeof(IsPrime));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#in... |
s840524589 | p00185 | C++ | 134
4330
34808
98792
0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 134
| ^~~
|
s471766294 | p00185 | C++ | #include<iostream>
#define N 1000001
using namespace std;
int main(){
int n;
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;
}
}
while(cin>>n){
int count = 0;
if(n==0) break;
int j = n - 2;
i... | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before ';' token
7 | for(int i=3;i<=N;i+=2;) p[i] = 1;
| ~ ^
| )
a.cc:7:25: error: expected primary-expression before ')' token
7 | for(int i=3;i<=N;i+=2;) p[i] = 1;
| ... |
s209256829 | p00185 | C++ | #include <cstdio>
#define MAX 1000000
bool prime[MAX];
void make(){
fill(prime,prime+MAX,true);
prime[0] = prime[1] = false;
for(int i = 2 ; i*i < MAX ; i++){
if(prime[i]){
for(int j = 2*i ; j < MAX ; j += i){
prime[j] = false;
}
}
}
}
int main(){
make();
int n;
while(scanf("%d" ... | a.cc: In function 'void make()':
a.cc:8:3: error: 'fill' was not declared in this scope
8 | fill(prime,prime+MAX,true);
| ^~~~
|
s897680358 | p00185 | C++ | #include <cstdio>
#define MAX 1000000
bool prime[MAX];
void make(){
fill(prime,prime+MAX,true);
prime[0] = prime[1] = false;
for(int i = 2 ; i*i < MAX ; i++){
if(prime[i]){
for(int j = 2*i ; j < MAX ; j += i){
prime[j] = false;
}
}
}
}
int main(){
make();
int n;
while(scanf("%d" ... | a.cc: In function 'void make()':
a.cc:8:3: error: 'fill' was not declared in this scope
8 | fill(prime,prime+MAX,true);
| ^~~~
|
s817234006 | p00186 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
int main(){
????ll q1,b,c1,c2,q2;
????cin >> q1;
????while(q1!=0){
????????cin >> b >> c1 >> c2 >> q2;
????????ll x1=0,x2=0,m=min(c1,c2);
????????bool f=false;
????????//cout << b-min(c1,c2)*q1 << endl;
??????????
????????if(c1<=c2){
????????????if(b<c1*q2+c... | a.cc:11:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
11 | ????????//cout << b-min(c1,c2)*q1 << endl;
a.cc:27:15: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
27 | ????????????????//cout << b-sum<<":"<<s*x1<<endl;
a.cc:28:15: warning: trigraph ??/ ignored, use -... |
s547631164 | p00186 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
int main(){
????ll q1,b,c1,c2,q2;
????cin >> q1;
????while(q1!=0){
????????cin >> b >> c1 >> c2 >> q2;
????????ll x1=0,x2=0,m=min(c1,c2);
????????bool f=false;
????????//cout << b-min(c1,c2)*q1 << endl;
??????????
????????if(c1<=c2){
????????????if(b<c1*q2+c... | a.cc:11:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
11 | ????????//cout << b-min(c1,c2)*q1 << endl;
a.cc:27:15: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
27 | ????????????????//cout << b-sum<<":"<<s*x1<<endl;
a.cc:28:15: warning: trigraph ??/ ignored, use -... |
s261145957 | p00186 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while(cin>>n,n){
int have,price[2],up;
cin>>have>>price[0]>>price[1]>>up;
bool kawa=0;
for(int i=up;i>0;i--){
if(have<price[0]*i)continue;
for(int j=n-i;;j++){
if(have-price[0... | a.cc: In function 'int main()':
a.cc:25:30: error: expected ';' before '}' token
25 | if(!kawa)cout<<"NA\n"
| ^
| ;
26 | }
| ~
|
s792991831 | p00186 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<unordered_map>
#include<map>
#define int long long
using namespace std;
int main() {
int a, b, c, d, e;
while (cin >> a, a) {
cin >> b... | cc1plus: error: '::main' must return 'int'
|
s933732864 | p00186 | C++ | #include<iostream>
using namespace std;
int q1,q2,b,c1,c2,ans1,ans2;
bool solve(){
if(!q2)
return false;
ans1 = q2;
ans2 = 0;
while(ans1*c1 + ans2*c2 <= b)
ans2++;
if(ans2)
ans2--;
if(ans1 + ans2 >= q1 && ans1*c1 + ans2*c2 <= b)
return true;
while(true){
ans1--;
// if(!ans1)
// return false;
whi... | a.cc: In function 'bool solve()':
a.cc:28:65: error: expected primary-expression before '||' token
28 | if(ans1*c1 + ans2*c2 <= b && ans1 + ans2 >= q1) || ans1 == 0)
| ^~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.