submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s687472007 | p03946 | C | #include<stdio.h>
int main()
{
int n,t;
int i,j;
int c=0;
int g=0;
int min;
if(scanf("%d %d",&n,&t) < 2) {
fprintf(stderr, "error: ill-formed fraction.\n");
exit(1);
}
int a[n];
for(i=0;i<n;i++){
if(scanf("%d",&a[i]) < 1) {
fprintf(stderr, "error: ill-formed fraction.\n");
exit(1);
}... | main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
13 | exit(1);
| ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
1 | #include<stdio.h>
+++ |+#include <stdlib.h>
2 |
main.c:13:5: warning: i... |
s119185625 | p03946 | C++ | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <map>
#include <algorithm>
using namespace std;
int main(){
int n,t;
cin >> n >> t;
vector<int> a(n);
int alocal=1e9+1;
ai[0]=0;
int ans=0;
int local =0;
for (int i = 0; i < n; i++)... | a.cc: In function 'int main()':
a.cc:16:3: error: 'ai' was not declared in this scope; did you mean 'a'?
16 | ai[0]=0;
| ^~
| a
|
s049395084 | p03946 | C++ | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(int i = a; i < b;... | a.cc: In function 'int main()':
a.cc:31:17: error: 'INT_MAX' was not declared in this scope
31 | int a_min = INT_MAX;
| ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
12 | #include <algorithm>
+++ |+#include ... |
s527182590 | p03946 | C++ | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define RFOR(i, a, b) for(int i = ... | a.cc: In function 'int main()':
a.cc:51:3: error: 'gain' was not declared in this scope; did you mean 'main'?
51 | gain gain = 0;
| ^~~~
| main
|
s529356184 | p03946 | C++ | #include <iostream>
int main(){
long long int N, T;
long long int A[100000], B[100000], C[100000];
long long int min, max, cnt;
std::cin >> N >> T;
for(int i=0; i<N; i++){
std::cin >> A[i];
}
for(int i=0; i<N; i++){
for(int int j=i; j<N; j++){
if(max < A[i]-A[j]) max = A[j]-A[i];
}
... | a.cc: In function 'int main()':
a.cc:15:9: error: two or more data types in declaration of 'j'
15 | for(int int j=i; j<N; j++){
| ^~~
a.cc:15:22: error: 'j' was not declared in this scope
15 | for(int int j=i; j<N; j++){
| ^
a.cc:19:10: error: 'j' was not declared ... |
s740853962 | p03946 | C++ | #include <iostream>
using namespace std;
int main(){
int n, t;
cin >> n >> t;
int maxi = 0, diff = 1e9, count = 0;
while(n--){
int a;
cin >> a;
maxi = max(maxi, a);
if(diff == maxi - a) count++;
if(diff < maxi - a){
count = 1;
diff = maxi - a;
}
}
cout << count << end;
} | a.cc: In function 'int main()':
a.cc:18:23: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
18 | cout << count << end;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
from ... |
s957516094 | p03946 | C++ | #include <cstdio>
using namespace std;
int n, t;
int a[100000];
int p[100000][100000];
int m;
int ans;
int main(){
scanf("%d %d", &n, &t);
for(int i=0; i<n; i++) scanf("%d", &a[i]);
int s = t / 2;
for(int i=0; i<n-1; i++){
for(int j=1; i+j<=n-1; j++){
p[i][i+j] = s * (a[i+j] - a[i]);
if(m == p[i][i+j])... | /tmp/ccXAbMqj.o: in function `main':
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x140): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x149): relocation ... |
s673588871 | p03946 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int N,T;
scanf("%d %d",&N,&T);
if(T < 2){
printf("0\n");
return 0;
}
int * cost = malloc(N*sizeof(int));
int i;
for(i = 0; i < N; i++){
scanf("%d",&cost[i]);
}
//find max profit
int j;
int max = ... | main.c: In function 'main':
main.c:25:17: error: 'count' undeclared (first use in this function)
25 | count = 0;
| ^~~~~
main.c:25:17: note: each undeclared identifier is reported only once for each function it appears in
|
s234017214 | p03946 | C++ | #include <cstdio>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
int n, t;
int a[100000];
int p[100000][100000];
int m;
int ans;
int main(){
scanf("%d %d", &n, &t);
for(int i=0; i<n; i++) scanf("%d", &a[i]);
int s = t / 2;
for(int i=0; i<n-1; i++){
for(int j=1; i+j<=n-1; j++){
... | /tmp/ccKGdGmU.o: in function `main':
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x140): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x149): relocation ... |
s755697858 | p03946 | C++ | #include <iostream>
#define int long long
int main() {
int n, t;
std::cin >> n >> t;
int maxDiff = 0, maxCount = 0;
int nowMin = 0;
std::cin >> nowMin;
int prev = nowMin;
for (int i = 1; i <= n; ++i) {
int a;
if (i != n)
std::cin >> a;
else
... | cc1plus: error: '::main' must return 'int'
|
s466251247 | p03946 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int n = sc.nextInt();
int t = sc.nextInt();
int a[] = new a[n];
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
}
int maxsa = 0;
int maxa = 0;
int sa = 0;
int counter = 0;... | Main.java:8: error: cannot find symbol
int a[] = new a[n];
^
symbol: class a
location: class Main
1 error
|
s127632489 | p03946 | C++ | #include <iostream>
#include <vector>
typedef signed long long int slli;
int main()
{
unsigned N; slli T;
std::cin >> N >> T;
std::vector<slli> A(N);
for(unsigned n=0; n<N; ++n)
{
std::cin >> A[n];
}
if(N == 1)
{
std::cout << 0 << std::endl;
return 0;
}
std::vector<char> C(N-1... | a.cc: In function 'int main()':
a.cc:51:24: error: no matching function for call to 'min(unsigned int&, slli&)'
51 | std::cout << std::min(c, T) << std::endl;
| ~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:4... |
s835626416 | p03946 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
int... | a.cc:27:1: error: extended character is not valid in an identifier
27 | i=j;
| ^
a.cc:27:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:27:1: error: '\U00003000\U00003000i' was not declared in this scope
27 | i=j;
| ^~~~~
|
s500386743 | p03947 | C++ | #include <cstdio>
#include <string>
using namespace std;
int main()
{
char s[100005];
int len;
char c;
int b, w;
int i;
fgets(s, 100005, stdin);
len = strlen(s) - 1;
#if 0
printf("string is %s\n", s);
printf("len %d\n", len);
#endif
b = w = 0;
c = s[0];
if (c == 'B') b++;
else if (c == 'W... | a.cc: In function 'int main()':
a.cc:15:9: error: 'strlen' was not declared in this scope
15 | len = strlen(s) - 1;
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <string>
+++ |+#include <cstring>
3 | ... |
s281310269 | p03947 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000; // n の最大値
int main() {
string s;
cin>>s;
ll f=0;
ll counter=0;
ll n=s.size();
if(s.at(0)=='W'){
f++;}
for(ll i=1; i<n; i++){
if((f==1&&s.at(i)=='W')||(f==0&&s.... | a.cc: In function 'int main()':
a.cc:17:46: error: expected ';' before 'continue'
17 | if((f==1&&s.at(i)=='W')||(f==0&&s.at(i)=='B') continue;
| ^~~~~~~~~
| ;
a.cc:18:1: error: expected primary-expression before 'el... |
s992564564 | p03947 | C++ | #include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#define ll long long int... | a.cc: In function 'int main()':
a.cc:29:1: error: 'a' was not declared in this scope
29 | a
| ^
a.cc:32:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
32 | if(s[i+1] != s[i]) ans++;
| ^~~
| abs
a.cc:34:13: error:... |
s339927906 | p03947 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void)
{
string s;cin >> s;
int cnt=0;
for(i=0;i<s.size()-1;i++){
cnt+=(s[i]!=s[i+1])?1:0;
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=0;i<s.size()-1;i++){
| ^
|
s698252852 | p03947 | C++ | #include <iostream> using namespace std; int main() { string s; cin>>s; int ans=0; for(int i=1;i<s.size();i++) if(s[i]!=s[i-1]) ans++; cout<<ans<<endl; return 0; } | a.cc:1:21: warning: extra tokens at end of #include directive
1 | #include <iostream> using namespace std; int main() { string s; cin>>s; int ans=0; for(int i=1;i<s.size();i++) if(s[i]!=s[i-1]) ans++; cout<<ans<<endl; return 0; }
| ^~~~~
/usr/bi... |
s055554757 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
void solve(){
string s ;
cin>>S;
int n = s.size();
int ans =0;
for(int i=1;i<n;i++){
if(s[i]!=s[i-1])ans++;
}
cout<<ans<<endl;
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(... | a.cc: In function 'void solve()':
a.cc:7:10: error: 'S' was not declared in this scope
7 | cin>>S;
| ^
|
s539077720 | p03947 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000... | a.cc: In function 'int main()':
a.cc:19:16: error: 'a' was not declared in this scope
19 | if(s[i+1]!=a[i])ans++;
| ^
|
s383435294 | p03947 | C++ | #include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cstdio>
using namespace std;
int check(int x,int y){
if(s[x]=='W'){
if(s[y]=='B') return 1;
else return 0;
}
if(s[x]=='B'){
if(s[y]=='W') return 1;
else return 0;
}
}
int main(){
char s[100005];
scanf("%s",s);
int n=strlen(... | a.cc: In function 'int check(int, int)':
a.cc:8:12: error: 's' was not declared in this scope
8 | if(s[x]=='W'){
| ^
a.cc:12:12: error: 's' was not declared in this scope
12 | if(s[x]=='B'){
| ^
a.cc:16:1: warning: control reaches end of non-void function [-Wretu... |
s176527544 | p03947 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:69:1: error: extended character is not valid in an identifier
69 | if(a[i]!=a[i+1])ans++
| ^
a.cc:69:1: error: extended character is not valid in an identifier
a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defi... |
s439291387 | p03947 | C++ | wwbww#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
char latest = s[0];
int acc = 0;
for (int i=1;i<s.size();i++){
if (s[i] != latest){
acc += 1;
}
latest = s[i];
}
cout << acc << endl;
return 0;
} | a.cc:1:6: error: stray '#' in program
1 | wwbww#include <iostream>
| ^
a.cc:1:1: error: 'wwbww' does not name a type
1 | wwbww#include <iostream>
| ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:6:5: e... |
s915851393 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
char ch[1000005];
int main()
{
long int s=0,l=0,i,j;
gets(ch);
l=strlen(ch);
for(i=1; i<l; i++){
if (ch[i]!=ch[i-1]){
++s;
}
}
printf("%ld\n",s);
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(ch);
| ^~~~
| getw
|
s554525836 | p03947 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
char b=a.at(0);
int c=0;
for(int i=0;i<a.aize();i++){
if(a.at(i)!=b){
b=a.at(i);
c++;
}
}
cout<<c<<endl;
} | a.cc: In function 'int main()':
a.cc:9:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'aize'; did you mean 'size'?
9 | for(int i=0;i<a.aize();i++){
| ^~~~
| size
|
s352018564 | p03947 | C++ | #include<string.h>
int main()
{
int n,i,k;
char s[100005];
scanf("%s",&s);
k=strlen(s);
n=1;
for(i=0;i<k-1;i++)
{
if(s[i]!=s[i+1])
n++;
}
printf("%d\n",n-1);
return 0;
} | a.cc:12:1: error: extended character is not valid in an identifier
12 | n++;
| ^
a.cc: In function 'int main()':
a.cc:6:1: error: 'scanf' was not declared in this scope
6 | scanf("%s",&s);
| ^~~~~
a.cc:12:1: error: '\U000000a0n' was not declared in this scope
12 | n++;
| ^~
a.cc:14:1: er... |
s689746386 | p03947 | C++ | #include <iostream>
using namespace std;
int a;
string a;
int main()
{
cin >> a;
for (int i =1; i < a.size(); i++) {
if (a[i] != a[i - 1]) s++;
}
cout << a;
return 0;
}
| a.cc:6:9: error: conflicting declaration 'std::string a'
6 | string a;
| ^
a.cc:5:6: note: previous declaration as 'int a'
5 | int a;
| ^
a.cc: In function 'int main()':
a.cc:10:27: error: request for member 'size' in 'a', which is of non-class type 'int'
10 | for (int i =1; i... |
s186136528 | p03947 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main() {
char s[100000]={'\0'};
gets(s);
int len=strlen(s);
int count=0;
for(int i=1;i<len;i++){
if(s[i]!=s[i-1]){
count++;
}
}
cout<<count<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s061416156 | p03947 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main() {
char s[100000]={'\0'};
gets(s);
int len=strlen(s);
int count=0;
for(int i=1;i<len;i++){
if(s[i]!=s[i-1]){
count++;
}
}
cout<<count<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s892637432 | p03947 | C++ | /*g++ file.cpp -o file.out*/
/*./file.out*/
#include <cmath>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define LL long long
#define Mod 1000000007
#define L_Mod 17100000013
char str[100001];
int main()
{
int mn=0;
cin>>str;
for(i... | a.cc: In function 'int main()':
a.cc:23:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
23 | if(str[i]!=str{i+1})
| ~~~~~~^~~~~
a.cc:23:23: error: expected ')' before '{' token
23 | if(str[i]!=str{i+1})
| ~ ^
| ... |
s782767195 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG_MODE
#define DBG(n) n;
#else
#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << end... | a.cc: In function 'll seica(std::vector<std::pair<std::pair<long long int, long long int>, long long int> >, std::vector<std::pair<std::pair<long long int, long long int>, long long int> >, ll, ll, ll, ll)':
a.cc:87:20: error: 'v' was not declared in this scope
87 | if(v[i].FI < (L + R) / 2)vv1.PB(v1... |
s361055685 | p03947 | C | #include<stdio.h>
#include<string.h>
int main(){
char s[100010];
int n;
scanf("%s",s);
n=strlen(s);
for(int i=1;i<n;i++)
if(s[i]!=s[i-1])
cnt++;
printf("%d\n",cnt);
} | main.c: In function 'main':
main.c:11:7: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
11 | cnt++;
| ^~~
| int
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
|
s631544351 | p03947 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int ans=0;
char x = s[0];
for(auto i=s.begin();i<s.end();i++){
if((*s)==x){
continue;
}else{
x=(*s);
ans++;
}
}
cout << ans;
return 0;}
| a.cc: In function 'int main()':
a.cc:12:5: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
12 | if((*s)==x){
| ^~
a.cc:15:4: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
15 | x=(*s);
... |
s302187479 | p03947 | C++ | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
const int N = 1e5 + 1;
const int inf = 1e9 + 7;
typedef pair<int,int> ii;
vector<int> g[N];
int n, k;
ii L[N];
int h[N];
int ans[N];
void dfs(int u,int p) {
for(int v : g[u])
if(v != p) {
h[v] = h[u] + 1;
dfs(v)... | a.cc: In function 'void dfs(int, int)':
a.cc:23:28: error: too few arguments to function 'void dfs(int, int)'
23 | dfs(v);
| ~~~^~~
a.cc:19:6: note: declared here
19 | void dfs(int u,int p) {
| ^~~
|
s372473512 | p03947 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
string s;
int a[10000005]={0};
int main()
{
cin>>s;
n=s.length();
for(int i=0;i<n;i++)if(s[i]=='W')a[i]=1;
int ans=0;
for(int i=0;i+1<n;i++)if(a[i]!=a[i+1])ans++;
cout<<ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'n' was not declared in this scope
11 | n=s.length();
| ^
|
s577045674 | p03947 | C++ | #include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rr... | a.cc:52:2: error: unterminated argument list invoking macro "rep"
52 | }
| ^
a.cc: In function 'int main()':
a.cc:43:9: error: 'rep' was not declared in this scope
43 | rep(i,1,s.size(){
| ^~~
a.cc:43:12: error: expected '}' at end of input
43 | rep(i,1,s.size(){
| ... |
s503012419 | p03947 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);
using namespace std;
namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(cons... | a.cc: In function 'int main()':
a.cc:20:23: error: invalid types 'int[int]' for array subscript
20 | a += a[i] != a[i + 1];
| ^
a.cc:20:31: error: invalid types 'int[int]' for array subscript
20 | a += a[i] != a[i + 1];
| ... |
s652441255 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
cout<<s.count("BW")+s.count("WB")<<endl;
} | a.cc: In function 'int main()':
a.cc:6:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
6 | cout<<s.count("BW")+s.count("WB")<<endl;
| ^~~~~
a.cc:6:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'co... |
s719969243 | p03947 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algor... | a.cc:53:10: fatal error: conio.h: No such file or directory
53 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s631774242 | p03947 | C++ | s = gets.chomp.split("")
ans = 0
s.each_cons(2) do |c, d|
next if c == d
ans += 1
end
puts ans
| a.cc:1:1: error: 's' does not name a type
1 | s = gets.chomp.split("")
| ^
|
s991252850 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
char c = s[0];
int cnt = 0:
for (int i = 0; i < s.size(); i++){
if(c != s[i]){
c = s[i];
cnt++;
}
cout << cnt << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:14: error: expected ',' or ';' before ':' token
7 | int cnt = 0:
| ^
a.cc:8:19: error: 'i' was not declared in this scope
8 | for (int i = 0; i < s.size(); i++){
| ^
|
s876116904 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
int main{
string s;
cin >> s;
char c = s[0];
int cnt = 0:
for (int i = 0; i < s.size(); i++){
if(c != s[i]){
c = s[i];
cnt++;
}
cout << cnt << endl;
}
}
| a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:9: error: expected primary-expression before 's'
4 | string s;
| ^
a.cc:4:9: error: expected '}' before 's'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:5:2: error:... |
s678946418 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
int main{
string s;
cin >> s;
char c = s[0];
int cnt = 0:
for (int i = 0; i < s.size(); i++){
if(c != s[i]){
c = s[i];
cnt++;
}
cout << cnt << endl;
}
| a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:9: error: expected primary-expression before 's'
4 | string s;
| ^
a.cc:4:9: error: expected '}' before 's'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:5:2: error:... |
s612700809 | p03947 | C++ | #include <iostream>
using namespace std;
int main{
string s;
cin >> s;
char c = s[0];
int cnt = 0:
for (int i = 0; i < s.size(); i++){
if(c != s[i]){
c = s[i];
cnt++;
}
cout << cnt << endl;
}
| a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:9: error: expected primary-expression before 's'
4 | string s;
| ^
a.cc:4:9: error: expected '}' before 's'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:5:2: error:... |
s007709481 | p03947 | C++ | #include <bits/stdc++.h>
using namespace std;
//#define FILE_IO
int N;
char s[100005];
int main()
{
#ifdef FILE_IO
freopen("1.in", "r", stdin);
freopen("1.out", "w", stdout);
#endif
gets(s + 1);
N = strlen(s + 1);
int ans = 0;
for(int i = 1; i < N; i++)
if(s[i] != s[i + 1])... | a.cc: In function 'int main()':
a.cc:17:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
17 | gets(s + 1);
| ^~~~
| getw
|
s453703322 | p03947 | C++ | #include<<bits/stdc++.h>
using namespace std;
char a[100010];
int cnt, i, n;
int main()
{
scanf("%s",a);
n=strlen(a);
for(i=1;i<=n;i++)
if(a[i]!=a[i-1]) cnt++;
printf("%d",cnt-1);
} | a.cc:1:9: fatal error: <bits/stdc++.h: No such file or directory
1 | #include<<bits/stdc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s322371356 | p03947 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
char a[100010];
int cnt;
int main()
{
scanf("%s",a);
int i,n;
n=strlen(a);
for(i=1;i<=n;i++)
if(a[i]!=a[i-1]) cnt++;
printf("%d",cnt-1);
} | a.cc: In function 'int main()':
a.cc:10:7: error: 'strlen' was not declared in this scope
10 | n=strlen(a);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstring>
3 | using ... |
s517455900 | p03947 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
char a[100010];
int cnt;
int main()
{
scanf("%s",&a[1]);
int i,n=strlen(&a[1]);
for(i=1;i<=n;i++)
if(a[i]!=a[i-1]) cnt++;
printf("%d",cnt-1);
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'strlen' was not declared in this scope
9 | int i,n=strlen(&a[1]);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstring... |
s147055668 | p03947 | C++ | omething came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) stone from the left. If the i-th character in S is B, it means that the color of... | a.cc:1:230: error: extended character ≦ is not valid in an identifier
1 | omething came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) st... |
s621769446 | p03947 | C++ | he row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.
In the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described b... | a.cc:1:1: error: 'he' does not name a type
1 | he row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.
| ^~
|
s243820408 | p03947 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class plactice63C {
private static Integer ct;
private static Integer len;
public static void main(String[] args) throws IOException {
proconScan proScan = new proconScan();
proScan.scan();
ct = 0;
len = p... | Main.java:5: error: class plactice63C is public, should be declared in a file named plactice63C.java
public class plactice63C {
^
1 error
|
s065106070 | p03947 | Java | import static org.hamcrest.CoreMatchers.nullValue;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
private static Integer ct;
private static Integer len;
public static void main(String[] args) throws IOException {
proconScan proScan = new proconS... | Main.java:1: error: package org.hamcrest does not exist
import static org.hamcrest.CoreMatchers.nullValue;
^
Main.java:1: error: static import only from classes and interfaces
import static org.hamcrest.CoreMatchers.nullValue;
^
2 errors
|
s509151627 | p03947 | C++ | input = gets.chomp
ans = 0
(input.length - 1).times {|i|
ans += 1 if(input[i] != input[i+1])
}
puts ans | a.cc:1:1: error: 'input' does not name a type; did you mean 'int'?
1 | input = gets.chomp
| ^~~~~
| int
a.cc:6:1: error: 'puts' does not name a type
6 | puts ans
| ^~~~
|
s239064889 | p03947 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(void){
char s[1000000];
int count=0;
cin >> s;
for(i=0;i<strlen(s);i++){
if(s[i]!=s[i+1])count++;
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'i' was not declared in this scope
9 | for(i=0;i<strlen(s);i++){
| ^
|
s923848498 | p03947 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void){
char s[1000000];
int count=0;
cin >> s;
for(i=0;i<strlen(s);i++){
if(s[i]!=s[i+1])count++;
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'i' was not declared in this scope
9 | for(i=0;i<strlen(s);i++){
| ^
a.cc:9:11: error: 'strlen' was not declared in this scope
9 | for(i=0;i<strlen(s);i++){
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is prob... |
s832024459 | p03947 | C++ | #include <iostream>
#include <string>
int main(void){
char s[1000000];
int count=0;
cin >> s;
for(i=0;i<strlen(s);i++){
if(s[i]!=s[i+1])count++;
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> s;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard ... |
s868567683 | p03947 | Java | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String input = scan.nextLine();
char[] input_char = input.toCharArray();
char current_char = input_char[0];
int count = 0;
for (int i=1;i<input_char.length;i++) {
... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s491760518 | p03947 | Java | import java.util.Scanner;
public class Reversi {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String input = scan.nextLine();
char[] input_char = input.toCharArray();
char current_char = input_char[0];
int count = 0;
... | Main.java:3: error: class Reversi is public, should be declared in a file named Reversi.java
public class Reversi {
^
1 error
|
s740418673 | p03947 | C |
#include <stdio.h>
#include <string.h>
int main(){
long count;
long s_number;
int i;
char S[100000];
int color,lastcolor;
scanf(%c,&S);
s_number = strlen(S);
if(S[0]=="B")lastcolor=0;
else if(S[0]=="W")lastcolor=1;
for (i=1;i<s_number;i++){
if(S[i] == "B"){
color=0;
}
else if(S[i]=="W"){
... | main.c: In function 'main':
main.c:13:15: error: expected expression before '%' token
13 | scanf(%c,&S);
| ^
main.c:16:16: warning: comparison between pointer and integer
16 | if(S[0]=="B")lastcolor=0;
| ^~
main.c:17:21: warning: comparison between pointer ... |
s205470714 | p03947 | C |
#include <stdio.h>
int main(){
long count;
long s_number;
int i,;
char S[];
scanf(%c,&S);
s_number = strlen(S);
if(S[0]=="B")lastcolor=0;
else if(S[0]=="W")lastcolor=1;
for (i=1;i<s_number;i++){
if(S[i] == "B"){
color=0;
}
else if(S[i]=="W"){
color=1;
}
if(lastcolor==color){
cou... | main.c: In function 'main':
main.c:8:15: error: expected identifier or '(' before ';' token
8 | int i,;
| ^
main.c:9:14: error: array size missing in 'S'
9 | char S[];
| ^
main.c:11:15: error: expected expression before '%' token
11 | scanf(%c,&S... |
s150102749 | p03947 | C++ | int main(){
string s;
int ans=0;
cin>>s;
char prev= s.at(0);
for(int i=1; i<s.size(); i++){
// cout<< prev<<endl;
// cout<< s.at(i)<<endl;
if(prev!= s.at(i)) ans++;
prev= s.at(i);
}
cout<< ans<< endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
2 | string s;
| ^~~~~~
a.cc:5:9: error: 'cin' was not declared in this scope
5 | cin>>s;
| ^~~
a.cc:5:14: error: 's' was not declared in this scope
5 | cin>>s;
|... |
s043462831 | p03947 | C | #include <stdio.h>
int main(void){
char S[100001];
int i, j, n, Ans;
scanf("%s",S);
j = S[0];
n = strlen(S);
Ans = 0;
for(i=1; i<n; i++){
if(S[i] != j){
++Ans;
j = S[i];
}
}
printf(%d\n", Ans);
return 0;
}
| main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | n = strlen(S);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 | int main... |
s203201595 | p03947 | C | #include <stdio.h>
int main(void){
char S[100001];
int i, j, n, Ans;
scanf("%s",S);
j = S[0];
n = strlen(S)-1;
Ans = 0;
for(i=1; i<n; i++){
if(S[i] != j){
++Ans;
j = S[i];
}
}
printf(%d\n", Ans);
return0;
}
| main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | n = strlen(S)-1;
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 | int ma... |
s125731963 | p03947 | C++ | 324 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 324
| ^~~
|
s240990377 | p03947 | C++ | #include<bits/stdc++.h>
#define INF 987654321
#define N 100005
using namespace std;
struct A{
int num,lef,rig;
/// lef,rig는 가능한 구간이라고 하자
} s[N];
vector<int> V[N];
int n,m,ai[N],bi[N],visit[N],visit2[N];
void dfs(int from)
{
int to,i,st,ed;
st=-INF;
ed=INF;
visit[from]=1;
for(i=0;i<V[from].s... | a.cc: In function 'void dfs(int)':
a.cc:17:5: error: reference to 'visit' is ambiguous
17 | visit[from]=1;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visito... |
s425364376 | p03947 | Java |
import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s = r.readLine();
System.out.println(solve(s));
}
public int solve(String s) {
int resu... | Main.java:11: error: non-static method solve(String) cannot be referenced from a static context
System.out.println(solve(s));
^
1 error
|
s634846448 | p03947 | C++ | // -*- coding: utf-8 -*-
//import java.awt.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
InputStream inputStream;
if (args.length > 0 && args[0].equals("devTesting")) {
try {
inputStream = new FileIn... | a.cc:3:1: error: 'import' does not name a type
3 | import java.io.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.math.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: ... |
s059657071 | p03947 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<utility>
#include<set>
#include <queue>
#define ull unsigned long long
#define ll long long
#define pii pair<int,int>
#... | a.cc: In function 'int main()':
a.cc:43:11: error: expected primary-expression at end of input
43 | cout<<
| ^
a.cc:43:11: error: expected '}' at end of input
a.cc:26:1: note: to match this '{'
26 | {
| ^
|
s412941164 | p03947 | C++ | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include <iomanip>
#define rep0(i,N) for(int i=0;i<N;i++)
#define rep1(i,a,N) for(int i=0+a;i<N;i++)
#define lint long long int
#define SIZE 100005
using namespace std;
int main(){
... | a.cc: In function 'int main()':
a.cc:37:10: error: expected '}' at end of input
37 | return 0;
| ^
a.cc:18:11: note: to match this '{'
18 | int main(){
| ^
|
s611523962 | p03947 | C++ | import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
void main(){
string s = readln.chomp;
int ans;
char x = 'a';
foreach(c; s){
if(x != 'a') if(x != c) ans += 1;
x = c;
}
ans.writeln;
} | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
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 std.conv, std.array, std.algorithm, std.string;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only avail... |
s360018475 | p03947 | C++ | #include<bits/stdc++.h>
using namesapce std;
int main()
{
string s;
cin>>s;
int num=0;
char c=s[0];
for(int i=1;s[i]!=0;i++){
if(c!=s[i]){
num++;
c=s[i];
}
}
printf("%d\n",num);
} | a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from ... |
s257151792 | p03947 | C++ |
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#includ... | a.cc: In function 'int main()':
a.cc:28:29: error: 'strlen' was not declared in this scope
28 | for (int i = 1; i < strlen(str); ++i)
| ^~~~~~
a.cc:20:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
19 | #include... |
s365363147 | p03948 | C++ | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
#define int long long
int n, A[N], T;
map < int, int > Map;
main() {
cin >> n >> T;
for(int i = 1; i <= n; ++ i) scanf("%lld", &A[i]);
int Mi = 1e9, ans = 0;
for(int i = 1; i <= n; ++ i) {
Mi = min(Mi, A[i]);
ans = max(ans, A[i] - Mi);
}... | a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
12 | main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:32:20: error: no matching function for call to 'min(const long long int&, int)'
32 | cout << min(min(cnt1, cnt2), 1000000000);
| ~~~^... |
s649548880 | p03948 | C++ | #include <cstdio>
using i32 = int;
using i64 = long long;
constexpr i32 maxn = 100000;
inline i32 in() {
static i32 n;
scanf("%d", &n);
return n;
}
i32 a[maxn + 1];
i32 main() {
const i32 n = in(), T = in();
for (i32 i = 1; i <= n; ++i)
a[i] = in();
a[n + 1] = -1;
std::pair<i32, i32> ans = std::make_pair... | a.cc: In function 'i32 main()':
a.cc:21:14: error: 'pair' is not a member of 'std'
21 | std::pair<i32, i32> ans = std::make_pair(0, 0);
| ^~~~
a.cc:2:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>'
1 | #include <cstdio>
+... |
s044173769 | p03948 | C++ | #include<iostream>
#include<algorithm>
#define MAX 100005
using namespace std;
ll a[MAX],ans=0;
typedef long long ll;
int main() {
//最多买卖T
int N, T;
cin >> N >> T;
ll tmp = 0,pro=0;
cin >> a[1];
tmp = a[1];
for (int i = 2; i <= N; i++){
cin >> a[i];
if (a[i] > tmp) {
if (a[i] - tmp >= pro) {
pro = a[i... | a.cc:5:1: error: 'll' does not name a type
5 | ll a[MAX],ans=0;
| ^~
a.cc: In function 'int main()':
a.cc:12:16: error: 'a' was not declared in this scope
12 | cin >> a[1];
| ^
a.cc:19:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
19 | ... |
s790012450 | p03948 | C++ | #include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
#define maxn 100500
#define inf 0x3f3f3f3f
int a[maxn];
int main()
{
int ans = 0;
int n, t;
scanf_s("%d%d", &n, &t);
for (int i = 1; i <= n; i++) {
scanf_s("%d", &... | a.cc: In function 'int main()':
a.cc:16:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | scanf_s("%d%d", &n, &t);
| ^~~~~~~
| scanf
|
s395516592 | p03948 | C++ | #include <iostream>
#include <bits/stdc++>h>
using namespace std;
int main(){
long long int a, b , c[100010], x[100010];
cin >> a >> b;
for(int i=0;i<a;i++)
cin >> c[i];
x[0] = 1e15;
for(int i=0;i<a;i++){
x[i+1] = min(c[i+1] , x[i]);
}
int p = -1e9;
int ans = 0;
for(int i=... | a.cc:2:24: warning: extra tokens at end of #include directive
2 | #include <bits/stdc++>h>
| ^
a.cc:2:10: fatal error: bits/stdc++>: No such file or directory
2 | #include <bits/stdc++>h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s899964454 | p03948 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#def... | a.cc:20:24: error: redefinition of 'template<class T> bool chmax(T&, const T&)'
20 | template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
| ^~~~~
a.cc:6:24: note: 'template<class T> bool chmax(T&, const T&)' previously declared here
6 | template<cl... |
s938238999 | p03948 | C++ | #include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<utility>
#include<algorithm>
#include<functional>
#include<ctime>
#include<cmath>
#include<cstdlib>
#include<cstdio>
using namesp... | a.cc: In function 'int main()':
a.cc:32:25: error: 'x' was not declared in this scope
32 | mp[A[i]-x]++;
| ^
|
s083867204 | p03948 | 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++)
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;
return c+i_7;
}
using namespace st... | a.cc: In function 'int main()':
a.cc:129:17: error: 'used' cannot be used as a function
129 | if(!used(p[i][j])){
| ~~~~^~~~~~~~~
a.cc:131:15: error: 'used' cannot be used as a function
131 | used(p[i][j]) = true;
| ~~~~^~~~~~~~~
|
s997260969 | p03948 | C | #include<stdio.h>
int main(){
int a[100000],i,j,n,N=0,num=0;
int max=0;
scanf("%d%d",&n,&N);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
if(i>0&&a[i-1]-a[i]>max)
max=a[i-1]-a[i];
}
for(i=0;i<n-1;i++){
if(max==a[i]-a[i+1])
num++;
}
if(N<num)
nu... | main.c: In function 'main':
main.c:8:9: error: 'if\U0000ff08i' undeclared (first use in this function)
8 | if(i>0&&a[i-1]-a[i]>max)
| ^~~~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:33: error: expected ';' before ')' token
8... |
s267207541 | p03948 | C++ | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
ll N, T;
cin >> N >> T;
ll A[N + 5];
map<ll, ll> mp;
for (int i = 0; i < N; i++)
{
cin >> A[i];
}
ll max_v = -2000000000000;
ll min_v = R[0];
for (int i = 0; i < N; i++)
{
max_v =... | a.cc: In function 'int main()':
a.cc:15:16: error: 'R' was not declared in this scope
15 | ll min_v = R[0];
| ^
|
s221288580 | p03948 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
typedef long long ll;
typedef unsigned int uint;
using namespace std;
int main() {
cin.sync_with_stdio(false);
cin.tie(0);
int n, t;
cin >> n >> t;
int A[n];
int mn = INT_MAX;
int... | a.cc: In function 'int main()':
a.cc:18:14: error: 'INT_MAX' was not declared in this scope
18 | int mn = INT_MAX;
| ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <cmath>
+++ |+#include <climits>
... |
s733409207 | p03948 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitse... | a.cc: In function 'int main()':
a.cc:23:13: error: 'INT_MAX' was not declared in this scope
23 | #define INF INT_MAX
| ^~~~~~~
a.cc:52:12: note: in expansion of macro 'INF'
52 | int minl=INF;
| ^~~
a.cc:23:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably f... |
s530233379 | p03948 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int N, T;
int in[100001];
int main() {
cin >> N >> T;
for (int i = 0; i < N; i++)ifs >> in[i];
int ct = 1, biggest = -1, small = in[0];
int ans = 0;
int beforesmall = 0;
for (int i = 1; i <= N; i++) {
beforesmall = small;
small = min(small, in[i]... | a.cc: In function 'int main()':
a.cc:12:36: error: 'ifs' was not declared in this scope
12 | for (int i = 0; i < N; i++)ifs >> in[i];
| ^~~
|
s856145497 | p03948 | C++ | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <map>
#include <queue>
#include <string>
#define pb push_back
#define mod 1000000007
#define all(x) x.begin(),x.end()
#define inf (int)(1e9)
using namespace std;
typedef long long int ll;
typedef pa... | a.cc: In function 'int main()':
a.cc:45:16: error: expected ']' before '[' token
45 | map[max_a[i]]=1;
| ^
| ]
a.cc:45:21: error: class template argument deduction failed:
45 | map[max_a[i]]=1;
| ^
a.cc:45:21: error: no matching funct... |
s492027265 | p03948 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N, T;
cin>>N>>T;
vector<int> A, B;
A.resize(N);
B.resize(N-1);
cin>>A[0];
int min=A[0];
for(int i=1; i<N; i++){
cin>>A[i];
B[i-1]=A[i]-min;
if(min > A[i]){
min=A[i];
}
}
sort(B.begin(), B.end());
int cnt=0;
for(int i=... | a.cc: In function 'int main()':
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
22 | sort(B.begin(), B.end());
| ^~~~
| short
|
s319556198 | p03948 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void) {
int N, T, minprice, maxgain, cost;
vector<int> A(100000), m(100000);
cin >> N >> T;
for (int i = 0; i < N; i++) cin >> A[i];
minprice = INT_MAX;
maxgain = -INT_MAX;
for (int i = 0; i < N; i++) {
minprice = min(m... | a.cc: In function 'int main()':
a.cc:15:20: error: 'INT_MAX' was not declared in this scope
15 | minprice = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include<vector>
+++ |+#include... |
s211109382 | p03948 | Java | import java.util.*;
public class Main2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int T = sc.nextInt();
int A[] = new int[N];
for (int i = 0; i < N; i++) {
A[i] = sc.nextInt();
}
// i 以前の最小値
int min[] = new int[N];
min[0] = A[0];
for (i... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s440478780 | p03948 | C | #include <stdio.h>
int main(void){
int N, T;
scanf("%d %d\n" , &N, &T);
char A[N], D[N];
scanf("%s", A);
int i, j=A[1], k=0;
for(i=2; i<N; i++){
if(j<A[i]){
D[k]=A[i]-j;
k++;
}else if(j==A[i]){
D[k]=0;
k++;
}else if(j>A[i]... | main.c: In function 'main':
main.c:25:18: error: expected ')' before '{' token
25 | if(l<D[i]{
| ~ ^
| )
main.c:28:5: error: expected expression before '}' token
28 | }
| ^
|
s842472503 | p03948 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int N,T;
cin >> N >> T;
int A[N];
for(int i=0;i<N;i++) scanf("%d", &A[i]);
int minA[N],profit[N];
int min_value=INT_MAX;
int max_value=0;
int suffer=0;
for(int i=0;i<N;i++){
if(A[i]<min_value) min_value=... | a.cc: In function 'int main()':
a.cc:13:19: error: 'INT_MAX' was not declared in this scope
13 | int min_value=INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <cmath>
+++ |+#include <... |
s095838514 | p03948 | C++ | #include <iostream>
using namespace std;
int main(){
int N,T;
cin >> N >> T;
int A[N];
for(int i=0;i<N;i++) scanf("%d", &A[i]);
int minA[N],profit[N];
int min_value=INT_MAX;
int max_value=0;
int suffer=0;
for(int i=0;i<N;i++){
if(A[i]<min_value) min_value=A[i];
min... | a.cc: In function 'int main()':
a.cc:12:19: error: 'INT_MAX' was not declared in this scope
12 | int min_value=INT_MAX;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#includ... |
s602927730 | p03948 | C++ | #include<iostream>
using namespace std;
int main(){
int n, t;
int *a;
cin>> n>> t;
a= new int[n];
for(int i=0; i<n; i++) cin>> a[i];
int minA[n];
int profit[n];
minA[0]= a[0];
profit[0]= -a[0];
for(int i=1; i<n; i++) minA[i]= min(minA[i-1], a[i]);
for(int i=1; i<n; i++) profit[i]= a[i]-minA[i-1];
in... | a.cc: In function 'int main()':
a.cc:22:24: error: 'INT_MIN' was not declared in this scope
22 | int maxProfit= INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include<iostream>
+++ ... |
s858793614 | p03948 | C++ | #include<iostream>
using namespace std;
int main(){
int n, t;
int *a;
cin>> n>> t;
a= new int[n];
for(int i=0; i<n; i++) cin>> a[i];
int minA[n];
int profit[n];
minA[0]= a[0];
profit[0]= -a[0];
for(int i=1; i<n; i++) minA[i]= min(minA[i-1], a[i]);
for(int i=1; i<n; i++) profit[i]= a[i]-minA[i-1];
in... | a.cc: In function 'int main()':
a.cc:22:24: error: 'INT_MIN' was not declared in this scope
22 | int maxProfit= INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include<iostream>
+++ ... |
s383274231 | p03948 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#define IOS ios::sync_with_stdio(false)
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL;
#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include ... | a.cc: In function 'void work()':
a.cc:24:14: error: 'INT_MAX' was not declared in this scope
24 | int mi = INT_MAX;
| ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
16 | #include <queue>
+++ |+#include <climits>... |
s521092740 | p03948 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
const int INF = 100000000;
const double EPS = 1e-10;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;
int n;
ll t;
ll m;
... | a.cc:15:4: error: expected initializer before 'a'
15 | ll a[100010];
| ^
a.cc: In function 'int main()':
a.cc:19:16: error: 'a' was not declared in this scope
19 | cin >> a[0];
| ^
|
s034388055 | p03948 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
const int INF = 100000000;
const double EPS = 1e-10;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;
int n;
ll t;
ll m;
... | a.cc:23:20: error: macro "rep" passed 3 arguments, but takes just 2
23 | rep(i, 1, n)
| ^
a.cc:2:9: note: macro "rep" defined here
2 | #define rep(i,n) for(int i = 0; i < n; i++)
| ^~~
a.cc:14:7: error: expected initializer before 'kazu'
14 | ll sa kazu,
| ... |
s747674912 | p03948 | C++ | #include "math.h"
#include <algorithm>
#include <complex>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#include <set>
#define ifor(i, a, b) for (int i = (a); i < (b); i++)
#define rfor(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define r... | a.cc:61:1: error: 'Submission' does not name a type
61 | Submission
| ^~~~~~~~~~
|
s040390274 | p03948 | C++ | #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define INF 1e10
using namespace std;
long long abs(long long a){
return ((a>0)?a:-1*a);
}
int main(){
long long n,t,high,low;
cin>>n>>t;
long long a[n],tmp[n];
rep(i,n){
cin>>a[i];
}
for(int i=n-1;i>=0;i--){
if(i==n-1... | a.cc: In function 'int main()':
a.cc:29:33: error: call of overloaded 'abs(long long int)' is ambiguous
29 | diff=abs(tmp[i]-a[i]);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_... |
s831161438 | p03948 | C++ | #include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(void){
int n,i;
ll a[100100],t,itr[100100],tmp=-1,cnt=0,dft=-1,ans;
cin >> n >> t;
(t+1)/=2;
for(i=0; i<n; i++){
cin >> a[i];
}
for(i=(n-1); i>=0; i--){
if(tmp<a[i]){
itr[i] = a[i];
tmp =... | a.cc: In function 'int main()':
a.cc:13:11: error: lvalue required as left operand of assignment
13 | (t+1)/=2;
| ~~^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.