submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s507917694
p03971
C++
#include<bits/stdc++.h> using namespace std; typedef int64_t ll; typedef long double ld; const ll MOD=1000000007; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) long long gcd(long long a,long long b){ ll gcdmax=max(a,b); ll gcdmin=min(a,b); while(true){ if(gcdmax%gcdmin==0)break; else gcdmax%=gc...
a.cc: In function 'int main()': a.cc:69:2: error: expected '}' at end of input 69 | } | ^ a.cc:45:1: note: to match this '{' 45 | { | ^
s627040400
p03971
C++
#include<bits/stdc++.h> using namespace std; typedef int64_t ll; typedef long double ld; const ll MOD=1000000007; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) long long gcd(long long a,long long b){ ll gcdmax=max(a,b); ll gcdmin=min(a,b); while(true){ if(gcdmax%gcdmin==0)break; else gcdmax%=gc...
a.cc: In function 'int main()': a.cc:58:23: error: expected primary-expression before ',' token 58 | else cout<<"No"<,endl; | ^ a.cc:69:2: error: expected '}' at end of input 69 | } | ^ a.cc:45:1: note: to match this '{' 45 | { | ^
s547220590
p03971
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin>>n>>a>>b; string s; cin>>s; int cnt1, cnt2; cnt1 = cnt2 = 0; for(auto e:s){ if(e == 'a'){ puts("Yes"); cn1++; }else if(e == 'b'){ if(cnt2 < b){ puts("Yes"); cnt1++; cnt2++; }els...
a.cc: In function 'int main()': a.cc:13:7: error: 'cn1' was not declared in this scope; did you mean 'cnt1'? 13 | cn1++; | ^~~ | cnt1
s451852048
p03971
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> vi; typedef vector<ll> vll; // #define int long long #define pb push_back #define mp make_pair #define eps 1e-9 #define INF 2000000000 // 2e9 #define LLINF 2000000000000000000ll // 2e18 (ll...
a.cc: In function 'void solve()': a.cc:207:3: error: 'stirng' was not declared in this scope 207 | stirng s; | ^~~~~~ a.cc:209:10: error: 's' was not declared in this scope 209 | cin >> s; | ^
s229039863
p03971
C++
#define _USE_NATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include...
a.cc: In function 'int main()': a.cc:48:46: error: expected ')' before ';' token 48 | for(int i =0; i<s.size();i++;) { | ~ ^ | ) a.cc:48:47: error: expected primary-expression before ')' token 48 |...
s015588935
p03971
C++
#define _USE_NATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include...
a.cc: In function 'int main()': a.cc:30:14: error: 'i' was not declared in this scope 30 | #define rep (i,n) REP(i,0,n) | ^ a.cc:48:18: note: in expansion of macro 'rep' 48 | rep(i, s.size()) { | ^~~ a.cc:29:16: error: 'm' was not declared in this scope ...
s062456150
p03971
C
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | あ | ^~
s380749065
p03971
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0; i<(n); ++i) #define REP(i, d, n) for(int i=(d); i<(n); ++i) #define all(v) v.begin(), v.end() using ll = long long; using P = pair<int, int>; int main() { int n, a, b; string s; cin >> >> n >> a >> b >> s; int cnt = 0; rep(i, n...
a.cc: In function 'int main()': a.cc:13:10: error: expected primary-expression before '>>' token 13 | cin >> >> n >> a >> b >> s; | ^~
s517442568
p03971
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,A,B; cin >> N >> A >> B; int pp = 0; fp = 0; char c; for (int i = 0; i < N; i++){ cin >> c; if (c = 'a'){ if (pp < A + B){ cout << "Yes" << endl; pp++; } else { cout << "No" << endl; } } i...
a.cc: In function 'int main()': a.cc:6:15: error: 'fp' was not declared in this scope; did you mean 'pp'? 6 | int pp = 0; fp = 0; | ^~ | pp
s470756692
p03971
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b; string str; cin >> n >> a >> b >> str; int tmp = 0; int foreign = 0; for (int i = 0; i < n; i++) { string ans; if (str.at(i) == 'a') { if (tmp < a+b) { tmp++; ans = "Yes"; } else { ans = "No"...
a.cc: In function 'int main()': a.cc:20:7: error: 'foreing' was not declared in this scope; did you mean 'foreign'? 20 | foreing++; | ^~~~~~~ | foreign
s674272697
p03971
C++
#include<bits/stdc++.h> using namespace std; signed main(){ int a,b,n=0,d; string c; cin>>a>>b>>d cin>>c; for(int i=0;i<c.size();i++){ if(c[i]=='c') cout<<"No"; else{ if(c[i]=='b'&&i<=d){ if(n<=b+d){ n++; cout<<"Yes"; } else cout<<"No"; } e...
a.cc: In function 'int main()': a.cc:6:15: error: expected ';' before 'cin' 6 | cin>>a>>b>>d | ^ | ; 7 | cin>>c; | ~~~
s021707687
p03971
C++
#include "bits/stdc++.h" using namespace std; #define INF 1e9 #define rep(i, n) for(int i = 0; i < n; i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9+7; typedef priority_queue<int> PQ; typedef vector<long long> VL; typedef vector<bool> VB; typede...
a.cc: In function 'int main()': a.cc:65:11: error: expected ';' before 'for' 65 | t = "" | ^ | ; a.cc:66:9: error: 'i' was not declared in this scope 66 | rep(i,s.size()){ | ^ a.cc:4:34: note: in definition of macro 'rep' 4 | #define rep(i, n) for(int i = ...
s660397882
p03971
C++
#include <iostream> #include <string> using namespace std; int main() { int n = 0, a = 0, b = 0; cin >> n >> a >> b; string s = ""; cin >> s; int ab = 0, bb = 0; for (int i=0; i<n; i++) { if (s.at(i) == 'a') { if (aa < a + b) { cout << "Yes" << endl; aa++; } else { ...
a.cc: In function 'int main()': a.cc:14:11: error: 'aa' was not declared in this scope; did you mean 'ab'? 14 | if (aa < a + b) { | ^~ | ab a.cc:21:11: error: 'aa' was not declared in this scope; did you mean 'ab'? 21 | if (aa < a + b && bb < b) { | ^~ ...
s332821018
p03971
C++
#include <iostream> #include <string> using namespace std; int main() { int n = 0, a = 0, b = 0; cin >> n >> a >> b; string s = ""; cin >> s; int ab = 0; bb = 0; for (int i=0; i<n; i++) { if (s.at(i) == 'a') { if (aa < a + b) { cout << "Yes" << endl; aa++; } else { ...
a.cc: In function 'int main()': a.cc:11:15: error: 'bb' was not declared in this scope; did you mean 'ab'? 11 | int ab = 0; bb = 0; | ^~ | ab a.cc:14:11: error: 'aa' was not declared in this scope; did you mean 'ab'? 14 | if (aa < a + b) { | ^~ ...
s643403112
p03971
C++
#include<bits/stdc++.h> using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<n;i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; #define INF 1000000000 #define mod 1000000007 typedef long long ll; const ll LINF = 1001002003004005006ll; int dx[]={1,0,-1,0}; int ...
a.cc: In function 'int main()': a.cc:20:26: error: expected primary-expression before ';' token 20 | int n,a,b;cin>>n>>a>>; | ^
s098655267
p03971
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int A = sc.nextInt(); int B = sc.nextInt(); String S = sc.next(); int pass = 0; int bRank = 0; for (int i = 0; i < N; i++) { char c = ...
Main.java:16: error: cannot find symbol if (c == a && pass < A+B) { ^ symbol: variable a location: class Main Main.java:19: error: cannot find symbol } else if (c == b) { ^ symbol: variable b location: class Main 2 errors
s181957212
p03971
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); char c = sc.next().toCharArray(); int cntA = 0; int cntB = 0; for(int i = 0;i < n;i++){ ...
Main.java:8: error: incompatible types: char[] cannot be converted to char char c = sc.next().toCharArray(); ^ Main.java:12: error: array required, but char found if(c[i]=='a'&&cntA+cntB<a+b){ ^ Main.java:15: error: array required, but char found }else...
s595715609
p03971
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin >> n >> a >> b; string s; cin >> s; int x=0,y=0; for(int i=0;i<s.size();i++){ if(s[i]=='c'){ cout << "No" << endl; } else if(s[i]=='b'){ if(x<a+b&&y<b){ x++; y++; cout << "Yes" << endl; ...
a.cc: In function 'int main()': a.cc:20:25: error: 'enld' was not declared in this scope 20 | cout << "No" << enld; | ^~~~
s587685983
p03971
C++
package main import( "fmt" ) func main(){ var n,a,b int fmt.Scan(&n,&a,&b) var s string fmt.Scan(&s) pass := 0 brank := 0 for i := 0; i < len(s); i++ { if s[i] == 'a' && pass < a+b { pass++ fmt.Println("Yes") } else if s[i] == 'b' && pass<a+b && brank < b { pass++ bran...
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~
s141931731
p03971
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) //typedef pair<long long,long long> P; const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c;...
a.cc: In function 'int main()': a.cc:95:21: error: invalid declarator before 'mp' 95 | int map<char,int> mp; | ^~ a.cc:98:10: error: expected ']' before '[' token 98 | map[s[i]]++; | ^ | ] a.cc:98:14: error: expected initializer before '++' token 98...
s672624781
p03971
C
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include <ctype.h> #include <stdint.h> #include <string.h> #include <wchar.h> #include <math.h> #define N_MAX (100) #define P_MAX (100) #define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX...
main.c: In function 'main': main.c:126:17: error: 'M' undeclared (first use in this function) 126 | if (2 * N < M) { | ^ main.c:126:17: note: each undeclared identifier is reported only once for each function it appears in
s059833241
p03971
C
#include <bits/stdc++.h> #include <cstdio> #include <vector> using namespace std; int main(void){ int n,a,b; scanf("%d%d%d",&n,&a,&b); string s; cin >> s ; int d=0,ab=0; for(int i=0;i<n;i++){ if(s[i]=='c')cout<< "No" << endl; else if(s[i]=='a'){ if(d+ab<a+b){ d++; cout<<"Yes"<<endl; }else{ ...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s950550655
p03971
C++
#include<bits/stdc++.h> #include<vector> #include<string> #include<set> #include<iomanip> #include<algorithm> using namespace std; //int main() { int n,a,b,coub,cnt;cin >> n >> a >> b; cnt = 0; string s,scoub;cin >> s; int c = a+b; for(int i=0;i<n;i++){ if(s[i]=='a'){ if(cnt<=c){ cout << "Y...
a.cc:10:22: error: 'cin' does not name a type 10 | int n,a,b,coub,cnt;cin >> n >> a >> b; | ^~~ a.cc:11:3: error: 'cnt' does not name a type; did you mean 'int'? 11 | cnt = 0; | ^~~ | int a.cc:12:18: error: 'cin' does not name a type 12 | string s,scoub;cin >> s...
s086197049
p03971
C++
#include<iostream> using namespace std; int main(){ int n, a, b; cin >> n >> a >> b; char x; int in = 1, out = 1; for(int i = 0; i < n; i++){ cin >> x; if(x == 'a' && in+out <= a+b){ cout << "Yes" << endl; in++; }else if(x == 'b' && in+out <= a+b && out <= b){ cout << "Yes" << endl; out++; }...
a.cc: In function 'int main()': a.cc:23:10: error: expected '}' at end of input 23 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s966578244
p03971
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <stdio.h> using namespace std; using ll =long long; int main (void) { int N,A,B; cin >> N >> A >>B; string S; cin >> S; int pass=0; int kpass=0; ...
a.cc: In function 'int main()': a.cc:31:13: error: expected ';' before 'kpass' 31 | pass++ | ^ | ; 32 | kpass++ | ~~~~~
s086478110
p03971
C
/* cat <<EOF >mistaken-paste */ #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #define BIG 2000000007 #define MOD 1000000007 typedef unsigned long long ull; typedef signed long long sll; #define N_M...
main.c: In function 'solve': main.c:312:15: error: 'a' undeclared (first use in this function) 312 | qsort(a, n, sizeof(ull), ullcomp); | ^ main.c:312:15: note: each undeclared identifier is reported only once for each function it appears in main.c:322:17: error: duplicate case value 322...
s974328765
p03971
C++
#include <cstdio> const int N = 100500; char buf[N]; int main() { int n, a, b; scanf("%d %d %d", &n, &a, &b); scanf("%s", buf); int ab = a + b, sum = 0, cb = 0; for (int i = 0; i < n; i++) { if (buf[i] == 'a') { if (ca + cb < ab) { sum++; put...
a.cc: In function 'int main()': a.cc:14:17: error: 'ca' was not declared in this scope; did you mean 'cb'? 14 | if (ca + cb < ab) { | ^~ | cb a.cc:21:17: error: 'ca' was not declared in this scope; did you mean 'cb'? 21 | if (ca + cb < ab && cb <...
s621715883
p03971
Java
public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(); int A = s.nextInt(); int B = s.nextInt(); String S = s.next(); int count = 0; for(int i = 0; i < N; i++) { if(S.charAt(i) == 'a' ...
Main.java:3: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s799190371
p03971
Java
import java.util.Scanner; /** * Created by apple on 10/21/16. */ public class Main { public static void main(String[] args) { Scanner s1 = new Scanner(System.in); int N = s1.nextInt(); int A = s2.nextInt(); int B = s3.nextInt(); String S = s4.nextLine(); int cou...
Main.java:10: error: cannot find symbol int A = s2.nextInt(); ^ symbol: variable s2 location: class Main Main.java:11: error: cannot find symbol int B = s3.nextInt(); ^ symbol: variable s3 location: class Main Main.java:12: error: cannot find symbol St...
s675412634
p03971
C++
#include <iostream> #include <string.h> using namespace std; int main(){ int num, a, b; scanf("%d %d %d", &num, &a, &b); char str[num+1]; scanf("%s", str); for(int i = 0; i < std::strlen(str); i++){ if(str[i] == 'a'){ if(a > 0) a--; else i...
a.cc: In function 'int main()': a.cc:13:29: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'? 13 | for(int i = 0; i < std::strlen(str); i++){ | ^~~~~~ | mbrlen
s192432452
p03971
C++
#include <string> #include <iostream> int main(){ int num, a, b; scanf("%d %d %d", &num, &a, &b); char str[num+1]; scanf("%s", str); for(int i = 0; i < strlen(str); i++){ if(str[i] == 'a'){ if(a > 0) a--; else if( b > 0) b--; ...
a.cc: In function 'int main()': a.cc:11:24: error: 'strlen' was not declared in this scope 11 | for(int i = 0; i < strlen(str); i++){ | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream...
s890949550
p03971
C++
#include <iostream> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(int)(b);i++) #define rep(i,n) FOR(i,0,n) int n,a,b; string s; int main() { cin>>n>>a>>b; cin>>s; int c = a+b; int p=0, q=0; rep(i,n) { bool f = false; if(s[i]=='a'){ if(p < c) { ...
a.cc: In function 'int main()': a.cc:30:43: error: expected ';' before '}' token 30 | cout << (f ? "Yes" : "No") << endl | ^ | ; 31 | } | ~
s031900619
p03971
Java
import java.util.*; import java.io.*; public class Main { public static void main(String [] args)throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int a = Integer.parseInt(st....
Main.java:12: error: cannot find symbol for(int i = 0;i < str.length();i++){ ^ symbol: variable str location: class Main Main.java:13: error: cannot find symbol if(str.charAt(i) == 'c') ^ symbol: variable str location: class Main 2 errors
s853933267
p03971
C++
#include<iostream> #include<string> #include<vector> using namespace std; int main() { int n,a,b; vector<int> v(2,0); cin>>n>>a>>b; string s; cin>>s; int n = s.size(); for(int j=0;j<n;++j) { if(s[j]=='a'){ if(v[0]+v[1]<a+b)cout<<"yes"<<endl; v[...
a.cc: In function 'int main()': a.cc:12:9: error: redeclaration of 'int n' 12 | int n = s.size(); | ^ a.cc:7:9: note: 'int n' previously declared here 7 | int n,a,b; | ^
s045248375
p03971
C
< 1 || total <1) { printf("NO\n"); } else { printf("YES\n"); B = B - 1; total = total - 1; } } else { if(total < 1) { printf("NO\n"); } else { printf("YES\n"); total = total - 1; } } } } return 0; }
main.c:1:2: error: expected identifier or '(' before '<' token 1 | < 1 || total <1) | ^ main.c:5:33: error: expected identifier or '(' before 'else' 5 | else | ^~~~ main.c:11:25: error: expected identifier or '(' before '}' token 1...
s453750336
p03971
C++
int main() { unsigned int n, a, b; cin >> n >> a >> b; string str; cin >> str; int i; int overseas = 0; for(i = 0; i < n; ++i) { switch(str[i]) { case 'a' : { if(a+b > 0) { cout << "Yes" << endl; a--; break; } } case 'b' : { if(a+b > 0 && overseas < b) { ...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> n >> a >> b; | ^~~ a.cc:7:9: error: 'string' was not declared in this scope 7 | string str; | ^~~~~~ a.cc:9:16: error: 'str' was not declared in this scope; did you mean '...
s102199753
p03971
C++
#include <iostream> using namespace std; main() { int N, A, B; int a = 0; //countA int b = 0; //coutnB char s[100000]; int i = 0; cin >> N >> A >> B; cin >> s; for (i, i < 100000; i++;) { switch (s[i]) { case 'a': if (a <= A + B) { cout << "Yes"; a++; } else { cout << "No"; }...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() { | ^~~~ a.cc:48:9: error: expected unqualified-id before 'return' 48 | return 0; | ^~~~~~ a.cc:49:1: error: expected declaration before '}' token 49 | } | ^
s773207736
p03971
C++
#include <iostream> using namespace std; main() { int N, A, B; int a = 0; //countA int b = 0; //coutnB char s[100000]; int i = 0; cin >> N >> A >> B; cin >> s; for (i, i < 100000; i++;) { switch (s[i]) { case 'a': if (a < A + B) { cout << "Yes"; a++; } else { cout << "No"; } ...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:46:29: warning: NULL used in arithmetic [-Wpointer-arith] 46 | if (s[i] == NULL) { | ^~~~ a.cc: At global scope: a...
s069030950
p03971
C++
#include <iostream> using namespace std; main() { int N, A, B; int a = 0; //countA int b = 0; //coutnB char s[100000]; int i = 0; cin >> N >> A >> B; cin >> s; for (i, i < 100000; i++;) { switch (s[i]) { case 'a': if (a < A + B) { cout << "Yes"; a++; } else { cout << "No"; } ...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:45:10: error: expected '}' at end of input 45 | } | ^ a.cc:4:8: note: to match this '{' 4 | main() { | ^
s686118317
p03971
C++
#define REP(I,A,B) for(int I = (A); I < (B); ++I) #define REPN(I,A,B) for(int I = (A); I > (B); --I) #define MAX(A,B) ((A) > (B) ? (A) : (B)); int dirx[8] = {-1,0,0,1,-1,-1,1,1}; int diry[8] = {0,1,-1,0,-1,1,-1,1}; int rb[200000]; int lb[200000]; int main() { int n,a,b; cin >> n >> a>> b; REP(i, 0, n) { char ch...
a.cc: In function 'int main()': a.cc:13:9: error: 'cin' was not declared in this scope 13 | cin >> n >> a>> b; | ^~~ a.cc:18:25: error: 'cout' was not declared in this scope 18 | cout << "Yes" << endl; | ^~~~ a.cc:18:42: error: 'endl' was...
s787962090
p03971
Java
import java.util.Scanner;; public class Qualification_simulator { public static void main(String[] args) { // TODO Auto-generated method stub @SuppressWarnings("resource") Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int A = sc.nextInt(); int B = sc.nextInt(); @SuppressWarnings("resource")...
Main.java:2: error: class Qualification_simulator is public, should be declared in a file named Qualification_simulator.java public class Qualification_simulator { ^ 1 error
s093127270
p03971
C++
#include <iostream> #include <string> using namespace std; int rank(string s,int point){ int count = 0; for(int i=0;i<point;i++){ if(s[i] == 'b'){ count++; } } return count; } int main(){ int n,a,b; cin >> n >> a >> b; string s; cin >> s; int count = 0...
a.cc: In function 'int main()': a.cc:29:33: error: reference to 'rank' is ambiguous 29 | }else if(s[i] == 'b' && rank(s,i) <= b && a+b > count){ | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr....
s111591803
p03971
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int n = sc.nextInt(); int a = sc.nextInt(); // スペース区切りの整数の入力 int b = sc.nextInt(); // 文字列の入力 String s = sc.next(); String sa[]; sa = new String[s.length()]...
Main.java:18: error: cannot find symbol if(i < c.length() -1){ ^ symbol: variable c location: class Main 1 error
s009633164
p03971
C++
#include <iostream> #include <string> using namespace std; int rank(string s,int point){ int count = 0; for(int i=0;i<point;i++){ if(s[i] == 'b'){ count++; } } return count; } int main(){ int n,a,b; cin >> n >> a >> b; string s; cin >> s; int count = 0...
a.cc: In function 'int main()': a.cc:28:33: error: reference to 'rank' is ambiguous 28 | }else if(s[i] == 'b' && rank(s,i) <= b && a+b > count){ | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr....
s029741655
p03971
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int n = sc.nextInt(); int a = sc.nextInt(); // スペース区切りの整数の入力 int b = sc.nextInt(); // 文字列の入力 String s = sc.next(); String sa[]; sa = new String[s.length()]...
Main.java:38: error: > or ',' expected if(countY < a + b && countB =< b){ ^ 1 error
s824852538
p03971
C++
#include<bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n, a, b; cin >> n >> a >> b; int c = a+b; string s; cin >> s; int r1 = 0, total = 0, r2 = 0; for(int i=0; i<n; i++) { if(s[i] == 'c') { cout << "No" << endl; } else if(s[i] == 'a') { if(total < c) { total++; c...
a.cc:13:31: error: extended character   is not valid in an identifier 13 | for(int i=0; i<n; i++) { | ^ a.cc: In function 'int main()': a.cc:13:31: error: '\U00003000' was not declared in this scope 13 | for(int i=0; i<n; i++) { | ...
s818169400
p03971
C++
#include <iostream> #include <string> using namespace std; int main() { int n,a,b; cin >> n >> a >> b; string s; cin >> s; std::string nihon("a"); std::string kaigai("b"); for (int i = 0; i < n; ++i) { if(a+b>0){ if(s[i]=="a"){ cout << "Yes" << endl; ...
a.cc: In function 'int main()': a.cc:15:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(s[i]=="a"){ a.cc:18:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | }else if (s[i]=="b" && b>0){
s414288177
p03971
Java
import java.util.Scanner; public class Maiin { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int a = scanner.nextInt(); int b = scanner.nextInt(); int ta = 0, tb = 0; String string = scanner.next(); for (int i = 0; i < n; i++) { switch (...
Main.java:3: error: class Maiin is public, should be declared in a file named Maiin.java public class Maiin { ^ 1 error
s799292939
p03971
C++
#include <iostream> #include <string> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; string S; cin >> S; int exceed = 0; int orderB = 0; for (int i = 0; i < N; i++) { char c = S.at[i]; switch(c){ case 'a': if (exceed < A + B) { cout << "Yes" << endl; exceed++; } else {...
a.cc: In function 'int main()': a.cc:13:30: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 13 | char c = S.at[i]; | ^
s906183186
p03971
Java
import java.util.*; import java.lang.*; import java.io.*; public static void Main (String[] args) throws java.lang.Exception { Scanner reader = new Scanner(System.in); int N = reader.nextInt(); int A = reader.nextInt(); int B = reader.nextInt(); reader.nextLine(); String in...
Main.java:6: error: unnamed classes are a preview feature and are disabled by default. public static void Main (String[] args) throws java.lang.Exception ^ (use --enable-preview to enable unnamed classes) 1 error
s079751659
p03971
C++
#include <iostream> #include <string> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; string S; cin >> S; int exceed = 0; int orderB = 0; for (int i = 0; i < N; i++) { switch (S.at[i]) { case 'a': if (exceed < A + B) { cout << "Yes" << endl; exceed++; } else { cout <<...
a.cc: In function 'int main()': a.cc:13:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 13 | switch (S.at[i]) { | ^
s211951597
p03971
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a) ;i < (b) ;i++) #define repr(i, a, b) for (int i = (b) - 1 ;i >= a ;i--) int main(){ int N, A, B ; string S ; cin>>N >>A>>B ; cin>>S ; int a = 0, b = 0 ; for (int i = 0 ;i < N ;i++){ if (s[i] == 'c')cout<<"No"<<endl ; if (s[i]...
a.cc: In function 'int main()': a.cc:12:21: error: 's' was not declared in this scope 12 | if (s[i] == 'c')cout<<"No"<<endl ; | ^ a.cc:13:21: error: 's' was not declared in this scope 13 | if (s[i] == 'a'){ | ^ a.cc:20:21: error: ...
s840471395
p03971
C++
#include <iostream> using namespace std; int main(){ int n,a,b,cnt,c; cnt=0; c=0; string s; cin>>n>>a>>b>>s; for(int i=0;i<s.length(),++i){ switch(s[i]){ case 'a': if(cnt<a+b) { cout<<'Yes'<<endl; cnt++; ...
a.cc:15:27: warning: multi-character character constant [-Wmultichar] 15 | cout<<'Yes'<<endl; | ^~~~~ a.cc: In function 'int main()': a.cc:11:33: error: expected ';' before ')' token 11 | for(int i=0;i<s.length(),++i){ | ...
s922417522
p03971
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long ll; typedef vector<int> vi; #define rep(i,j) for(int i=0;i<(j);i++) #define reps(i,j,k) for(int i=j;i<=k;i++) #define in(i,j,k) ((i)>=(j)&&(i)<=(k)) #define INF (1<<28) #define pb(i) push_back(i) #define fs first #define sc seco...
a.cc: In function 'int main()': a.cc:30:45: error: expected primary-expression before '<<' token 30 | }else cout << "No"< << endl; | ^~
s108990124
p03972
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) #define rrep(i,n) for(int i = (n)-1; i >= 0; i--) #define rep1(i,n) for(int i = 1; i <= (n); i++) #define rrep1(i,n) for(int i = (n); i > 0; i--) #define ll long long #define pi pair<int, int> #define pll pair<ll, ll> #define MOD 1000000007 #defin...
a.cc: In function 'int main()': a.cc:26:3: error: 'UnionFind' was not declared in this scope 26 | UnionFind uf(w+h); | ^~~~~~~~~
s081541611
p03972
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; #define F first #define S second #define pb push_back #define all(x) (x).begin(), (x).end() ll n, m, ans; vector<pii> data; int main() { cin >> n >> m; for (ll i = 0; i < n; i++) { ll x; cin >> x; data.pb({x, 0}); }...
a.cc: In function 'int main()': a.cc:19:17: error: reference to 'data' is ambiguous 19 | data.pb({x, 0}); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/b...
s627036172
p03972
C++
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define endl '\n' #define loop(i, ...
In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:3: /usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<std::pair<long long int, bool>, std:...
s764881274
p03972
C++
import sys from operator import itemgetter read = sys.stdin.read readline = sys.stdin.readline W, H, *pq = map(int, read().split()) pq = list(zip(pq[:W], ['p'] * W)) + list(zip(pq[W:], ['q'] * H)) pq.sort(key=itemgetter(0)) answer = 0 x = W + 1 y = H + 1 for cost, i in pq: if i == 'p': answer += cost * y ...
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s330365240
p03972
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<un...
a.cc: In function 'void solve()': a.cc:62:14: error: 'e' was not declared in this scope; did you mean 'es'? 62 | sort(all(e)); | ^ a.cc:45:16: note: in definition of macro 'all' 45 | #define all(c) c.begin(),c.end() | ^
s115034291
p03972
C++
include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) typedef long long ll; typedef pair<ll,ll> P; int main(){ ll w, h; cin >> w >> h; ll p, q; priority_queue<P,vector<P>,greater<P>> que; rep(i,w) { cin >> p; que.push(P(p,0)); } rep(i,...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc:5:9: error: 'pair' does not name a type 5 | typedef pair<ll,ll> P; | ^~~~ a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin >> w >> h; | ^~...
s157147430
p03972
C++
// 素集合データ構造 struct UnionFind { // par[i]:データiが属する木の親の番号。i == par[i]のとき、データiは木の根ノードである vector<int> par; // sizes[i]:根ノードiの木に含まれるデータの数。iが根ノードでない場合は無意味な値となる vector<int> sizes; UnionFind(int n) : par(n), sizes(n, 1) { // 最初は全てのデータiがグループiに存在するものとして初期化 rep(i,n) par[i] = i; } // データxが属する木の根を得る int fi...
a.cc:5:3: error: 'vector' does not name a type 5 | vector<int> par; | ^~~~~~ a.cc:7:3: error: 'vector' does not name a type 7 | vector<int> sizes; | ^~~~~~ a.cc: In constructor 'UnionFind::UnionFind(int)': a.cc:9:22: error: class 'UnionFind' does not have any field named 'par' 9 | Unio...
s283126041
p03972
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) struct path{ int cst,char wh; path(){}; path(int cst_,char wh_){ cst=cst_;wh=wh_; }; bool operator<(const path& o)const{return cst>o.cst;} }; signed main(){ int w,h;cin>>w>>h; vector<int>p(w),q(h);...
a.cc:7:25: error: expected unqualified-id before 'char' 7 | int cst,char wh; | ^~~~ a.cc: In constructor 'path::path(long long int, char)': a.cc:10:34: error: 'wh' was not declared in this scope; did you mean 'wh_'? 10 | cst=cst_;wh=wh_; ...
s484957616
p03972
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) struct path{ int cst,char wh; path(){}; path(int cst_,char wh_){ cst=cst_,wh=wh_; }; bool operator<(const path& o)const{return cst>o.cst;} }; signed main(){ int w,h;cin>>w>>h; vector<int>p(w),q(h);...
a.cc:7:25: error: expected unqualified-id before 'char' 7 | int cst,char wh; | ^~~~ a.cc: In constructor 'path::path(long long int, char)': a.cc:10:34: error: 'wh' was not declared in this scope; did you mean 'wh_'? 10 | cst=cst_,wh=wh_; ...
s686085863
p03972
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll w,h;cin>>w>>h; vector<ll> p(w),q(h); ll ans=0; for(ll i=0;i<w;i++){ cin>>p[i]; ans+=p[i]; } sort(p.begin(),p.end()); ll sum[w+1]; sum[0]=0; for(ll i=0;i<w;i++){ sum[i+1]=sum[i]+p[i]; } for(ll j=0;j<h;j++)...
a.cc: In function 'int main()': a.cc:19:12: error: 'i' was not declared in this scope 19 | cin>>q[i]; | ^ a.cc:21:26: error: 'n' was not declared in this scope 21 | ll c=lower_bound(p,p+n,q[i])-p.begin(); | ^
s049188185
p03972
C++
#include <bits/stdc++.h> using namespace std; // 変数ダンプ先。coutかcerr #define DUMPOUT cerr // 提出時はコメントアウト #define DEBUG_ // #define int long long struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast; /* cpp template {{{ */ /* short */ #define pb push_back #define eb emplace_back #define mp make_pair...
a.cc: In function 'int main()': a.cc:115:19: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 115 | int W, H; cin << W << H; | ~~~ ^~ ~ | | | | | int | std::istre...
s046897013
p03972
C++
while (i < H || j < W) { if (i == H) { ans += p[j]; j++; } else if (j == W) { ans += q[i]; i++; } else { if (q[i] < p[j]) { ans += (W - j + 1) * q[i]; i++; } else { ans += ...
a.cc:1:5: error: expected unqualified-id before 'while' 1 | while (i < H || j < W) { | ^~~~~ a.cc:18:5: error: 'cout' does not name a type 18 | cout << ans << endl; | ^~~~ a.cc:20:5: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: err...
s509125470
p03972
C++
import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solve(); } int W,H,N; long[]p; long[]q; long INF=Long.MAX_VALUE/2; void solve(){ Scanner sc=new Scanner(System.in); W=sc.nextInt(); H=sc.nextInt(...
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.PriorityQueue; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmod...
s954383117
p03972
C++
#include <iostream> #include <vector> #include <cmath> #include <cstdio> #include <string> #include <algorithm> #include <queue> #include <unordered_map> #include <map> #define ll long long using namespace std; #define MOD 1000000007 class Solve { private: ll w, h; vector<ll> p; vector<ll> q; public: Solve(){ ...
cc1plus: error: '::main' must return 'int'
s459871435
p03972
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<map> #include<queue> #include<vector> #include<cstdlib> #define range(i,a,b) for(int i = (a); i <= (b); i++) #define rrange(i,a,b) for(int i = (a); i >= (b); i--) #define rep(i,b) for(int i = 1; i <= (b); i++) #define rrep(i,b) for(int i...
a.cc:26:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive] 26 | operator <(node &b){ | ^~~~~~~~
s309114707
p03972
C++
#include<iostream> #include<unordered_map> #include<cstdio> #include<algorithm> #define count Count #define P pair<int,int> #define ll long long using namespace std; P c[200000]; int count[2]; int n[2]; signed main() { int a, b; scanf("%d%d", &a, &b); n[0] = a; n[1] = b; for (int d = 0; d < a; d++) { int e; scanf...
a.cc: In function 'int main()': a.cc:7:12: error: expected primary-expression before 'long' 7 | #define ll long long | ^~~~ a.cc:27:24: note: in expansion of macro 'll' 27 | ans += ll(c[i].first)*(n[(c[i].second + 1) & 1]- count[(c[i].second + 1) & 1]+1); | ...
s576096207
p03972
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int W, H; cin >> W >> H; vector<int> p(W); vector<int> q(H); for(int i = 0; i < W; i++) cin >> p[i]; for(int i = 0; i < H; i++) cin >> q[i]; sort(p.begin(), p.end()); sort(q.begin(), q.end()); int w = W...
a.cc: In function 'int main()': a.cc:21:15: error: 'j' was not declared in this scope 21 | int i = 0; j = 0; | ^
s676306944
p03972
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int W, H; cin >> W >> H; vector<int> p(W); vector<int> q(H); for(int i = 0; i < W; i++) cin >> p[i]; for(int i = 0; i < H; i++) cin >> q[i]; sort(p.begin(), p.end()); sort(q.begin(), q.end()); int w = W...
a.cc: In function 'int main()': a.cc:21:15: error: 'j' was not declared in this scope 21 | int i = 0; j = 0; | ^ a.cc:23:28: error: 'P' was not declared in this scope 23 | if(j < H && (i == W || P[i] > Q[j])){ | ^ a.cc:23:35: error: 'Q' was not declared ...
s736451278
p03972
C++
#include <bits/stdc++.h> using namespace std; int w,h; int main() { cin >> w >> h; multimap<long long, int > v; long long temp; long long cost = 0; for (int i = 0; i < w; ++i) { cin >> temp; v.insert(pair<long long,int>(temp, 1)); } for (int i = 0; i < h; ++i...
a.cc: In function 'int main()': a.cc:31:48: error: conversion from '_Rb_tree_iterator<pair<const long long int,[...]>>' to non-scalar type '_Rb_tree_iterator<pair<const int,[...]>>' requested 31 | for (multimap<int, int>::iterator i=v.begin(); i!=v.end(); i++) | ~~~~...
s691316963
p03972
C++
#include <bits/stdc++.h> #define EPS 1e-9 #define INF 1070000000LL #define MOD 1000000007LL #define fir first #define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++) #define numa(x,a) for(auto x: a) #define ite iterator #define mp make_pair #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=m;i<(n);i+...
a.cc: In function 'int main()': a.cc:47:22: error: 'QLL' was not declared in this scope; did you mean 'ALL'? 47 | sort(ALL(p)); sort(QLL(q)); | ^~~ | ALL
s716941684
p03972
C++
#include <vector> #include <iostream> #include <algorithm> #include <string> #include <deque> #include <queue> using namespace std; struct TEdge { int From; int To; int Type; int Cost; }; bool operator < (const TEdge& lhs, const TEdge& rhs) { return lhs.Cost > rhs.Cost; } int main() { ios_bas...
a.cc: In function 'int main()': a.cc:35:5: error: 'TDsu' was not declared in this scope 35 | TDsu dsu[2]; | ^~~~ a.cc:38:9: error: 'dsu' was not declared in this scope 38 | dsu[i].Init(n[i] + 1); | ^~~
s237954901
p03972
Java
import ARC.Tools.PriorityQue; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.util.PriorityQueue; /** * Created by jaga on 9/22/16. */ public class Main{ public static void solve(PrintWriter ou...
Main.java:2: error: package ARC.Tools does not exist import ARC.Tools.PriorityQue; ^ 1 error
s889882074
p03972
C++
#include <string> #include <vector> #include <map> #include <set> #include <cassert> #include <iostream> #include <algorithm> #include <sstream> #include <list> using namespace std; void read(int &w){ cin >> w; } int main(int argc, char * argv [] ) { /** 4 3 2 4 8 1 2 9 3 https://code-festival-2016-qualb.contest...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:7: /usr/include/c++/14/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >; _Funct = void (*)(int&)]': a.cc:35:13: requi...
s731121976
p03972
C++
/* *************************************** Author :Scau.ion Created Time :2016/10/10 19:56:54 UTC+8 File Name :ion.cpp *************************************** */ #include <bits/stdc++.h> #define LL long long #define ULL unsigned long long #define PB push_back #define MP make_pair #define PII pair<int,int>...
a.cc:30:5: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive] 30 | operator <(const edge &b)const | ^~~~~~~~
s886159835
p03972
C++
#include <iostream> #include <vector> #include <string> #include <queue> #define INT_MAX = 100000001; using namespace std; struct node { int x; int y; int dis; node* p; node(int _x, int _y, int d) :x(_x), y(_y), dis(d), p(NULL){}; }; struct com { bool operator()(node x, node y) { return x.dis > y.dis; } };...
a.cc: In function 'int main()': a.cc:43:51: error: expected primary-expression before '(' token 43 | vector<vector<node> >arr(w+1, vector<node>(h+1,node(0, 0, INT_MAX))); | ^ a.cc:43:60: error: expected primary-expression before '(' token 43 | ...
s499301618
p03972
C++
#include <iostream> #include <vector> #include <string> #include <queue> using namespace std; struct node { int x; int y; int dis; node* p; node(int _x, int _y, int d) :x(_x), y(_y), dis(d), p(NULL){}; }; struct com { bool operator()(node x, node y) { return x.dis > y.dis; } }; int main() { int w, h; cin...
a.cc: In function 'int main()': a.cc:42:67: error: 'INT_MAX' was not declared in this scope 42 | vector<vector<node> >arr(w+1, vector<node>(h+1,node(0, 0, INT_MAX))); | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; ...
s109180890
p03972
C++
#include<vector> #include<random> #include<stack> #include<sstream> #include<list> #include<iomanip> #include<numeric> #include<algorithm> #include<map> #include<cstdlib> #include<string> #include<cstring> #include<cstdio> #include<limits> #include<cmath> #include<deque> #include<iostream> #include<unordered_map> #incl...
a.cc: In function 'void solve()': a.cc:55:45: error: no matching function for call to 'edge::edge(point, point, int)' 55 | pq.push(edge(point(0,0),point(0,0),0)); | ^ a.cc:37:9: note: candidate: 'edge::edge(point, int)' 37 | edge(point e,int w):end...
s605715577
p03972
C++
#include <iostream> #include <vector> #include <string> #include <queue> using namespace std; struct node { int x; int y; int dis; node* p; node(int _x, int _y, int d) :x(_x), y(_y), dis(d), p(NULL){}; }; struct com { bool operator()(node x, node y) { return x.dis > y.dis; } }; int main() { int w, h; cin...
a.cc: In function 'int main()': a.cc:42:67: error: 'INT_MAX' was not declared in this scope 42 | vector<vector<node> >arr(w+1, vector<node>(h+1,node(0, 0, INT_MAX))); | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; ...
s792158375
p03972
C++
#include <iostream> #include <vector> #include <string> #include <queue> using namespace std; struct node { int x; int y; int dis; node* p; node(int _x, int _y, int d) :x(_x), y(_y), dis(d), p(NULL){}; }; struct com { bool operator()(node x, node y) { return x.dis > y.dis; } }; int main() { int w, h; cin...
a.cc: In function 'int main()': a.cc:42:67: error: 'INT_MAX' was not declared in this scope 42 | vector<vector<node> >arr(w+1, vector<node>(h+1,node(0, 0, INT_MAX))); | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; ...
s289010583
p03972
C++
#include <iostream> #include <set> #include <algorithm> using namespace std; int main() { #define int long long int W, H; cin >> W >> H; set<pair<int, bool>> S; for (int i = 0; i < W; i++) { int k; cin >> k; S.insert(make_pair(k, true)); } for (int i = 0; i < H; i++...
a.cc: In function 'int main()': a.cc:28:23: error: no matching function for call to 'max(long long int&, int)' 28 | res += max(H, 0) * it->first; | ~~~^~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s745506972
p03972
C++
#include <iostream> #include <set> #include <algorithm> using namespace std; int main() { #define int long long; int W, H; cin >> W >> H; set<pair<int, bool>> S; for (int i = 0; i < W; i++) { int k; cin >> k; S.insert(make_pair(k, true)); } for (int i = 0; i < H; i+...
a.cc: In function 'int main()': a.cc:8:21: error: declaration does not declare anything [-fpermissive] 8 | #define int long long; | ^~~~ a.cc:9:5: note: in expansion of macro 'int' 9 | int W, H; | ^~~ a.cc:9:9: error: 'W' was not declared in this scope 9 | int ...
s735654982
p03972
C++
#include <iostream> #include <set> #include <algorithm> using namespace std; int main() { #define int long long; int W, H; cin >> W >> H; set<pair<int, bool>> S; for (int i = 0; i < W; i++) { int k; cin >> k; S.insert(make_pair(k, true)); } for (int i = 0; i < H; i...
a.cc: In function 'int main()': a.cc:8:21: error: declaration does not declare anything [-fpermissive] 8 | #define int long long; | ^~~~ a.cc:9:5: note: in expansion of macro 'int' 9 | int W, H; | ^~~ a.cc:9:9: error: 'W' was not declared in this scope 9 | int ...
s358774471
p03972
C++
#include <iostream> #include <set> #include <algorithm> using namespace std; #define int long long; int main() { int W, H; cin >> W >> H; set<pair<int, bool>> S; for (int i = 0; i < W; i++) { int k; cin >> k; S.insert(make_pair(k, true)); } for (int i = 0; i < H; i++...
a.cc:7:18: error: declaration does not declare anything [-fpermissive] 7 | #define int long long; | ^~~~ a.cc:9:1: note: in expansion of macro 'int' 9 | int main() { | ^~~ a.cc:9:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | int main() { ...
s618734121
p03972
C++
#include <bits/stdc++.h> /* Karen {{{ ___ ____ |_ ||_ _| | |_/ / ,--. _ .--. .---. _ .--. | __'. `'_\ : [ `/'`\]/ /__\\[ `.-. | _| | \ \_ // | |, | | | \__., | | | | |____||____|\'-;__/[___] '.__.'[___||__] }}} */ /* cpp template {{{*/ using namespace std; #define endl '\n' #define REP...
/tmp/ccGSOFws.o: in function `main': a.cc:(.text+0x4e5): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccGSOFws.o a.cc:(.text+0x4ed): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccGSOFws.o a.cc:(.text+0x74a): relocatio...
s951299853
p03972
C++
#include <bits/stdc++.h> /* Karen {{{ ___ ____ |_ ||_ _| | |_/ / ,--. _ .--. .---. _ .--. | __'. `'_\ : [ `/'`\]/ /__\\[ `.-. | _| | \ \_ // | |, | | | \__., | | | | |____||____|\'-;__/[___] '.__.'[___||__] }}} */ /* cpp template {{{*/ using namespace std; #define endl '\n' #define REP...
/tmp/ccxPnRCF.o: in function `main': a.cc:(.text+0x395): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccxPnRCF.o a.cc:(.text+0x39d): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccxPnRCF.o a.cc:(.text+0x58a): relocatio...
s156559642
p03972
C++
#include <bits/stdc++.h> /* Karen {{{ ___ ____ |_ ||_ _| | |_/ / ,--. _ .--. .---. _ .--. | __'. `'_\ : [ `/'`\]/ /__\\[ `.-. | _| | \ \_ // | |, | | | \__., | | | | |____||____|\'-;__/[___] '.__.'[___||__] }}} */ /* cpp template {{{*/ using namespace std; #define endl '\n' #define REP...
/tmp/ccDyy3Rk.o: in function `main': a.cc:(.text+0x395): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccDyy3Rk.o a.cc:(.text+0x39d): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccDyy3Rk.o a.cc:(.text+0x58a): relocatio...
s161194516
p03972
C++
123123
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 123123 | ^~~~~~
s413866898
p03972
C++
#include <iostream> using namespace std; int main() { long W,H; int cost=0; int lastcost=-1; long long *P=new long long[W]; long long *Q=new long long[H]; cin >> W>>H; int **data = new int*[W+1]; for(int i=0;i<W+1;i++){ data[i] = new int [H+1]; } for(int i=0;i<W;i++){ cin >> P[i]; }...
a.cc: In function 'int main()': a.cc:102:17: error: 'cc' was not declared in this scope 102 | if(ii==0&&cc==0)lastcost=cost; | ^~ a.cc: At global scope: a.cc:112:3: error: 'cout' does not name a type 112 | cout<<lastcost<<endl; | ^~~~ a.cc:113:3: error: expected unqualified-id ...
s530576615
p03972
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a) ;i < (b) ;i++) #define repr(i, a, b) for (int i = (b) - 1 ;i >= a ;i--) int main(){ int w, h, p[100000], q[100000] ; cin >> w >> h ; rep(i, 0, w)cin>>p[i] ; rep(j, 0, h)cin>>q[j] ; long ans = 0, added = 0 ; sort(q,q+h,greater<...
a.cc: In function 'int main()': a.cc:17:37: error: expected ')' before '{' token 17 | while(!(i >= w) && !(j >= h){ | ~ ^ | )
s618191537
p03972
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<string> #include<cstring> #include<vector> #include<map> #include<list> #include<stack> #include<queue> #include<climits> //INT_MIN/MAX using namespace std; #define FOR(i,s,e) for(int (i)=(s);(i)<(e);(i)++) #define FORR(i,s,e) for(int (...
a.cc: In function 'int main()': a.cc:57:33: error: request for member 'begin' in 'p', which is of non-class type 'int [100005]' 57 | int it = *lower_bound(p.begin(), p.end(), q[i]); | ^~~~~ a.cc:57:44: error: request for member 'end' in 'p', which is of non-class type 'i...
s337059258
p03972
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; #define N 1000000001 #define inf 0x3f3f3f3f #define M 10001 vector<pair<int, int> > graph; int wei_x[M]; int wei_y[M]; int weight[N]; int visit[N]; int n, m; int dir[8] = {1, 0, 0, 1, -1, 0, 0, -1}; bool is_ok(int x, in...
/tmp/ccD0qqgR.o: in function `is_ok(int, int)': a.cc:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccD0qqgR.o a.cc:(.text+0x23): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccD0qqgR.o a.cc:(.text+0x2e): reloc...
s915182696
p03972
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; #define N 1000000001 #define inf 0x3f3f3f3f #define M 10001 vector<pair<int, int> > graph; int wei_x[M]; int wei_y[M]; int weight[N]; int visit[N]; int n, m; int dir[8] = {1, 0, 0, 1, -1, 0, 0, -1}; bool is_ok(int x, in...
/tmp/cc8KEjg6.o: in function `is_ok(int, int)': a.cc:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc8KEjg6.o a.cc:(.text+0x23): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc8KEjg6.o a.cc:(.text+0x2e): reloc...
s540678512
p03972
C
#include <stdio.h> #include <stdlib.h> int main() { double W,H; int intW,intH,p[100000001],q[100000001],i,j=0,sum=0; // 整数の入力 scanf("%lf %lf\n",&W,&H); intW = round(W); intH = rounf(H); for(i=0;i<intW;i++) scanf("%d\n",&p[i]); for(i=0;i<intH;i++) scanf("%d\n",&q[i]); for(i=0;...
main.c: In function 'main': main.c:11:12: error: implicit declaration of function 'round' [-Wimplicit-function-declaration] 11 | intW = round(W); | ^~~~~ main.c:3:1: note: include '<math.h>' or provide a declaration of 'round' 2 | #include <stdlib.h> +++ |+#include <math.h> 3 | int mai...
s147702049
p03972
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cstring> using namespace std; #define rep(l,n) for(int l = 0; l < (n); l++) #define rep2(i,k,n) for(int i = (k); i < (n); i++) inline void readInt2(int *a, int *b) { int c, p = 0; char s[20] = ""; for(int i = 0; (c = getchar())...
a.cc: In function 'void uf_init(int)': a.cc:73:31: error: reference to 'rank' is ambiguous 73 | rep(i,n+1) { parent[i] = i; rank[i] = 0; } | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, ...
s672601770
p03972
C++
#include <iostream> #include <vector> #include <iterator> using namespace std; #define MAX 100000 int W,H; int numW=0,numH=0; int result=0; int p[100000],q[100000]; bool pairCompare(const std::pair<float, int>& firstElem, const std::pair<float, int>& secondElem) { return firstElem.second < secondElem.second; } in...
a.cc: In function 'int main()': a.cc:30:3: error: 'sort' was not declared in this scope; did you mean 'short'? 30 | sort(begin(pq), end(pq), pairCompare); | ^~~~ | short
s153097498
p03972
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a) ;i < (b) ;i++) #define repr(i, a, b) for (int i = (b) - 1 ;i >= a ;i--) int main(){ int w, h, p[100000], q[100000] ; cin >> w >> h ; rep(i, 0, w)cin>>p[i] ; rep(j, 0, h)cin>>q[j] ; long ans = 0, added = 0 ; sort(q,q+h,greater<...
a.cc: In function 'int main()': a.cc:15:20: error: 'j' was not declared in this scope 15 | int i = 0 ;j = 0 ; | ^