submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s549801011 | p01809 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd ( ll a, ll b ){
ll c;
while ( a != 0 ) {
c = a; a = b%a; b = c;
}
return b;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll p,q;
cin >>p>>q;
ll g=gcd(p,q);
ll res=q/g;
// if(res==1) res=10;
cout << max(... | a.cc: In function 'int main()':
a.cc:23:14: error: no matching function for call to 'max(ll&, int)'
23 | cout << max(res,2) <<endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from... |
s072978438 | p01809 | C++ | #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;
#define repl(i,a,b) for(i... | a.cc: In function 'int main()':
a.cc:33:10: error: expected primary-expression at end of input
33 | int g =
| ^
a.cc:33:10: error: expected '}' at end of input
a.cc:30:11: note: to match this '{'
30 | int main(){
| ^
|
s857815657 | p01809 | C++ | #include<iostream>
#include<vector>
using namespace std;
int gcd(int a, int b){
if(b==0) return a;
else return gcd(b, a%b);
}
int main(){
int p, q;
cin>> p>> q;
q=q/gcd(p, q);
vector<int> v;
for(int i=2; i*<=q; i++){
if(q%i==0){
v.push_back(i);
while(q%i=... | a.cc: In function 'int main()':
a.cc:18:20: error: expected primary-expression before '<=' token
18 | for(int i=2; i*<=q; i++){
| ^~
|
s656579592 | p01809 | C++ | #include <bits/stdc++.h>??
using namespace std;??
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define... | a.cc:1:25: warning: extra tokens at end of #include directive
1 | #include <bits/stdc++.h>??
| ^
a.cc:3:21: error: expected unqualified-id before '?' token
3 | using namespace std;??
| ^
a.cc: In function 'void pri()':
a.cc:42:1: error: 'prime' was not dec... |
s948685404 | p01809 | C++ | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp... | a.cc: In function 'int main()':
a.cc:63:14: error: 'class std::vector<long long int>' has no member named 'length'
63 | rep(i, prime.length()) {
| ^~~~~~
a.cc:9:39: note: in definition of macro 'rep'
9 | #define rep(i, N) for (int i = 0; i < N; i++)
| ... |
s165549138 | p01809 | C++ | #include<iostream>
using namespace std:
int main(){
int p, q;
cin >> p >> q;
cout << q/__gcd(p, q) << endl;
} | a.cc:2:20: error: expected ';' before ':' token
2 | using namespace std:
| ^
| ;
a.cc:2:20: error: expected unqualified-id before ':' token
|
s608501408 | p01809 | C++ | #include<iostream>
using namespace std:
int main(){
int p, q;
cin >> p >> q;
cout << q/__gcd(p, q) << endl;
} | a.cc:2:20: error: expected ';' before ':' token
2 | using namespace std:
| ^
| ;
a.cc:2:20: error: expected unqualified-id before ':' token
|
s078488398 | p01809 | C++ | #include<iostream>
using namespace std;
int main(){
int p, q;
cin >> p >> q;
cout << q/__gcd(p, q) << endl;
} | a.cc: In function 'int main()':
a.cc:7:11: error: '__gcd' was not declared in this scope
7 | cout << q/__gcd(p, q) << endl;
| ^~~~~
|
s001791720 | p01809 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long p,q;
cin >> p >> q;
int va=q;
int ans=0;
for(long long i=2;i*i<=va;i++){
if(ans!=0)
break;
if(q%i==0){
ans=-1;
while(q%i==0){
q/=i;
//cout << q << endl;
}
if(q==1)
ans=i;
... | a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s251485648 | p01809 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long p,q;
cin >> p >> q;
int va=q;
int ans=0;
for(long long i=2;i*i<=va;i++){
if(ans!=0)
break;
if(q%i==0){
ans=-1;
while(q%i==0){
q/=i;
//cout << q << endl;
}
if(q==1)
ans=i;
... | a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s188781759 | p01809 | C++ | import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p //= g
q //= g
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s503786825 | p01809 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<i... | a.cc:18:12: error: '__int64' does not name a type; did you mean '__int64_t'?
18 | #define ll __int64
| ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
19 | ll p,q;
| ^~
a.cc: In function 'int main()':
a.cc:21:6: error: 'p' was not declared in this scope
21 | cin>>p>>q;
| ^... |
s501940415 | p01809 | C++ | import math
p = int(input())
q = int(input())
print(q/(math.gcd(p,q)))
| a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s633949808 | p01810 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,i,j,m[1e8]={0},c=0;
cin>>a>>b;
for(i=0;i<a;i++){
while(m[c])c++;
for(j=c;j<1e8;j+=b){
if(i==a-1){
cout<<j<<endl;
break;
}
m[j]++;
}
}
} | a.cc: In function 'int main()':
a.cc:4:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
4 | int a,b,i,j,m[1e8]={0},c=0;
| ^~~
a.cc:4:17: error: could not convert '1.0e+8' from 'double' to 'long unsigned int'
4 | int a,b,i,j,m[1e8]={0},c=0;
... |
s488914968 | p01810 | C++ | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);} | a.cc:1:13: error: 'n' does not name a type
1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);}
| ^
a.cc:1:19: error: expected constructor, destructor, or type conversion before '(' token
1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1... |
s856346990 | p01810 | C++ | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);} | a.cc:1:13: error: 'n' does not name a type
1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);}
| ^
a.cc:1:19: error: expected constructor, destructor, or type conversion before '(' token
1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1... |
s650097880 | p01810 | C++ |
using namespace std;
int main() {
int N, k;
scanf("%d %d", &N, &k);
int ans;
if (N <= k) {
ans = N-1;
} else {
ans = 0;
for (int i=0;i<N;i++) {
ans++;
for (int j=1;j<ans;j++) {
if (j%k == 0) ans++;
}
}
ans--;
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'scanf' was not declared in this scope
6 | scanf("%d %d", &N, &k);
| ^~~~~
a.cc:20:3: error: 'printf' was not declared in this scope
20 | printf("%d\n", ans);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably f... |
s019053040 | p01811 | Java | package aoj.volume27.jags2015;
import com.sun.org.apache.regexp.internal.RE;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import static java.lang.Integer.parseInt;
/**
* ABC Gene
*/
public class Main {
static fi... | Main.java:3: error: package com.sun.org.apache.regexp.internal does not exist
import com.sun.org.apache.regexp.internal.RE;
^
1 error
|
s063487149 | p01811 | Java | import com.sun.org.apache.regexp.internal.RE;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import static java.lang.Integer.parseInt;
/**
* ABC Gene
*/
public class Main {
static final String TARGET = "ABC";
stat... | Main.java:1: error: package com.sun.org.apache.regexp.internal does not exist
import com.sun.org.apache.regexp.internal.RE;
^
1 error
|
s384273749 | p01811 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <utility>
using namespace std;
string s, S;
string op;
int main(void)
{
cin >> s;
S = s;
while(1){
string t; char c;
if(s == "ABC"){
break;
}
if(s.size() < 3){
cout << "No" << endl;
return 0;
}
bool head... | a.cc: In function 'int main()':
a.cc:47:3: error: 'reverse' was not declared in this scope
47 | reverse(op.begin(), op.end());
| ^~~~~~~
|
s511396233 | p01811 | C++ | #include<iostream>
#include<fstream>
#include<string>
#define fin cin
using std::cin;
using std::cout;
using std::endl;
std::string in{""};
int main()
{
//std::ifstream fin("in.txt");
fin >> in;
if(in.size < 3){
cout << "No" << endl;
return 0;
}
int i = -1;
while(true)
{
i++;
// cout << i << " " <<... | a.cc: In function 'int main()':
a.cc:18:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s101246544 | p01811 | C++ | /*
* abc_gene.cpp
*
* Created on: 2017/03/10
* Author: Nishio
*/
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=n;i<N;i++)
#define p(S) cout<<(S)<<endl
using namespace std;
string abcgene(string anss){
string c;
string s=anss;
bool flag=true;
while(1){
if(s=="ABC") return "Yes";
if(flag||s.si... | a.cc: In function 'std::string abcgene(std::string)':
a.cc:25:32: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
25 | if(s[i]==c) exist++;
In file ... |
s306434736 | p01811 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
using namespace std;
bool dfs(string s){
if(s == "ABC") return true;
else if(s.find("ABC") == stri... | a.cc: In function 'bool dfs(std::string)':
a.cc:20:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
20 | cnt++;
| ^~~
| int
|
s030504993 | p01811 | C++ | #include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define RREP(i, a, n) for(int i=n-1; i>=a; i--)
#define INF 100000000
#define ll long long
queue<string> str;
int main()
{
string S;
vector<str... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s930265120 | p01811 | C++ | #include <iostream>
#include <string>
using namespace std;
//x -> "ABC"
string operate(string &s, char x) {
string t;
for (int i = 0; i < s.length(); i++) {
if (s[i] == x) { t += "ABC"; }
else { t += s[i]; }
}
return t;
}
//"ABC" -> x
string inverse(string &s, char x) {
string t;
for (int i = 0; i < s.lengt... | a.cc: In function 'int main()':
a.cc:50:44: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
50 | if (operate(inverse(s, x), x) == s) {
| ... |
s932919583 | p01811 | C++ | #include <iostream>
#include <string>
using namespace std;
//x -> "ABC"
string operate(string &s, char x) {
string t;
for (int i = 0; i < s.length(); i++) {
if (s[i] == x) { t += "ABC"; }
else { t += s[i]; }
}
return t;
}
//"ABC" -> x
string inverse(string &s, char x) {
string t;
for (int i = 0; i < s.lengt... | a.cc: In function 'int main()':
a.cc:50:44: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
50 | if (operate(inverse(s, x), x) == s) {
| ... |
s323437674 | p01811 | C++ | #include<iostream>
#include<string>
using namespace std;
bool t[5010];
bool DFS(string s){
if(s=="ABC")return true;memset(t,0,s.size());
for(int i=0;i<s.size()-2;i++)t[i]=(s.substr(i,3)=="ABC");
string x[3]={"","",""};
for(int i=0;i<s.size();i++){
bool ok=t[i];
if(i)ok|=t[i-1];
if(i>1)ok|=t[i-2];
for(int j=... | a.cc: In function 'bool DFS(std::string)':
a.cc:6:33: error: 'memset' was not declared in this scope
6 | if(s=="ABC")return true;memset(t,0,s.size());
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstri... |
s788138226 | p01811 | C++ | #include<bits/stdc++.h>
using namespace std;
#define INF 1000000000
int main(){
//??\???
string s; cin >> s;
if(s == "AABCCABCCABCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCA... | a.cc:9:13: warning: missing terminating " character
9 | if(s == "AABCCABCCABCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCABCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCAABCCABCCABCCABCCCAABCCABCCABCCAABCCABCCABCCABCCAABCCABCCABCCAAB... |
s248107816 | p01811 | C++ | using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
class hawawa
{
static Printer sw = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };
static void Main()
{
Console.SetOut(sw);
solve();
Console.Out.Flush()... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.G... |
s009780105 | p01811 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
bool isOK(string, char);
bool isOK(string);
int main() {
string str;
bool ans;
cin >> str;
ans = isOK(str,'A') || isOK(str,'B') || isOK(str,'C');
if( ans ) cout << "Yes\n";
else cout << "No\n";
return 0;
}
bool isO... | a.cc: In function 'bool isOK(std::string)':
a.cc:34:21: error: 'count' was not declared in this scope
34 | count++;
| ^~~~~
a.cc:36:21: error: 'check' was not declared in this scope
36 | check.push_back(i-2);
| ^~~~~
a.cc:... |
s434872948 | p01811 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s;
int cnt[3];
bool ok(string s,int a, int b, int c){
if(s == "ABC")return true;
string nxt;
char to;
int abc;
if(a < b && a < c)to = 'A', abc=a,b-=a,c-=a;
else if(b < a && b < c)to = 'B', abc=b,a-=b, c-=b;
else if(c < a && c < ... | a.cc: In function 'bool ok(std::string, int, int, int)':
a.cc:22:25: error: 'acb' was not declared in this scope; did you mean 'abc'?
22 | acb--;
| ^~~
| abc
|
s144204049 | p01811 | C++ | def f(s)
return s == 'ABC' if s.size <= 3
x = s.gsub('ABC', 'X')
return false if x !~ /X/
a = %w(A B C)
a.delete(?A) if x =~ /A/
a.delete(?B) if x =~ /B/
a.delete(?C) if x =~ /C/
return a.any? {|c| f(x.gsub(?X, c))}
end
s = gets.chomp
puts f(s) ? 'Yes' : 'No'
| a.cc:2:17: warning: multi-character character constant [-Wmultichar]
2 | return s == 'ABC' if s.size <= 3
| ^~~~~
a.cc:3:16: warning: multi-character character constant [-Wmultichar]
3 | x = s.gsub('ABC', 'X')
| ^~~~~
a.cc:13:13: warning: multi-character charac... |
s540082335 | p01812 | Java | import java.util.LinkedList;
import java.util.Queue;
public class ICPC {
private static void solve() {
int n = nei();
int m = nei();
int k = nei();
int[] ds = nis(m);
int[][] vs = nis2(n, k);
for (int i = 0; i < m; i++) {
ds[i]--;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < k; j++) {
... | Main.java:4: error: class ICPC is public, should be declared in a file named ICPC.java
public class ICPC {
^
Main.java:83: error: cannot find symbol
IO.out(val);
^
symbol: variable IO
location: class ICPC
Main.java:87: error: cannot find symbol
IO.out(String.valueOf(val));
^
symbol: variable IO... |
s922146045 | p01812 | C++ |
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <bits/stdc++.h>
using namespace std;
#define INF (1<<29)
int main()
{
int N, M, K;
cin >> N >> M >> K;
vector<int> D(M), dm(N, -1);
for (int i = 0; i < M; i++) {
cin >> D[i]; D[i]--;
dm[D[i]] = 1<<i;
}
vector<vect... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 41
| ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:15:
/us... |
s419459280 | p01812 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
int main()
{
int N, M, K, D[16], A[100][100];
int black[100];
memset(black, -1, sizeof(black);
cin >> N >> M >> K;
for(int i = 0; i < M; i++) {
cin >> D[i];
black[--D[i]] = i;
}
for(int i = 0; i < N; i++) {
for(int j = ... | a.cc: In function 'int main()':
a.cc:11:34: error: expected ')' before ';' token
11 | memset(black, -1, sizeof(black);
| ~ ^
| )
|
s885689602 | p01812 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
int main()
{
int N, M, K, D[16], A[100][100];
int black[100];
memset(black, -1, sizeof(black);
cin >> N >> M >> K;
for(int i = 0; i < M; i++) {
cin >> D[i];
black[--D[i]] = i;
}
for(int i = 0; i < N; i++) {
for(int j = ... | a.cc: In function 'int main()':
a.cc:11:34: error: expected ')' before ';' token
11 | memset(black, -1, sizeof(black);
| ~ ^
| )
|
s216335914 | p01812 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,k,i,j,l,a,b,e,inf=1<<28;
cin>>n>>m>>k;
int dp[1<<m],d[n];
map<int,int> r;
vector<int> G[n][k];
for(b=0;b<(1<<m);b++) dp[b]=inf;
for(i=0;i<m;i++) cin>>d[i],r[d[i]-1]=i;
for(i=0;i<n;i++)
for(j=0;j<k;j++)
cin>>e,G[e-1][j].push_back(... | a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s714001749 | p01812 | C++ | #vreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee... | a.cc:1:2: error: invalid preprocessing directive #vreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee... |
s831516689 | p01814 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c+... | a.cc: In function 'bool issame(int, int, int, int)':
a.cc:116:31: error: 'l3' was not declared in this scope; did you mean 'l1'?
116 | return getha(l3, r3) == getha(l4, r4);
| ^~
| l1
a.cc:116:35: error: 'r3' was not declared in ... |
s810083858 | p01814 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c+... | a.cc: In function 'std::pair<bool, int> issame(std::pair<int, int>, std::pair<int, int>)':
a.cc:109:24: error: could not convert 'true' from 'bool' to 'std::pair<bool, int>'
109 | return true;
| ^~~~
| |
| bool
a.cc... |
s550662543 | p01814 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c+... | a.cc: In function 'std::pair<bool, int> issame(int, int, int)':
a.cc:114:35: error: 'a' was not declared in this scope; did you mean 'al'?
114 | bool same= getha(a.first,a.first+ checklen) == getha(b.first,b.first+ checklen);
| ^
| ... |
s717352086 | p01814 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long int;
using ha = pair<ll, ll>;
struct RollingHash {
static const ll mul0 = 10009, mul1 = 10007;
static const ll add0 = 1000010007, add1 = 1003333331;
size_t len;
vector<ha>hash_;
static vector<ha>pmo_;
void init(const vector<ll>& s) {
len = s.siz... | a.cc: In function 'int main()':
a.cc:167:68: error: 'rsame' was not declared in this scope; did you mean 'lsame'?
167 | if (lsame&&rsame)assert(false);
| ^~~~~
| ... |
s397041181 | p01814 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long int;
using ha = pair<ll, ll>;
struct RollingHash {
static const ll mul0 = 10009, mul1 = 10007;
static const ll add0 = 1000010007, add1 = 1003333331;
size_t len;
vector<ha>hash_;
static vector<ha>pmo_;
void init(const vector<ll>& s) {
len = s.siz... | a.cc: In function 'int main()':
a.cc:167:57: error: 'else' without a previous 'if'
167 | else if (lsame) {
| ^~~~
|
s253374744 | p01814 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long int;
using ha = pair<ll, ll>;
struct RollingHash {
static const ll mul0 = 100009, mul1 = 1000007;
static const ll add0 = 10000120007, add1 = 10032333331;
size_t len;
vector<ha>hash_;
static vector<ha>pmo_;
void init(const vector<ll>& s) {
len = ... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:216:28: error: 'anss' was not declared in this scope
216 | assert(ok==anss[num]);
| ... |
s140281370 | p01814 | C++ | #include<bits/stdc++.h>
using namespace std;
using Int = long long;
struct SuffixArray{
Int n,k;
string S;
vector<Int> sa,lcp,r2;
SuffixArray(){}
SuffixArray(string& S):S(S){init();}
void init(){
n=S.length();
S.push_back('$');
build_sa();
build_lcp();
build_rmq();
//for(Int i=0;i<=... | a.cc: In member function 'Int SuffixArray::RMQ::query(Int, Int)':
a.cc:133:23: error: no matching function for call to 'max(Int&, int)'
133 | return query(max(a,0),b,0,0,n);
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linu... |
s691242175 | p01815 | C++ | #include<bits/stdc++.h>
#define MAX_V 100000
using namespace std;
typedef pair<int,int> P;
int n,m,w[100001];
vector<int> v[100001],v1[100001];
unodered_set<P> st;
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
void DFS(int p){
for(int i=0;i<v[p].size();i++){
... | a.cc:7:1: error: 'unodered_set' does not name a type
7 | unodered_set<P> st;
| ^~~~~~~~~~~~
a.cc: In function 'void DFS(int)':
a.cc:18:8: error: 'st' was not declared in this scope; did you mean 'std'?
18 | if(st.find(pp)==st.end()){
| ^~
| std
|
s028186727 | p01815 | C++ | #include<bits/stdc++.h>
#define MAX_V 100000
using namespace std;
int n,m,w[100001];
vector<int> v[100001],v1[100001];
unodered_set<int> st[100001];
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
void DFS(int p){
for(int i=0;i<v[p].size();i++){
int mn=min(v[... | a.cc:6:1: error: 'unodered_set' does not name a type
6 | unodered_set<int> st[100001];
| ^~~~~~~~~~~~
a.cc: In function 'void DFS(int)':
a.cc:17:8: error: 'st' was not declared in this scope; did you mean 'std'?
17 | if(st[mn].find(mx)==st.end()){
| ^~
| std
|
s637476647 | p01815 | C++ | #include<bits/stdc++.h>
#define MAX_V 100000
using namespace std;
int n,m,w[100001];
vector<int> v[100001],v1[100001];
unodered_set<int> st[100001];
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
void DFS(int p){
for(int i=0;i<v[p].size();i++){
int mn=min(v[... | a.cc:6:1: error: 'unodered_set' does not name a type
6 | unodered_set<int> st[100001];
| ^~~~~~~~~~~~
a.cc: In function 'void DFS(int)':
a.cc:17:8: error: 'st' was not declared in this scope; did you mean 'std'?
17 | if(st[mn].find(mx)==st.end()){
| ^~
| std
|
s877541324 | p01815 | C++ | #include<bits/stdc++.h>
#define MAX_V 100000
using namespace std;
int n,m,w[100001];
vector<int> v[100001],v1[100001];
unodered_set<int> st[100001];
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
void DFS(int p){
for(int i=0;i<v[p].size();i++){
int mn=min(v[... | a.cc:6:1: error: 'unodered_set' does not name a type
6 | unodered_set<int> st[100001];
| ^~~~~~~~~~~~
a.cc: In function 'void DFS(int)':
a.cc:17:8: error: 'st' was not declared in this scope; did you mean 'std'?
17 | if(st[mn].find(mx)==st[mn].end()){
| ^~
| std
|
s432578331 | p01815 | C++ | #include<bits/stdc++.h>
using namespace std;
struct Edge{
int src,dst;
Edge(int src,int dst):
src(src),dst(dst){}
};
using Edges=vector<Edge>;
using Graph=vector<Edges>;
int memo[100001];
pair<vector<int>, Edges> bridge(const Graph& g) {
const int n = g.size();
int idx = 0, s = 0, t = 0, k = 0;
vect... | a.cc:64:47: error: 'Weight' was not declared in this scope
64 | vector<int>&elements,vector<int>&cycle,vector<Weight>&node){
| ^~~~~~
a.cc:64:53: error: template argument 1 is invalid
64 | vector<int>&elements,vector<int>&cycle,vector<Weight>&node){
| ... |
s793044953 | p01815 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <map>
using namespace std;
using pii = pair<ll, ll>;
struct Graph {
Graph(const ll n)
{
edge.resize(n);
revedge.resize(n);
}
void addEdge(const ll from, const ll to)
{
edge[from].push_back(to);
revedge[to]... | a.cc:6:18: error: 'll' was not declared in this scope
6 | using pii = pair<ll, ll>;
| ^~
a.cc:6:22: error: 'll' was not declared in this scope
6 | using pii = pair<ll, ll>;
| ^~
a.cc:6:24: error: template argument 1 is invalid
6 | using pii = pair<ll, ll>;
... |
s872599459 | p01815 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int M = 1000000007;
vector<vector<int>> edge;
vector<set<int>> nedge;
vector<int> uid, uuid;
vector<int> vis;
vector<int> viscnt;
vector<int> cnts;
vector<int> nw;
bool dfs(int now, int par, int s) {
vis[now] = s;
bool ret = false;
... | a.cc: In function 'bool dfs(int, int)':
a.cc:34:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
34 | bool ret = cnt[now] > 1;
| ^~~
| int
|
s659942633 | p01819 | C | #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
long long num[6000]={};
int main(){
//freopen("main.in","r",stdin);
int t; cin >> t;
while(t--){
long long x;
cin >> x;
int ans = lower_bound(num+1,num+5194+1,x) - num;
cout << num[ans] << endl;
}
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s254283865 | p01819 | C | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
int n,m;
cin>>n>>m;
vector<vector<int>>d(m,vector<int>(n));
int ans=0;
for(int i=0;i<m;++i){
for(int j=0;j<n;++j){
char c;
scanf("%c",&c);
if(c=='W'){
d[i][j]=... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s457941611 | p01819 | C++ | k | a.cc:1:1: error: 'k' does not name a type
1 | k
| ^
|
s854606215 | p01825 | C++ | include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#define cl(x) memset(x,0,sizeof(x))
#define read(x) scanf("%d",&(x));
using namespace std;
inline double sqr(int x){ return x*x; }
const int N=305;
struct PP{
int x,y;
friend double dist(PP A,PP B){
return sqrt(sqr(A.x... | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdio>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s518392421 | p01825 | C++ | template<class D>
struct Hungarian {
V<D> le, ri;
V<int> perm;
Hungarian(const VV<D> &c) {
int n = int(c.size()), m = int(c[0].size());
assert(n <= m);
le = V<D>(n, D(0)); ri = V<D>(m, D(0));
perm = V<int>(n);
V<int> to_r(n, -1), to_l(m, -1);
for (int s = 0;... | a.cc:3:5: error: 'V' does not name a type
3 | V<D> le, ri;
| ^
a.cc:4:5: error: 'V' does not name a type
4 | V<int> perm;
| ^
a.cc:6:21: error: 'VV' does not name a type
6 | Hungarian(const VV<D> &c) {
| ^~
a.cc:6:23: error: expected ',' or '...' bef... |
s695830490 | p01825 | C++ | template<class D>
struct Hungarian {
V<D> le, ri;
V<int> perm;
Hungarian(const VV<D> &c) {
int n = int(c.size()), m = int(c[0].size());
assert(n <= m);
le = V<D>(n, D(0)); ri = V<D>(m, D(0));
perm = V<int>(n);
V<int> to_r(n, -1), to_l(m, -1);
for (int s = 0;... | a.cc:3:5: error: 'V' does not name a type
3 | V<D> le, ri;
| ^
a.cc:4:5: error: 'V' does not name a type
4 | V<int> perm;
| ^
a.cc:6:21: error: 'VV' does not name a type
6 | Hungarian(const VV<D> &c) {
| ^~
a.cc:6:23: error: expected ',' or '...' bef... |
s605304549 | p01825 | C++ | template<class D>
struct Hungarian {
V<D> le, ri;
V<int> perm;
Hungarian(const VV<D> &c) {
int n = int(c.size()), m = int(c[0].size());
assert(n <= m);
le = V<D>(n, D(0)); ri = V<D>(m, D(0));
perm = V<int>(n);
V<int> to_r(n, -1), to_l(m, -1);
for (int s = 0;... | a.cc:3:5: error: 'V' does not name a type
3 | V<D> le, ri;
| ^
a.cc:4:5: error: 'V' does not name a type
4 | V<int> perm;
| ^
a.cc:6:21: error: 'VV' does not name a type
6 | Hungarian(const VV<D> &c) {
| ^~
a.cc:6:23: error: expected ',' or '...' bef... |
s196274420 | p01826 | C++ | #include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<__int128,__int128> P;
struct data{
int t;
ll p,f;
data(){}
data(int tt,ll pp,ll ff){
t=tt;
p=pp;
f=ff;
}
bool operator<(const data &d)const{
if(d==d.f)return p<d.p;
return f<d.f;
}
};
struct CHT... | a.cc: In member function 'bool data::operator<(const data&) const':
a.cc:18:21: error: no match for 'operator==' (operand types are 'const data' and 'const ll' {aka 'const long long int'})
18 | if(d==d.f)return p<d.p;
| ~^~~~~
| | |
| ... |
s164200137 | p01826 | C++ | #include<iostream>
using namespace std;
int n,m,v[4001],w[4001],u[4001],dp[4001][4001]={0},f;
int main()
{
int i,j;
cin>>n>>m;
for(i=1;i<=n;i++)
cin>>w[i]>>v[i]>>u[i];
for(i=1;i<=n;i++)
u[i]=u[i]*u[i];
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
if(j>=w[i])
if... | a.cc: In function 'int main()':
a.cc:15:42: error: invalid types 'int[int]' for array subscript
15 | if(dp[i-1][j-w[i]]+v[i]-f[i-1][j-w[i]]>dp[i-1][j])
| ^
a.cc:16:52: error: invalid types 'int[int]' for array subscript
16 | dp[i][... |
s091878719 | p01827 | C++ | #include<bits/stdc++.h>
using namespace std;
constexpr long long INF64 = 1e18;
using Weight=long long;
struct Edge{
int src,dst;
Edge(int src,int dst):
src(src),dst(dst){}
};
using Edges=vector<Edge>;
using Graph=vector<Edges>;
vector<int> tarjan(const Graph& g) {
int n = g.size(), idx = 0, k = 0, s ... | a.cc: In function 'int main()':
a.cc:109:50: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
109 | if(es.size()>=1)dfs(ng,es[0].src,memo);
| ^~~~
a.cc:51:43: note: in pass... |
s350912831 | p01827 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
using namespace std;
typedef pair<int, int> pii;
int main(){
int n, m;
std::cin >> n;
vector<pii> c(n);
vector<int> ans(n, 1), maxi(n, 1), id(n);
vector<bool> used(n, false);
for (int i = 0; i < n; i++){
std::cin >> c[i].first;
... | a.cc: In function 'int main()':
a.cc:47:40: error: request for member 'first' in 'id.std::vector<int>::operator[](((std::vector<int>::size_type)to))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
47 | c[id[to]].first = max(c[id[to].first], c[i].firs... |
s585757886 | p01827 | C++ | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | In file included from /usr/include/c++/14/bits/refwrap.h:39,
from /usr/include/c++/14/deque:67,
from /usr/include/c++/14/stack:62,
from a.cc:5:
/usr/include/c++/14/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp... |
s883984255 | p01828 | C++ | #include <string>
#include <iostream>
using namespace std;
bool chk(string a,string b,int s){
int i;
string buf=b;
char tg;
for(i=s;i<a.size();i+=2){
tg=a[i];
auto idx=find(buf.begin(),buf.end(),tg);
if(idx!=buf.end()){
*idx='.';
}
else{
re... | a.cc: In function 'bool chk(std::string, std::string, int)':
a.cc:10:22: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char&)'
10 | auto idx=find(buf.begin(),buf.end(),tg);
| ~~~~^~~~~~~~~~~~~~~~~~~... |
s914583106 | p01828 | C++ | #include <iostream>
#include <string>
using namespace std;
bool chk(string a,string b,int s){
int i;
char buf;
for(i=s;i<a.size();i+=2){
buf=a[i];
auto idx=find(b.begin(),b.end(),buf);
if((*idx)==buf){
*idx='.';
}
else{
return false;
}
... | a.cc: In function 'bool chk(std::string, std::string, int)':
a.cc:9:22: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char&)'
9 | auto idx=find(b.begin(),b.end(),buf);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~... |
s167654607 | p01828 | C++ | #!/usr/bin/env python
import sys
import math
import itertools as it
from collections import deque
sys.setrecursionlimit(10000000)
S_ = raw_input()
T_ = raw_input() + " "
S1 = S2 = ''
for i in range(len(S_)):
if i % 2 == 0:
S1 += S_[i]
else:
S2 += S_[i]
for S in [S1, S2]:
T = T_
for ... | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python
| ^
a.cc:13:11: error: empty character constant
13 | S1 = S2 = ''
| ^~
a.cc:3:1: error: 'import' does not name a type
3 | import sys
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodule... |
s567494225 | p01828 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<i... | a.cc:29:17: error: empty character constant
29 | rep(l,1000)t[l]='';
| ^~
|
s306677212 | p01828 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<i... | a.cc: In function 'int main()':
a.cc:44:15: error: 'asj' was not declared in this scope; did you mean 'as'?
44 | if(i>=asj>=bs)break;
| ^~~
| as
|
s428348163 | p01829 | C++ | #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <func... | a.cc: In function 'int main()':
a.cc:80:20: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
80 | n = atoi(s.c_str);
| ... |
s084963609 | p01829 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
string h,q;
int n,x,ans=0,used[10],w,y;
void dfs(int d,string l){
if(l==h)return;
if(d==h.size()){
int p,pp;
stringstream ss(l);
ss>>p;
pp=min(abs(n-p),(int)pow(10,w)-abs(n-p));
if(pp>ans){
ans=pp;
q=l;
}
}
el... | cc1plus: error: '::main' must return 'int'
|
s935496306 | p01829 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#define inf 1e12
typedef long long ll;
using namespace std;
ll mini = inf;
string s;
ll x;
string ans;
void perm(string t, int bit, int node, int d) {
if (node == d) {
ll b = stoll(t);
ll p = abs(x-b);
... | a.cc: In function 'void perm(std::string, int, int, int)':
a.cc:19:24: error: 'pow' was not declared in this scope
19 | ll q = abs((ll)pow(10,d)-p);
| ^~~
|
s868274463 | p01831 | C | char s[99999];N,l;main(r){for(scanf("%d%s",&N,s);s[l]=='<';l++);for(r=N;s[--r]=='>';);N=!printf("%d\n",N-l>r+1:N-l:r+1);} | main.c:1:15: warning: data definition has no type or storage class
1 | char s[99999];N,l;main(r){for(scanf("%d%s",&N,s);s[l]=='<';l++);for(r=N;s[--r]=='>';);N=!printf("%d\n",N-l>r+1:N-l:r+1);}
| ^
main.c:1:15: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:17: erro... |
s911972474 | p01831 | C | char s[1e6];p,q;main(n){for(scanf("%d%s",&n,&s);p<n&&s[p]==60;)p++;for(;q<n&&s[q]==62;)q++;printf("%d\n",n-p<q?p:q);} | main.c:1:6: error: size of array 's' has non-integer type
1 | char s[1e6];p,q;main(n){for(scanf("%d%s",&n,&s);p<n&&s[p]==60;)p++;for(;q<n&&s[q]==62;)q++;printf("%d\n",n-p<q?p:q);}
| ^
main.c:1:13: warning: data definition has no type or storage class
1 | char s[1e6];p,q;main(n){for(scanf("%d%s",&n,&s... |
s780768005 | p01832 | C++ | #include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,NAME,...) NAME
#define pr(...) GET_MACRO(__VA_ARGS__,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)
#define pr1(a) (#a)<<"="<<(a)
#define pr2(a,b) pr1(a)<<", "<<pr1(b)
#define pr3(a,b,c) pr2(a,b)<<", "<<pr1(c)
#define pr4(a,b,c,d) pr3(a,b,c)<<", "<<pr1(d)
#define pr5(a,b,c,d... | a.cc: In function 'int main()':
a.cc:130:28: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'})
130 | for(int i=0... |
s421809122 | p01835 | C++ | // clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)... | a.cc: In function 'int main()':
a.cc:91:42: error: no matching function for call to 'RangeActionSegTree<donutMonoid>::RangeActionSegTree(long long int&, int)'
91 | RangeActionSegTree<donutMonoid> st(n, 0);
| ^
a.cc:56:36: note: candidate: 'template<class InputIterator... |
s904530494 | p01839 | Java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
public class Main{
static PrintWriter out;
static InputReader ir;
static void solve(){
int cnt=0;
int n=ir.nextInt();
if(n%2==1)
out.printl... | Main.java:22: error: cannot find symbol
cnnt--;
^
symbol: variable cnnt
location: class Main
1 error
|
s788686479 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&sum!=0&&un=1){
sum=sum-1;
un=0;
}
else if(c!="n")un=0;
else if(sum==0){
if(sum=="A"){
sum=sum++;
}
}
else if(sum!=0){
if(sum=="A"){
sum=sum++;
}
if(sum=="U"){
un=1;
}
}
}
if(s... | main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&sum!=0&&un=1){
| ^~
main.c:5:38: error: lvalue required as left operand of assignment
5 | if(c=="n"&&sum!=0&&un=1){
| ... |
s951916205 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&sum!=0&&un=1){
sum=sum-1;
un=0;
}
else if(c!="n")un=0;
else if(sum==0){
if(sum=="A"){
sum=sum++;
}
}
else if(sum!=0){
if(sum=="A"){
sum=sum++;
}
if(sum=="U"){
un=1;
}
}
}
if(s... | main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&sum!=0&&un=1){
| ^~
main.c:5:38: error: lvalue required as left operand of assignment
5 | if(c=="n"&&sum!=0&&un=1){
| ... |
s160921229 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum!=0)sum=sum-1;
un=0;
}
else if(c!="n")un=0;
else if(sum==0&&sum=="A"){
sum=sum++;
}
else if(sum!=0&&sum=="A"){
sum=sum++;
if(sum=="U"){
un=1;
}
}
}
if(sum==0)puts("YES");
else... | main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&un=1){
| ^~
main.c:5:30: error: lvalue required as left operand of assignment
5 | if(c=="n"&&un=1){
| ^
main.c:9:26... |
s789934902 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum!=0)sum=sum-1;
un=0;
}
else if(c!="n")un=0;
else if(sum==0&&sum=="A"){
sum=sum++;
}
else if(sum!=0&&sum=="A"){
sum=sum++;
if(c=="U"){
un=1;
}
}
}
if(sum==0)puts("YES");
else p... | main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&un=1){
| ^~
main.c:5:30: error: lvalue required as left operand of assignment
5 | if(c=="n"&&un=1){
| ^
main.c:9:26... |
s595502480 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum>0)sum=sum-1;
un=0;
}
else if(c!="n")un=0;
if(sum>=0&&c=="A"){
sum=sum++;
}
else if(c=="U"){
un=1;
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
| main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&un=1){
| ^~
main.c:5:30: error: lvalue required as left operand of assignment
5 | if(c=="n"&&un=1){
| ^
main.c:9:26... |
s566240144 | p01839 | C | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum>0){
sum=sum-1;
un=0;
}
}
if(c!="n")un=0;
if(sum>=0&&c=="A"){
sum=sum++;
}
else if(c=="U"){
un=1;
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
| main.c: In function 'main':
main.c:5:21: warning: comparison between pointer and integer
5 | if(c=="n"&&un=1){
| ^~
main.c:5:30: error: lvalue required as left operand of assignment
5 | if(c=="n"&&un=1){
| ^
main.c:11:2... |
s475010476 | p01839 | C | #include <stdio.h>
int main()
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum>0){
sum=sum-1;
un=0;
}
}
if(c!="n")un=0;
if(sum>=0&&c=="A"){
sum=sum++;
}
else if(c=="U"){
un=1;
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
| main.c: In function 'main':
main.c:4:9: error: parameter 'sum' is initialized
4 | int c,sum=0,un=0;
| ^~~
main.c:4:9: error: parameter 'un' is initialized
main.c:5:9: error: expected declaration specifiers before 'while'
5 | while((c=getchar())!=EOF){
| ^~~~~
main.c:2... |
s728460157 | p01839 | C | #include <stdio.h>
int main()
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=='n'&&un=1){
if(sum>0){
sum=sum-1;
un=0;
}
}
if(c!='n')un=0;
if(sum>=0&&c=='A'){
sum=sum++;
}
else if(c=='U'){
un=1;
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
| main.c: In function 'main':
main.c:4:9: error: parameter 'sum' is initialized
4 | int c,sum=0,un=0;
| ^~~
main.c:4:9: error: parameter 'un' is initialized
main.c:5:9: error: expected declaration specifiers before 'while'
5 | while((c=getchar())!=EOF){
| ^~~~~
main.c:2... |
s829778286 | p01839 | C | #include <stdio.h>
int main(void)
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=='n'&&un=1){
if(sum>0){
sum=sum-1;
un=0;
}
}
if(c!='n')un=0;
if(sum>=0&&c=='A'){
sum=sum++;
}
else if(c=='U'){
un=1;
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
| main.c: In function 'main':
main.c:4:9: error: parameter 'sum' is initialized
4 | int c,sum=0,un=0;
| ^~~
main.c:4:9: error: parameter 'un' is initialized
main.c:5:9: error: expected declaration specifiers before 'while'
5 | while((c=getchar())!=EOF){
| ^~~~~
main.c:2... |
s529494525 | p01839 | C | #include <stdio.h>
int main(void)
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=='n'&&un=1){
if(sum>0){
sum=sum-1;
un=0;
}
}
if(c!='n'){
un=0;
if(sum>=0&&c=='A'){
sum=sum++;
}
else if(c=='U'){
un=1;
}
}
}
if(sum==0)puts("YES");
else puts("NO");
return 0;
}
... | main.c: In function 'main':
main.c:4:9: error: parameter 'sum' is initialized
4 | int c,sum=0,un=0;
| ^~~
main.c:4:9: error: parameter 'un' is initialized
main.c:5:9: error: expected declaration specifiers before 'while'
5 | while((c=getchar())!=EOF){
| ^~~~~
main.c:2... |
s535097927 | p01839 | C | n,r;char s[9];main(d){for(scanf("%d",&n);n--;d+=(*s-65?-1:1),r|=d<0;)gets(s);n=!puts(r|d?"NO":"YES");} | main.c:1:1: warning: data definition has no type or storage class
1 | n,r;char s[9];main(d){for(scanf("%d",&n);n--;d+=(*s-65?-1:1),r|=d<0;)gets(s);n=!puts(r|d?"NO":"YES");}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declara... |
s979539839 | p01839 | C | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
using ll = long long;
const ll mod = LLONG_MAX;
int main(){
int N,count = 0;
string v;
cin>>N;
REP(i,N){
cin>>v;
if(v == "a") count++;
else if(v == "Un") count--;
... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s773591095 | p01839 | C | #include<stdio.h>
#include<string.h>
int main()
{
char c[3];
int stock;
int flag;
int n;
scanf("%d",&n);
if(n==0) break;
stock=0;
flag=1;
for(;n>0;n--)
{
scanf("%s",c);
if(strcmp(c,"A")==0) stock++;
if(strcmp(c,"Un")==0)
{
if(stock>0) stock--;
else flag=0;
}
}
if(fl... | main.c: In function 'main':
main.c:10:12: error: break statement not within loop or switch
10 | if(n==0) break;
| ^~~~~
|
s289578486 | p01839 | C | #include <iostream>
using namespace std;
int main(void){
int n;
char henzi[100][3];
int x = 0;
int y = 0;
int s = 0;
int i = 0;
scanf("%d", &n);
while(i < n)
{
cin >> henzi[i];
i++;
}
for(i = 0;i < n; i++)
{
if((int)strlen(henzi[i]) == 1)
{
x++;
}
if ((int)strlen(henzi[i]) == 2)
{
y+... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s127016265 | p01839 | C++ | #include <stdio.h>
int main(void){
int c,sum=0,un=0;
while((c=getchar())!=EOF){
if(c=="n"&&un=1){
if(sum!=0)sum=sum-1;
un=0;
}
else if(c!="n")un=0;
else if(sum==0&&sum=="A"){
sum=sum++;
}
else if(sum!=0&&sum=="A"){
sum=sum++;
if(sum=="U"){
un=1;
}
}
}
if(sum==0)puts("YES");
else... | a.cc: In function 'int main()':
a.cc:5:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
5 | if(c=="n"&&un=1){
| ~^~~~~
a.cc:5:26: error: lvalue required as left operand of assignment
5 | if(c=="n"&&un=1){
| ... |
s222551154 | p01839 | C++ | #include<iostream>
#include<string>
using namespace std;
int n,c;string S;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>S;if(S=='A')c++;else c--;
if(c<0){cout<<"NO"<<endl;return 0;}
}
if(c==0)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:28: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | cin>>S;if(S=='A')c++;else c--;
| ~^~~~~
| | |
| ... |
s152848385 | p01839 | C++ |
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <bits/stdc++.h>
using namespace std;
bool check(vector<int> &s, int N)
{
int p = 0;
for (int i = 0; i < N; i++) {
p += s[i];
if (p < 0) {
return 0;
}
}
return (... | a.cc:2:1: error: expected unqualified-id before '?' token
2 | ?
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:36:
/usr/include... |
s167310606 | p01839 | C++ | #include<io> | a.cc:1:9: fatal error: io: No such file or directory
1 | #include<io>
| ^~~~
compilation terminated.
|
s016644197 | p01839 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
//ranker
using namespace std;
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) fo... | a.cc: In function 'int main()':
a.cc:45:23: error: expected primary-expression before ')' token
45 | if(cnt==0 && cnt1==0;) cout << "YES" << endl;
| ^
|
s776324698 | p01839 | C++ | n=int(input());c=0
for i in range(n):
c+=1 if input()=='A'else -1
if c<0:break
print("NO"if c else"YES") | a.cc:1:1: error: 'n' does not name a type
1 | n=int(input());c=0
| ^
a.cc:1:16: error: 'c' does not name a type
1 | n=int(input());c=0
| ^
|
s200038435 | p01839 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
bool res=true;
bool uning=false;
int acnt=0;
for(int i=0;i<n;i++){
string buf;
cin>>buf;
if(uning){
if(buf!="Un"){
isok=false;
continue;
}
acnt--;
if(acnt==0) uning=false;
}
else{
if(buf=="A"){
acnt++;
... | a.cc: In function 'int main()':
a.cc:15:33: error: 'isok' was not declared in this scope
15 | isok=false;
| ^~~~
a.cc:28:49: error: 'isok' was not declared in this scope
28 | else if(acnt<0) isok=false;
| ... |
s928781013 | p01839 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n;
string s;
cin>>n;
int a=0;
bool ans=true
for(int i=0;i<n;i++){
cin>>s;
if(s=="A")a++;
else a--;
if(a<0)ans=false;
}
if(a!=0)ans=false;
if(ans)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:1: error: expected ',' or ';' before 'for'
10 | for(int i=0;i<n;i++){
| ^~~
a.cc:10:13: error: 'i' was not declared in this scope
10 | for(int i=0;i<n;i++){
| ^
|
s262091319 | p01839 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
int x;
cin>>n;
for(int i=0;i<n;i++){
string s;
cin>>s;
if(x==0){
if(s=="A")x++;
else if(s=="Un")continue;
}else if(x>0){
if(s=="A")x++;
else if(s=="Un")x--;
... | a.cc: In function 'int main()':
a.cc:26:22: error: 'Endl' was not declared in this scope
26 | cout<<"YES"<<Endl;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.