submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s682795575
p00638
C++
#include <iostream> #include <cmath> #include <string> #include <vector> #define P pair<int,int> #define rep(i,n) for(int i = 0;i<n;i++) #define pb(n) push_back(n) using namespace std; int n; int main() { while(true){ cin >> n; if(n == 0) break; vector<P> V; rep(i,n){ int d,w; cin >> w >> d; V.push_ba...
a.cc: In function 'int main()': a.cc:20:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 20 | sort(V.begin(),V.end()); | ^~~~ | sqrt
s469982546
p00638
C++
#include <iostream> #include <cmath> #include <string> #include <vector> #define P pair<int,int>ツ  #define rep(i,n) for(int i = 0;i<n;i++) #define pb(n) push_back(n)ツ  using namespace std; int main() { while(true){ cin >> n; if(n == 0) break; vector<P> V; rep(i,n){ int d,w; cin >> w >> d; V.push_back(...
a.cc:5:24: error: extended character   is not valid in an identifier 5 | #define P pair<int,int>ツ  | ^ a.cc:7:27: error: extended character   is not valid in an identifier 7 | #define pb(n) push_back(n)ツ  | ^ a.cc: In function 'int main()': a.cc:11:24...
s093047192
p00638
C++
#include <iostream> #include <cmath> #include <string> #include <vector> #define P pair<int,int> #define rep(i,n) for(int i = 0;i<n;i++) #define pb(n) push_back(n) using namespace std; int main() { while(true){ cin >> n; if(n == 0) break; vector<P> V; rep(i,n){ int d,w; cin >> w >> d; V.push_back(P(d,...
a.cc: In function 'int main()': a.cc:11:24: error: 'n' was not declared in this scope; did you mean 'yn'? 11 | cin >> n; | ^ | yn a.cc:19:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 19 | sort(V.beg...
s198335159
p00638
C++
#include <iostream> #include <algorithm> using namespace std; #define MAX 25 class Task { public: int d, lim; Task(int d = 0, int lim = 0) : d(d), lim(lim) {} bool operator < ( const Task &t ) const { if( lim == t.lim ) return d < t.d; return lim < t.lim; } }; int main() { int n; Task T[MAX]; b...
a.cc: In function 'int main()': a.cc:25:32: error: expected ';' before '}' token 25 | cin >> T[i].d >> T[i].lim | ^ | ; 26 | } | ~
s724853075
p00638
C++
#include <iostream> #include <algorithm> using namespace std; #define MAX 25 int jewelry[MAX], lim[MAX]; int n; ` void bubbleSort() { for(int i = 0; i < n; i++) { for(int j = n-1; j>i; j--) { if(lim[j-1] > lim[j]) { swap(lim[j-1], lim[j]); swap(jewelry[j-1], jewelry[j]); } } } } int main(...
a.cc:9:1: error: stray '`' in program 9 | ` | ^
s744673727
p00639
C
#include<stdio.h> #include<math.h> int main(void){ double px,py,vx,vy,D; while(1){ scanf("%lf",&D); if(D==0)break; scanf("%lf%lf%lf%lf",&px,&py,&vx,&vy); if(py/px==vy/vx && sqrt(px*px+py*py<D)printf("%.8f\n",sqrt(px*px+py*py)); else printf("impossible\n"); } return 0; }
main.c: In function 'main': main.c:12:43: error: expected ')' before 'printf' 12 | if(py/px==vy/vx && sqrt(px*px+py*py<D)printf("%.8f\n",sqrt(px*px+py*py)); | ~ ^~~~~~ | ) main.c:14:3: error: expected expression before ...
s705711060
p00639
C
#include <iostream> #include <cmath> using namespace std; const string impossible = "impossible"; double get_dot( double x1, double y1, double x2, double y2 ) { return x1 * x2 + y1 * y2; } double get_abs( double x, double y ) { return sqrt( x * x + y * y ); } bool check( double a, double b ) { return a ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s277304347
p00639
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(a) (a).begin(),(a).end() using namespace std; typedef long double D; typedef complex<double> P; const D eps = 1e-8; D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); } D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b....
a.cc: In function 'int on_segment(P, P, P)': a.cc:14:25: error: 'EPS' was not declared in this scope 14 | if( abs(cross(b,c)) > EPS) return 0; | ^~~ a.cc:15:18: error: 'EPS' was not declared in this scope 15 | if( dot(b,c) < EPS ) return -1 | ^~~ a.cc:15:33...
s248611824
p00639
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(a) (a).begin(),(a).end() using namespace std; typedef long double D; typedef complex<D> P; const D EPS = 1e-8; D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); } D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(...
a.cc: In function 'int main()': a.cc:33:17: error: expected primary-expression before ')' token 33 | if(ans > D)cout << "impossible" << endl; | ^
s938836441
p00639
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(a) (a).begin(),(a).end() using namespace std; typedef long double D; typedef complex<D> P; const D EPS = 1e-8; D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); } D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(...
a.cc: In function 'int main()': a.cc:33:17: error: expected primary-expression before ')' token 33 | if(ans > D)cout << "impossible" << endl; | ^
s396174766
p00639
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(a) (a).begin(),(a).end() using namespace std; typedef long double D; typedef complex<D> P; const D EPS = 1e-8; D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); } D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(...
a.cc: In function 'int main()': a.cc:33:17: error: expected primary-expression before ')' token 33 | if(ans > D)cout << "impossible" << endl; | ^
s974137730
p00639
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(a) (a).begin(),(a).end() using namespace std; typedef long double D; typedef complex<D> P; const D EPS = 1e-8; /* D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); } D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.re...
a.cc: In function 'int main()': a.cc:35:17: error: expected primary-expression before ')' token 35 | if(ans > D)cout << "impossible" << endl; | ^
s877805629
p00639
C++
#include<iostream> #include<stdio> #include<complex> #include<cmath> using namespace std;typedef double elem;typedef complex<elem> point,vec; const elem eps=1.0e-4; #define ERR 0x00 #define FRONT 0x01 #define RIGHT 0x02 #define BACK 0x04 #define LEFT 0x08 #define OVER 0x10 point origin(0,0);bool eq(elem a, elem b){ ret...
a.cc:2:9: fatal error: stdio: No such file or directory 2 | #include<stdio> | ^~~~~~~ compilation terminated.
s725609676
p00639
C++
include<iostream> #include<cstdio> #include<complex> #include<cmath> using namespace std;typedef double elem;typedef complex<elem> point,vec; const elem eps=1.0e-8; #define ERR 0x00 #define FRONT 0x01 #define RIGHT 0x02 #define BACK 0x04 #define LEFT 0x08 #define OVER 0x10 point origin(0,0);bool eq(elem a, elem b){ ret...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/complex:43, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity ...
s881082423
p00639
C++
#define EPS (1e-6) using namespace std; int main(){ double d; while(1){ double px,py,vx,vy; cin >> d; if(!(d)) break; cin >> px >> py >> vx >> vy; if(fabs(py * vx - px * vy) < EPS){ if(vx * px < 0 || vy * py < 0){ double x = sqrt(px*px + py*py); if( x < d + EPS) cout << x << endl; else...
a.cc: In function 'int main()': a.cc:10:17: error: 'cin' was not declared in this scope 10 | cin >> d; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #define EPS (1e...
s234639767
p00639
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ double d,x,y,vy,vx; while(cin>>d,d){ cin>>x>>y>>vx>>vy; if(x*x+y*y>=1){ if(x*vy-y*vx==0&&x*x+y*y<=d*d&&(x*vx<=0&&y*vy<=0)) printf("%.8lf\n",sqrt(x*x+y*y)); else cout<<"impossible"<<endl; }else{ if(x*vy-y*vx==0&&x*x+y*y<=d*d&&(x*vx<...
a.cc: In function 'int main()': a.cc:10:42: error: 'sqrt' was not declared in this scope 10 | printf("%.8lf\n",sqrt(x*x+y*y)); | ^~~~ a.cc:14:42: error: 'sqrt' was not declared in this scope 14 | printf("%.8lf\n",sqrt(x...
s316309501
p00639
C++
#include <iostream> #include <complex> #define EPS 0.00001 using namespace std; int main() { double d, px, py, vx, vy; complex<double> p,v; while(cin >> d, d >= EPS ) { cin >> px >> py >> vx >> vy; p = complex<double>(px, py); v = complex<double>(vx, vy); double cos = ( p.real()*v.real() + p.imag...
a.cc: In function 'int main()': a.cc:27:67: error: expected primary-expression before '<' token 27 | if( -1.0 -EPS < cos && cos < -1.0 +EPS && abs(p) =< d ) | ^ a.cc:29:76: error: expected primary-expression before '<' token ...
s364573253
p00639
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <vector> using namespace std; const double eps = 1e-8; const double pi = acos(-1.0); const double inf = 1e200; inline int sgn(double x) { return x < -eps ? -1 : x > eps; } inline double sqr(double x) { return...
a.cc: In function 'double operator^(const P&, const P&)': a.cc:48:5: warning: no return statement in function returning non-void [-Wreturn-type] 48 | } | ^ a.cc: In function 'double operator*(const P&, const P&)': a.cc:50:5: warning: no return statement in function returning non-void [-Wreturn-type] ...
s401030252
p00640
Java
import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); scan.next(); scan.next(); String ...
Main.java:41: error: invalid method declaration; return type required public D(String link) { ^ 1 error
s154901954
p00640
C
#include <iostream> #include <string> #include <map> #include <sstream> #include <algorithm> #include <vector> using namespace std; class B{ public: int x1, y1, x2, y2; string to; B(){} B(int x1, int y1, int x2, int y2, string to) : x1(x1), y1(y1), x2(x2), y2(y2), to(to) {} }; int n, h, w, b[100], m; vector<...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s450498208
p00640
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int b[100], x1[100][100], Y1[100][100], x2[100][100], y2[100][100]; string link[100][100]; map<string, int>mp; int main() { int n; while (scanf("%d", &n), n) { mp.clear(); int w, h; scanf("%d%d", &w, &h); vector<string>v; rep...
a.cc:6:21: error: 'std::string link [100][100]' redeclared as different kind of entity 6 | string link[100][100]; | ^ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/14/csignal:4...
s112462796
p00640
C++
#include <iostream> #include <string> #include <deque> #include <map> using namespace std; typedef struct{int sx, sy, ex, ey; string to;} LINK; //ボタンの左上・右下座標、リンク先のページ名 typedef struct{string name; int n; LINK btn[100];} PAGE; //ページ名、ページ上にあるボタンの数・その一覧 int main() { int n, o, W, H; //ページの数、命令の数、ページの幅・高さ int i, j, x, y, c...
a.cc: In function 'int main()': a.cc:55:50: error: no matching function for call to 'std::deque<std::__cxx11::basic_string<char> >::erase(std::__cxx11::basic_string<char>&)' 55 | his.erase(*itr); | ~~~~~~~~~^~~~~~ In file included ...
s432006351
p00640
C++
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <set> using namespace std; #define f first #define s second typedef pair<int, int> P; typedef pair<P, P> P2; typedef pair<P2, string> P3; int main(){ int n; int W, H; while(cin >> n, n){ ...
a.cc:95:5: error: redefinition of 'int main()' 95 | int main(){ | ^~~~ a.cc:18:5: note: 'int main()' previously defined here 18 | int main(){ | ^~~~
s428949015
p00640
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; struct pp{ int t; int x1[105],y1[105],x2[105],y2[105]; string s[105]; string now; }p[105]; int main() { int n; int h,w; string o; while(cin>>n) { if(n==0) break; cin>>h>>w; for(int i=0;i<n;i++) { cin>>p[i].now>>p[i].t; ...
a.cc: In function 'int main()': a.cc:56:44: error: 'f' was not declared in this scope 56 | if(f) break; | ^
s019287874
p00640
C++
#include <cstdio> #include <cstdlib> #include <string> #include <list> #include <map> using namespace std; struct C { string s; int x1; int y1; int x2; int y2; C ( int x1, int y1, int x2, int y2, const char *s ) { this->x1 = x1; this->y1 = y1; this->x2 = x2; this->y2 = y2; this->s = s...
a.cc: In function 'int main(int, char**)': a.cc:73:12: error: 'strcmp' was not declared in this scope 73 | if ( strcmp ( "show", cmd ) == 0 ) | ^~~~~~ a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <map> +++...
s520847757
p00641
C++
#include<bits/stdc++.h> using namespace std; class UnionFind{ int n; vector<int> p; public: UnionFind(int a){ n = a; p.resize(n, -1); } int find(int a){ if(p[a] < 0)return a; return p[a] = find(p[a]); } int unite(int a, int b){ a = find(a); b = find(b); p[a] = b; } }; int main(){ int n...
a.cc: In member function 'int UnionFind::unite(int, int)': a.cc:16:3: warning: no return statement in function returning non-void [-Wreturn-type] 16 | } | ^ a.cc: In function 'int main()': a.cc:32:19: error: no matching function for call to 'find(int&)' 32 | int v = find(i); | ...
s191988252
p00641
C++
#include<bits/stdc++.h> using namespace std; class UnionFind{ int n; vector<int> p, s; public: UnionFind(int a){ n = a; p.resize(n, -1); s.resize(n,1); } int find(int a){ if(p[a] < 0)return a; return p[a] = find(p[a]); } int unite(int a, int b){ a = find(a); b = find(b); if(s[a] < a[b]){ ...
a.cc: In member function 'int UnionFind::unite(int, int)': a.cc:15:16: error: invalid types 'int[int]' for array subscript 15 | if(s[a] < a[b]){ | ^ a.cc:20:3: warning: no return statement in function returning non-void [-Wreturn-type] 20 | } | ^
s989733317
p00641
C++
// AOJ1055 Huge Family #include <iostream> #include <vector> #include <queue> using namespace std; int main(){ int n; while(cin >> n, n){ vector< vector< pair<int, int> > > vp(n, vector< pair<int, int> >(2)); for(int i=0;i<n;i++){ for(int j=0;j<2;j++){ int a, b; cin >> a >> b; vp[i][j] = make_pair(a...
a.cc: In function 'int main()': a.cc:38:34: error: 'max_element' was not declared in this scope 38 | int m = *max_element(vi.begin(), vi.end()); | ^~~~~~~~~~~
s915626360
p00641
C++
#include <iostream> #include <vector> #include <stack> #include <map> using namespace std; typedef vector <int> VI; typedef vector <VI> VVI; typedef pair <int, int> PII; #define REP(i,n) for(int i=0;i<(int)n;++i) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define ALL(c) (c).begin(), (c)...
a.cc: In function 'int main()': a.cc:85:27: error: 'cnt' was not declared in this scope; did you mean 'int'? 85 | res = ( res * cnt ) % 10007; | ^~~ | int
s256238113
p00641
C++
#include <iostream> #include <queue> #include <vector> using namespace std; int done[100000]; vector< vector<int> > g; vector< vector<int> > g_c; int bfs(int x){ queue<int> Q; vector<int> vec; Q.push(x); while(Q.size()){ int q = Q.front(); Q.pop(); if( done[q] ) continue; else done[q] = true; for(int i = 0...
a.cc: In function 'int bfs(int)': a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(vec.begin(),vec.end()); | ^~~~ | short
s479068762
p00642
C
#include<iostream> #include<vector> using namespace std; double c[100001][20]; int main() { int n; double exp[100001]; double pro[20]; pro[0]=1.0; for(int i=1;i<20;i++){ pro[i]=pro[i-1]/2.0; // cout<<pro[i]<<" "; } // cout<<endl<<endl; for(int i=0;i<100001;i++){ for(int j=0;j<20;j++) c[i][j]=0.0; ex...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s027279364
p00642
C
#include<iostream> #include<vector> using namespace std; const int MAX=10; int main() { double e[100001]; for(int i=0;i<=100000;i++) e[i]=0.0; e[0]=0.0; e[1]=1.0; e[2]=1.5; double pro[MAX+1],imp[MAX+1]; pro[0]=1.0; for(int i=1;i<=MAX;i++){ double p=1.0/(1<<(i-1)); pro[i]=pro[i-1]*p; imp[i]=pro[i-1]*(1...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s972620946
p00642
C++
#include<cstdio> using namespace std; double dp[100000+1]; main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for(int j=i+1; j<=n; j++){ double nrate = rate * prate; if(nrate < 0...
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:10: error: 'cin' was not declared in this scope 8 | while( cin >> n ) { | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this ...
s340633199
p00642
C++
#include<cstdio> double dp[100000+1]; main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for(int j=i+1; j<=n; j++){ double nrate = rate * prate; if(nrate < 0.0000000001)break; dp...
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:10: error: 'cin' was not declared in this scope 6 | while( cin >> n ) { | ^~~ a.cc:9:5: error: 'fill' was not declared in this scope 9 | ...
s015138389
p00642
C++
#include<vector> #include<map> #include<queue> #include<stack> #include<cstdio> using namespace std; double dp[100000+1]; main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for(int...
a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:10: error: 'cin' was not declared in this scope 12 | while( cin >> n ) { | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this...
s200442183
p00642
C++
#include<vector> #include<map> #include<queue> #include<stack> #include<cstdio> using namespace std; double dp[100000+1]; main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for(int...
a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:10: error: 'cin' was not declared in this scope 12 | while( cin >> n ) { | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this...
s030268606
p00642
C++
#include<vector> #include<map> #include<queue> #include<stack> #include<cstdio> using namespace std; double dp[100000+1]; int main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for...
a.cc: In function 'int main()': a.cc:12:10: error: 'cin' was not declared in this scope 12 | while( cin >> n ) { | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include<cstdio> +++ |+#include <iostream> 6 |
s245315353
p00642
C++
#define MAX 11 //無視しない連続数 #define MAX_N 100002 double dp[MAX_N][MAX]; double per[MAX]; double ans[MAX_N]; int main(void){ int n; double sum = 0; REP(i,1,MAX) per[i] = pow(0.5,i-1); dp[1][1] = 1.0; REP(i,1,MAX_N){ REP(j,1,MAX){ if(dp[i][j] > 0){ sum += dp[i][j] * per[j]; if(j == 1...
a.cc: In function 'int main()': a.cc:12:7: error: 'i' was not declared in this scope 12 | REP(i,1,MAX) per[i] = pow(0.5,i-1); | ^ a.cc:12:3: error: 'REP' was not declared in this scope 12 | REP(i,1,MAX) per[i] = pow(0.5,i-1); | ^~~ a.cc:32:9: error: 'cin' was not declared in this scope ...
s445420212
p00642
C++
#include<stdio.h> int main (){ int n; scanf("%d",&n);if(n==0)break; for(int iii=0;iii<n;iii++) { int x;double a=0;int g=0.5; scanf("%d",&x); a+=1; for(int i=1;i<x;i++) { for(int j=i;j<x;j++) a+=g; g=g*0.5; } printf("%d",&a); } return 0; }
a.cc: In function 'int main()': a.cc:7:24: error: break statement not within loop or switch 7 | scanf("%d",&n);if(n==0)break; | ^~~~~
s821025807
p00642
C++
#include<iostream> #include<cmath> using namespace std; #define MAX_N 1000 #define MAX_M 1000 #define MAX_P 1000 double dp[MAX_N][MAX_M][MAX_P]; double ventoh[MAX_N]; int n; int main() { for (int i = 0; i < MAX_N; i++) { for (int j = 0; j < MAX_M; j++) { for (int k = 0; k < MAX_P; k++) { dp[i][j][k] = 0.0...
/tmp/cc5nCCvN.o: in function `main': a.cc:(.text+0x361): relocation truncated to fit: R_X86_64_PC32 against symbol `ventoh' defined in .bss section in /tmp/cc5nCCvN.o a.cc:(.text+0x3c4): relocation truncated to fit: R_X86_64_PC32 against symbol `ventoh' defined in .bss section in /tmp/cc5nCCvN.o a.cc:(.text+0x403): rel...
s224168958
p00642
C++
#include <iostream> using namespace std; double fanc(int a,double p) { if (a == 0)return; fanc(a - 1, p / 2); fanc(a - 2, 100); } int main() { cin.tie(false); ios::sync_with_stdio(0); int n; while (cin >> n&&n != 0) { cout << fanc(n, 100) << "\n"; } }
a.cc: In function 'double fanc(int, double)': a.cc:6:20: error: return-statement with no value, in function returning 'double' [-fpermissive] 6 | if (a == 0)return; | ^~~~~~ a.cc: In function 'int main()': a.cc:14:16: error: no matching function for call to 'std::basic_istream<char>...
s316497332
p00642
C++
// AOJ1056 Ben Toh #include <iostream> using namespace std; int main(){ int n; double dp[100001]; dp[0] = 0.0; dp[1] = 1.0; dp[2] = 1.5; for(int i=3;i<=100000;i++){ dp[i] = 0.0; double cur = 1.0, mul = 0.5; for(int j=2;j<=min(i,20);j++){ dp[i] += cur*(1-mul)*(j-1+dp[i-j]); cur *= mul; mul *= 0.5; ...
a.cc: In function 'int main()': a.cc:25:35: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | printf("%.2lf\n", ans[n]); | ^~~ | abs
s820005688
p00642
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int MAX_N=100001; int main(){ // iツ嘉アツ姪堋づ泳ツ古つ連ツ堕アツつオツづ偲ヲツづェツづゥツ確ツ猟ヲツづーツ格ツ納 vector<vector<double> > dp; vector<double> v(51,0.0); for(int i = 0; i < MAX_N; i++){ dp.push_back(v); } //double dp[MAX_N][51]; //for(int i = 0;...
a.cc: In function 'int main()': a.cc:28:65: error: 'pow' was not declared in this scope 28 | dp[i][j]+=dp[i-1][k]*(1-pow(0.5,k)); | ^~~ a.cc:33:56: error: 'pow' was not declared in this scope 33 | ...
s021219691
p00642
C++
#include <iostream> #include <math.h> #define TABLE 100 double psb( int n ) { return pow(0.5,n-1); } int main() { int n; double sum; double dp[TABLE][TABLE]; while(std::cin >> n, n) { sum = 0; for( int i = 0; i <= n+3; i++) memset( dp, 0, sizeof(dp)); for( int j = 1; j <= n; j++) dp[1][j] = 1.0f...
a.cc: In function 'int main()': a.cc:22:25: error: 'memset' was not declared in this scope 22 | 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 | #includ...
s372384202
p00642
C++
import java.util.Arrays; import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); static int N; static double[] exp = new double[100001]; public static void main(String[] args) { precalc(); while (true) { N = sc.nextInt(); if (N == 0) break; System.out.println(solve(...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ 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.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-t...
s984531523
p00642
C++
#include <cstdio> #include <algorithm> using namespace std; #define EPS (1e-13) double dp[100001]; int main() { dp[1]=1; for(int n=2;n<=100000;n++) { double p=1,win=0.5; int k=1; while(EPS<p&&k<n) { double not=p*(1-win); dp[n]+=not*(k+dp[max(n-k-1,0)]); p*=win; win/=2; k++; } dp[n]+=n*p; } int n;...
a.cc: In function 'int main()': a.cc:12:32: error: expected unqualified-id before 'not' token 12 | double not=p*(1-win); | ^~~ a.cc:13:35: error: invalid type argument of unary '*' (have 'double') 13 | dp[n]+=not*(k+dp[max(n-k-1,...
s819355138
p00642
C++
#include <cstdio> #include <cstring> #define EPS (1e-13) #define MAX(A,B)((A)>=(B)?(A):(B)) double dp[1000001]; int main() { int n; while(scanf("%d",&n),n) { for(int i=0;i<=1000000;i++) dp[i]=0; dp[1]=1; for(int i=2;i<=n;i++) { double p=1.0,win=0.5; for(int j=1;j<i && EPS<p;j++) { double not=p*(1-win)...
a.cc: In function 'int main()': a.cc:14:40: error: expected unqualified-id before 'not' token 14 | double not=p*(1-win); | ^~~ a.cc:15:43: error: invalid type argument of unary '*' (have 'double') 15 | dp[...
s726757423
p00642
C++
#include <cstdio> using namespace std; &#160; const int MAX_N = 100001; const int MAX_K = 13; &#160; // 連続で x 回半額弁当をゲットしたときに半額弁当を得る確率 double P(int x){ &#160;&#160;&#160;&#160;return 1.0 / (1 << x); } &#160; // dp[i][k] := i 日目で k 回連続ゲットしたときの期待値 double dp[MAX_N+1][MAX_K+1] = {0}; // ans[i] := i 日目の半額弁当を得る個数の期待値 double a...
a.cc:3:2: error: stray '#' in program 3 | &#160; | ^ a.cc:6:2: error: stray '#' in program 6 | &#160; | ^ a.cc:9:2: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 << x); | ^ a.cc:9:8: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 <<...
s379247201
p00642
C++
#include <cstdio> using namespace std; &#160; const int MAX_N = 100001; const int MAX_K = 13; &#160; // 連続で x 回半額弁当をゲットしたときに半額弁当を得る確率 double P(int x){ &#160;&#160;&#160;&#160;return 1.0 / (1 << x); } &#160; // dp[i][k] := i 日目で k 回連続ゲットしたときの期待値 double dp[MAX_N+1][MAX_K+1] = {0}; // ans[i] := i 日目の半額弁当を得る個数の期待値 double a...
a.cc:3:2: error: stray '#' in program 3 | &#160; | ^ a.cc:6:2: error: stray '#' in program 6 | &#160; | ^ a.cc:9:2: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 << x); | ^ a.cc:9:8: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 <<...
s096762135
p00642
C++
#include <cstdio> using namespace std; &#160; const int MAX_N = 100001; const int MAX_K = 8; &#160; // 連続で x 回半額弁当をゲットしたときに半額弁当を得る確率 double P(int x){ &#160;&#160;&#160;&#160;return 1.0 / (1 << x); } &#160; // dp[i][k] := i 日目で k 回連続ゲットしたときの期待値 double dp[MAX_N+1][MAX_K+1] = {0}; // ans[i] := i 日目の半額弁当を得る個数の期待値 double an...
a.cc:3:2: error: stray '#' in program 3 | &#160; | ^ a.cc:6:2: error: stray '#' in program 6 | &#160; | ^ a.cc:9:2: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 << x); | ^ a.cc:9:8: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;return 1.0 / (1 <<...
s962039812
p00642
C++
#include<vector> #include<map> #include<queue> #include<stack> #include<cstdio> using namespace std; double dp[100000+1]; main(){ int n; while( cin >> n ) { if(n == 0)break; double ans = 0; fill(dp, dp +n+1, 0); for(int i=0; i<=n; i++){ double rate = 1, prate=1, base=1 - dp[i]; for(int...
a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:10: error: 'cin' was not declared in this scope 12 | while( cin >> n ) { | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this...
s829802460
p00643
C
#include<queue> #include<iostream> using namespace std; int dy[]={-1,0,1,0},dx[]={0,-1,0,1}; struct Dice{ int t,b,n,s,e,w; int y,x; int c; Dice(int top,int bottom,int north,int south,int east,int west,int sx,int sy,int cost){ t=top,b=bottom,n=north,s=south,e=east,w=west; x=sx,y=sy,c=cost; } bool operator<...
main.c:1:9: fatal error: queue: No such file or directory 1 | #include<queue> | ^~~~~~~ compilation terminated.
s429937497
p00643
C++
/* * File: main.cpp * Author: Prowindy * * Created on 2011年8月24日, 下午2:27 */ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <...
a.cc: In function 'int main()': a.cc:52:9: error: 'memset' was not declared in this scope 52 | memset(dp, 100, sizeof (dp)); | ^~~~~~ a.cc:26:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 25 | #include <queue> +++ |+#include <cs...
s014921082
p00643
C++
/* * Author: lee1r * Created Time: 2011/8/24 15:42:22 * File Name: 8.24_G.cpp */ #include<iostream> #include<sstream> #include<fstream> #include<vector> #include<list> #include<deque> #include<queue> #include<stack> #include<map> #include<set> #include<bitset> #include<algorithm> #include<cstdio> #include<cstdlib...
a.cc:86:22: error: 'int y0' redeclared as different kind of entity 86 | int N,M,r[17][17],x0,y0,x1,y1; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gn...
s756666978
p00643
C++
#include <stdlib.h> #include <stdio.h> #include <iostream> #include <algorithm> #include <string.h> #include <string> #include <map> #include <set> #include <math.h> #define M 15 using namespace std; struct node { int x, y, bottom, east; __int64 value; } Q[M*M*M*M*M*M], s, p; int mark[M][M][M][M]; __int64 dis[...
a.cc:15:5: error: '__int64' does not name a type; did you mean '__int64_t'? 15 | __int64 value; | ^~~~~~~ | __int64_t a.cc:18:1: error: '__int64' does not name a type; did you mean '__int64_t'? 18 | __int64 dis[M][M][M][M]; | ^~~~~~~ | __int64_t a.cc:22:1: error: '__int64' does...
s700366393
p00643
C++
#include <iostream> #include <vector> #include <queue> #include <cstdio> using namespace std; const int INF = 1 << 30; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; class Dice { private: /* pip[0] = top, pip[1] = south, pip[2] = east pip[3] = bottom, pip[4] = north, pip[5] = west */ in...
a.cc:73:37: error: default argument missing for parameter 3 of 'State::State(int, int, int)' 73 | State(int _x = 0, int _y = 0, int _cost) | ~~~~^~~~~ a.cc:73:13: note: ...following parameter 1 which has a default argument 73 | State(int _x = 0, int _y = 0, int _cost) ...
s907133816
p00643
C++
#include<queue> #include<iostream> using namespace std; int dy[]={-1,0,1,0},dx[]={0,-1,0,1}; struct Dice{ int t,b,n,s,e,w; int y,x; int c; Dice(int top,int bottom,int north,int south,int east,int west,int sx,int sy,int cost){ t=top,b=bottom,n=north,s=south,e=east,w=west; x=sx,y=sy,c=cost; } bool operator<...
a.cc: In function 'int main()': a.cc:55:17: error: 'memset' was not declared in this scope 55 | memset(memo,-1,sizeof(memo)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<iostream> ...
s633836638
p00644
C++
#include <bits/stdc++.h> using namespace std; struct edge { int to, cost; }; typedef pair< int, int > Pi; const int INF = 1LL << 29; int N, M, P; int v1[100], v2[100]; int dp1[100], dp2[100]; vector< vector< edge > > g; void Dijkstra(int s, int *v, int *dp) { priority_queue< Pi, vector< Pi >, greater< Pi > > ...
a.cc: In function 'int main()': a.cc:50:52: error: no matching function for call to 'std::vector<std::vector<edge> >::vector(int&, std::vector<int>)' 50 | g = vector< vector< edge > >(N, vector< int >()); | ^ In file included from /usr/include/c++/14/vecto...
s544361579
p00644
C++
#include <bits/stdc++.h> using namespace std; struct edge { int to, cost; }; typedef pair< int, int > Pi; const int INF = 1LL << 30; int N, M, P; int v1[100], v2[100]; double dp1[100], dp2[100]; vector< vector< edge > > g; void Dijkstra(int s, int *v, int *dp) { priority_queue< Pi, vector< Pi >, greater< Pi > ...
a.cc: In function 'int main()': a.cc:57:21: error: cannot convert 'double*' to 'int*' 57 | Dijkstra(0, v1, dp1); | ^~~ | | | double* a.cc:18:35: note: initializing argument 3 of 'void Dijkstra(int, int*, int*)' 18 | void Dijkstra(...
s792501736
p00644
C++
// AOJ1058 Winter Bells #include <iostream> #include <vector> #include <string.h> using namespace std; typedef vector< vector<int> > graph; void visit(graph &g, vector<int> &order, vector<bool> &mark, int pos){ for(int i=0;i<g[pos].size();i++){ int next = g[pos][i]; if(mark[next]) continue; visit(g, order, m...
a.cc: In function 'std::vector<int> topologicalSort(graph&)': a.cc:28:9: error: 'reverse' was not declared in this scope 28 | reverse(res.begin(), res.end()); | ^~~~~~~
s132858403
p00645
Java
import java.io.*; import java.util.*; public class Myon { public static void main(String args[]) throws Exception { new Myon();} static int MAX = 9999; Myon(){ Scanner cin = new Scanner(System.in); int i,j,k,num; while(true){ int n; n = cin.nextInt(); if(n==0) br...
Main.java:3: error: class Myon is public, should be declared in a file named Myon.java public class Myon ^ 1 error
s267991866
p00645
C++
#include <iostream> #include <queue> using namespace std; #define loop(i,a,b) for(int i=(a);i<int(b);i++) #define rep(i,b) loop(i,0,b) int n; struct State { int step, g; State(int step, int g) :step(step), g(g){} void flip(int x, int y, int w, int h){ int t = (((1 << w) - 1) << x); ...
a.cc: In function 'int main()': a.cc:43:9: error: 'memset' was not declared in this scope 43 | memset(vis, 0, sizeof(vis)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +++ |+#include <cstr...
s225065622
p00645
C++
#include <bits/stdc++.h> using namespace std; typedef vector<vector<bool>> vii; // #include<unordered_map> class HashVI { // ???n???b???V?????????????????I???u???W???F???N???g public: size_t operator()(const vector<vector<bool>> &x) const { const int C = 997; // ???f?????? size_t t = 0; for (int i = 0; i !...
a.cc: In function 'int main()': a.cc:54:35: error: no matching function for call to 'std::vector<std::vector<bool> >::vector(int&, std::vector<int>)' 54 | vii field(N,vector<int>(N)); | ^ In file included from /usr/include/c++/14/vector:66, from /usr/i...
s851593877
p00645
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int dp[1<<5][1<<5][1<<5][1<<5][1<<5]; bool passed[1<<5][1<<5][1<<5][1<<5][1<<5]; int n; int field[5][5]; const int INF=1000000; int dfs(int s1,int s2,int s3,int s4,int s5){ if(!s1&&!s2&&!s3&&!s4&&!s5){ return 0; } if(dp[s1][s2][s...
a.cc: In function 'int main()': a.cc:276:17: error: 'memset' was not declared in this scope 276 | 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> +++ |...
s767594817
p00645
C++
unsigned char cost[1<<20]; int mask[5][5][6][6]; void gen(){ memset(cost,-1,sizeof(cost)); cost[0]=0; rep(i,5)rep(j,5)for(int h=1;h<=5-i;h++)for(int w=1;w<=5-j;w++){ int m=(1<<w)-1; rep(k,h)mask[i][j][h][w]^=m<<(i+k)*5+j; } queue<int> Q; Q.push(0); int cnt=0; while(!Q.empty()){ int c=Q.front(),cc=cost[c]; Q...
a.cc: In function 'void gen()': a.cc:4:9: error: 'memset' was not declared in this scope 4 | memset(cost,-1,sizeof(cost)); | ^~~~~~ a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' +++ |+#include <cstring> 1 | unsigned cha...
s664103136
p00645
C++
#include <cstring> #include <cstdio> #include <iostream> using namespace std; unsigned char cost[1<<20]; int mask[5][5][6][6]; void gen(){ memset(cost,-1,sizeof(cost)); cost[0]=0; rep(i,5)rep(j,5)for(int h=1;h<=5-i;h++)for(int w=1;w<=5-j;w++){ int m=(1<<w)-1; rep(k,h)mask[i][j][h][w]^=m<<(i+k)*5+j; } queue<i...
a.cc: In function 'void gen()': a.cc:12:13: error: 'i' was not declared in this scope 12 | rep(i,5)rep(j,5)for(int h=1;h<=5-i;h++)for(int w=1;w<=5-j;w++){ | ^ a.cc:12:9: error: 'rep' was not declared in this scope 12 | rep(i,5)rep(j,5)for(int h=1;h<=5-i;h++)for(int w=1;w<=5-j;w++...
s199163835
p00645
C++
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<iostream> #include<vector> #include<algorithm> #include<map> #define calc __builtin_popcount using namespace std; int n,G[5][5],ans; map<int,int>vis; vector<int>move[30]; int H(int sta,int k){ return (calc(sta)+k-1)/k; } int Q[50]; void show(int sta){ fo...
a.cc: In function 'void ws(int, int, int, int)': a.cc:32:26: error: reference to 'move' is ambiguous 32 | for(int i=last;i<move[k].size();i++){ | ^~~~ In file included from /usr/include/c++/14/algorithm:86, from a.cc:6: /usr/include/c++/14/pstl/glue_algorithm_d...
s648938701
p00645
C++
#include <stdio.h> #include <vector> using namespace std; #define SIZE (5) #define SET(t, x, y) (((t) |= (1 << ((y) * SIZE + (x))))) #define CHECK(t, x, y) (((t) & ((1 << ((y) * SIZE + (x))))) != 0) int ans; unsigned int hash[1 << 25]; int numofbits5(unsigned int bits) { bits = (bits & 0x55555555) + (bits >> 1 & ...
a.cc: In function 'int dfs(unsigned int, std::vector<unsigned int>&, int)': a.cc:29:29: error: reference to 'hash' is ambiguous 29 | if (ans <= depth || hash[field] <= depth){ | ^~~~ In file included from /usr/include/c++/14/bits/stl_bvector.h:65, from /usr/...
s359718096
p00645
C++
#include <iostream> #include <vector> #include <map> #include <queue> #include <algorithm> using namespace std; // dp[n-1][bits] := 最小のmyonの回数 vector<char> dp[3]; // dp_4[bits] := n が 4 のときの最小のmyonの回数 map<int,char> dp_4; // dp_5[bits] := n が 5 のときの最小のmyonの回数 map<int,char> dp_5; // (x,y) の値(0 or 1) を返す int get(int n, ...
a.cc: In function 'int main()': a.cc:264:47: error: too few arguments to function 'int dfs(int, int, int)' 264 | cout << s[ dfs(bits,n) ] << endl; | ~~~^~~~~~~~ a.cc:182:5: note: declared here 182 | int dfs(int bits, int n, int cnt){ ...
s993311949
p00645
C++
#include <iostream> #include <string> #include <algorithm> #include <memory.h> #include <cstdio> #include <cmath> using namespace std; #define MAX 999999999 int xorMemo[5][5][5][5][5]; short n, f[1<<25]; inline short min(short a, short b){ return a < b ? a : b; } inline short solve(int bit){ if (bit == 0) r...
cc1plus: error: '::main' must return 'int'
s127800990
p00645
C++
#include<iostream> #include<vector> #include<queue> #include<algorithm> using namespace std; #define REP(i,a,b) for(int i=a;i<b;i++) int n,g,bit,res; int dis[1<<20]; vector<int> mask[5][5]; int rec(int g, int t){ if(t == 5){ if( (g & 31) )return 1000000; return dis[g>>5]; } int res = rec(g,t+1); for(...
a.cc: In function 'int main()': a.cc:56:19: error: 'tmp' was not declared in this scope; did you mean 'tm'? 56 | for(int i=0;i<tmp;i++)cout << "myon"; | ^~~ | tm
s168334557
p00646
C
#include<stdio.h> #define u_llint unsigned long long int u_llint euclid(u_llint m,u_llint n); int main(void){ u_llint l,i,j,c; while(scanf("%llu",&l)&&l!=0){ c=0; for(i=1;i<=l;i++){ if(l%i!=0) continue; for(j=i;j<=l;j++){ if(l%j!=0) continue; c+=(i*j==l*euclid(i,j)) ? 1:0; ...
main.c: In function 'main': main.c:24:1: error: expected declaration or statement at end of input 24 | } | ^
s847857654
p00646
C
#include<iostream> #include<algorithm> #include<cmath> #include<set> #include<vector> using namespace std; typedef long long ll; vector<ll> getDiv(ll n){ vector<ll> res; for(ll i=1;i*i<=n;i++) if(n%i == 0) { res.push_back(i); if(i*i != n) res.push_back(n/i); } return res; } int main() { long ...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s888136895
p00646
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:84:12: error: 'i' was not declared in this scope 84 | if(i==s-1 && n!=1) es.PB(1); | ^
s680024050
p00646
C++
#include<iostream> #include<algorithm> #include<vector> #include<stack> #include<queue> #include<cstdio> #include<climits> #include<cmath> #include<cstring> #include<string> #include<sstream> #define f first #define s second #define mp make_pair #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,c) for(__ty...
a.cc: In constructor 'Prime<m>::Prime()': a.cc:33:5: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive] 33 | assert(m>1); | ^~~~~~ a.cc:33:5: note: (if you use '-fpermissive', G++ will accept your code, but allowi...
s229135039
p00646
C++
#include <iostream> #include <set> #include <algorithm> #include <map> #include <cstdlib> #include <cstdio> #include <vector> using namespace std; typedef long long ll; map<int,int> decomposition(ll L){ map<int,int> cnt; for(ll i = 2; i*i <= L; i++){ if(L%i==0){ while(1){ if(L%i==0){ cnt[i]++; /...
a.cc: In function 'void dfs(std::map<int, int>::iterator)': a.cc:50:30: error: 'pow' was not declared in this scope 50 | int mul=(int)pow(2.0,(int)s.size()); | ^~~
s505849087
p00646
C++
#include<stdio.h> #include<math.h> #include<string.h> #define N 500001 #define M 50000 //M=(N)/ln(N) bool is[N]; int p[M]; int pnum; int getprm(int n) { int i,j,k=0; int s,e=(int)(sqrt(0.0+n)+1); memset(is,1,sizeof(is)); p[k++]=2;is[0]=is[1]=0; for(i=4;i<n;i+=2) is[i]=0; for(i=3;i<e;i+=2) if(is[...
a.cc:28:6: error: variable or field 'pfact' declared void 28 | void pfact(__int64 n){ | ^~~~~ a.cc:28:12: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 28 | void pfact(__int64 n){ | ^~~~~~~ | __ynf64 a.cc: In function 'int main()': a.cc:40:5:...
s150189474
p00646
C++
printf("%d\n",ans); } }
a.cc:3:11: error: expected constructor, destructor, or type conversion before '(' token 3 | printf("%d\n",ans); | ^ a.cc:4:3: error: expected declaration before '}' token 4 | } | ^ a.cc:5:1: error: expected declaration before '}' token 5 | } | ^
s450766716
p00646
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<cmath> #include<vector> #include<map> using namespace std; vector<long long int>p; int a[1000001]; int main() { int flag;int l; p.push_back(2);p.push_back(3);p.push_back(5); p.push_back(7);p.push_back(11);p.push_back(13); p.push_back(17);p.push_back(...
a.cc: In function 'int main()': a.cc:27:9: error: 'memset' was not declared in this scope 27 | memset(a,1,sizeof(a)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include<map> +++ |+#include <cstring> ...
s234661529
p00647
C
#define zone(h) ( (11<=(h)&&(h)<15)?0:(18<=(h)&&(h)<21)?1:(21<=(h)&&(h)<26)?2:3 ) int a[3],b[3]; char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;} main(n,h,m,H,M){ for(;scanf("%d",&n),n){ a[0]=a[1]=a[2]=b[0]=b[1]=b[2]=0; for(;n;n--){ scanf("%d:%d %d",&h,&m,&M); if...
main.c: In function 'r': main.c:3:26: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] 3 | char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a decl...
s812295105
p00647
C
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main() { int n; while(scanf("%d",&n)&&n) { int hh,mm,MM,lunchsum=0,dinnersum=0,midnightsum=0,lunch=0,dinner=0,midnight=0; int i; for(i=1;i<=n;i++) { scanf("%d%*c%d%d",&hh, &mm, &MM); if(hh>=11&&hh<=14) { lunchsum...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s409056444
p00647
C
#include<stdio.h> int main() { int n,i,a,b,d,e,f,g; int lunchsum,dinnersum,midnightsum,lunchss,dinnerss,midnightss; char c; while(scanf("%d",&n)&&(n!=0)) { lunchsum=0; dinnersum=0; midnightsum=0; lunchss=0; dinnerss=0; midnightss=0; for(i=0;i<n;i++) { scanf("%d%c%d%d",&a,&c,&b,&d); if(a>=...
main.c: In function 'main': main.c:42:59: error: expected ')' at end of input 42 | else if((a>=21&&a<=23)||a<=1&&a>=0 | ~ ^ | ) main.c:42:25: error: expected declarati...
s927148628
p00647
C++
// ConsoleApplication1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include<stdio.h> #include"stdafx.h" int main(void){ int n,cnt,a,b,c,i,m; int cnt1 =0; int cnt2 =0; int L=0; int D=0; int M=0; int LP,DP,MP; i = 0; cnt = 0; scanf("%d",&n); while(i<n...
a.cc:6:9: fatal error: stdafx.h: No such file or directory 6 | #include"stdafx.h" | ^~~~~~~~~~ compilation terminated.
s348258157
p00647
C++
#include <stdio.h> #include <string.h> #define LUNCH 0 #define DINNER 1 #define MIDNIGHT 2 #define OK 0 #define NG 1 int main(void){ int n, i, j, hh, mm, MM, ans[3][2], *p; char str_MM[3]; while(1){ scanf_s("%d",&n); if(n == 0){ break; } memset(ans,0,s...
a.cc: In function 'int main()': a.cc:17:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 17 | scanf_s("%d",&n); | ^~~~~~~ | scanf
s257468950
p00647
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <functional> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <deque> using namespace std; #def...
a.cc: In function 'int main()': a.cc:62:53: error: expected ')' before '{' token 62 | else if((21*60<=a||a<=60+59){ | ~ ^ | ) a.cc:67:17: error: expected primary-expression before...
s446790774
p00647
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int n; while (cin >> n&&n != 0) { int a[3][2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) a[i][j] = 0; } int b, c, d; for (int i = 0; i < n; i++) { scanf_s("%d:%d %d", &b, &c, &d); int e = b * 60 + c, f = 0; boo...
a.cc: In function 'int main()': a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d:%d %d", &b, &c, &d); | ^~~~~~~ | scanf
s868481408
p00647
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int n; while (cin >> n&&n != 0) { int a[3][2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) a[i][j] = 0; } int b, c, d; for (int i = 0; i < n; i++) { scanf_s("%d:%d %d", &b, &c, &d); if (b < 2) b += 24; int e = b ...
a.cc: In function 'int main()': a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d:%d %d", &b, &c, &d); | ^~~~~~~ | scanf
s568293875
p00647
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int n; while (cin >> n&&n != 0) { int a[3][2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) a[i][j] = 0; } int b, c, d; for (int i = 0; i < n; i++) { scanf_s("%d:%d %d", &b, &c, &d); if (b < 2) b += 24; int e = b ...
a.cc: In function 'int main()': a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d:%d %d", &b, &c, &d); | ^~~~~~~ | scanf
s527733970
p00647
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int n; while (cin >> n&&n != 0) { int a[3][2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) a[i][j] = 0; } int b, c, d; for (int i = 0; i < n; i++) { scanf_s("%d:%d %d", &b, &c, &d); if (b < 11) b += 24; if (d < c...
a.cc: In function 'int main()': a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d:%d %d", &b, &c, &d); | ^~~~~~~ | scanf
s164737119
p00647
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; struct time{ int h , m ; time(int hh , int mm ){ h=hh;m=mm; } void operator ++ (){ m++; if( m == 60 ){ m = 0; h ++ ; if( h == 24 ) h = 0; } } int at(){ if( (h>=11&&m>=0) &&( h <=14 && m <= 59) )...
a.cc: In function 'int main()': a.cc:36:29: error: expected ';' before 'tmp' 36 | time tmp = time(a,b); | ^~~~ | ; a.cc:37:35: error: 'tmp' was not declared in this scope; did you mean 'tm'? 37 | in...
s776930022
p00647
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; struct Time{ int h , m ; time(){ } void operator ++ (){ m++; if( m == 60 ){ m = 0; h ++ ; if( h == 24 ) h = 0; } } int at(){ if( (h>=11&&m>=0) &&( h <=14 && m <= 59) )return 0; if( ( h >=18&&...
a.cc:9:9: error: ISO C++ forbids declaration of 'time' with no type [-fpermissive] 9 | time(){ | ^~~~ a.cc: In member function 'int Time::time()': a.cc:11:9: warning: no return statement in function returning non-void [-Wreturn-type] 11 | } | ^ a.cc: In function 'int m...
s069505143
p00648
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.PriorityQueue; import java.util.Queue; import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int channelCnt = sc.nextInt(...
Main.java:15: error: cannot find symbol Queue queue = new PriorityQueue(1, new WatchinTVA().new MyComparator()); ^ symbol: class WatchinTVA location: class Main Main.java:17: error: cannot find symbol Bangumi bangumi = new WatchinTVA().new Bangumi(sc.next(), sc.next()...
s463803528
p00648
Java
\import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.PriorityQueue; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int channelCnt = sc.nextIn...
Main.java:1: error: illegal character: '\' \import java.util.ArrayList; ^ Main.java:1: error: class, interface, enum, or record expected \import java.util.ArrayList; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.Arrays; ^ Main.java:3: error: class, interface, enum, or record ...
s614684828
p00648
C++
import bisect while(1): N=int(raw_input()) if N==0: break D={} for i in range(N): inp=raw_input().split() inp[1:]=map(int, inp[1:]) stt=inp[1]*24*60+inp[2]/100*60+inp[2]%100 D[inp[0]]=stt P=int(raw_input()) Tlist=[-99999999,999999999] for i in range(P): ...
a.cc:1:1: error: 'import' does not name a type 1 | import bisect | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:5: error: expected unqualified-id before 'for' 7 | for i in range(N): | ^~~
s609748935
p00648
C++
#include<iostream> #include<vector> #include<map> using namespace std; int n, p; typedef pair<int, string> TV; int main() { while(cin >> n, n) { vector<TV> tvs; for(int i = 0; i < n; i++) { string name; int week, start; cin >> name >> week >> start; tvs.push_back(TV(week * 60*24 + (start / 100 * 60) ...
a.cc: In function 'int main()': a.cc:22:17: error: 'sort' was not declared in this scope; did you mean 'short'? 22 | sort(tvs.begin(), tvs.end()); | ^~~~ | short
s139119998
p00648
C++
/* * Author: FreeIdea * Created Time: 2011/8/22 13:58:15 * File Name: B.cpp */ #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <cstdlib> #include <algorithm> #include <vector> #include <map> using namespace std; const int maxint = -1u>>1; template <class T> bool get_max(T& a, con...
a.cc:42:10: error: 'int time' redeclared as different kind of entity 42 | int day, time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157...
s587620264
p00648
C++
#include<iostream> #include<string> #include<map> #include<set> #include<vector> using namespace std; #define rep(i, n) for ( int i = 0; i < n; i++) static const int MAX = 500; static const int L = 30; bool overlap(int a, int b){ if ( a > b ) swap(a, b); return a + 30 > b; } int getProgram(vector<int> v){ sort(...
a.cc: In function 'int getProgram(std::vector<int>)': a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(v.begin(), v.end()); | ^~~~ | short a.cc: At global scope: a.cc:62:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 62 | ma...
s583355818
p00648
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <set> #include <cstdio> using namespace std; int main(){ int n,i,r,last,time,day; for(;cin>>n,n;){ vector<pair<int,string> >program; set<string>precious; string s; { map<string,int>m; for(;n--;){ cin>>s>>day>>time; p...
a.cc: In function 'int main()': a.cc:30:17: error: 'sort' was not declared in this scope; did you mean 'short'? 30 | sort(program.begin(),program.end()); | ^~~~ | short
s529628570
p00648
C++
/* * Author: 8mao * Created Time: 2014/3/16 13:31:26 * File Name: 1331.cpp */ # include<map> # include<set> # include<cmath> # include<queue> # include<stack> # include<vector> # include<string> # include<cstdio> # include<cstring> # include<iostream> # include<algorithm> # include<functional> using nam...
a.cc: In function 'int Jireh(int)': a.cc:82:9: error: expected primary-expression before '}' token 82 | } | ^
s329637946
p00650
C
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <cassert> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.