submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s258979723 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin>>n;
vector<ll>a;
for(ll i=0;i<n;i++)
{
ll... | a.cc: In function 'int main()':
a.cc:28:26: error: 'aa' was not declared in this scope; did you mean 'a'?
28 | while(i+1<n&&aa[i+1]>=a[i])
| ^~
| a
|
s988084132 | p03745 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n, tmp = 0, cnt = 1;
cin >> n;
vector<ll> a(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
}
if (n == 1) {
cout << 1 << e... | a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before '<' token
20 | for(int i = 0,i < n-1; i++) {
| ^~
| ;
a.cc:20:21: error: expected primary-expression before '<' token
20 | for(int i = 0,i < n-1; i++) {
| ^
|
s958658417 | p03745 | C++ | #include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;
#define intmax INT_MAX
#define lmax LONG_MAX... | a.cc: In function 'int main()':
a.cc:50:15: error: expected primary-expression before ';' token
50 | ll a[n],b[n]=;
| ^
|
s075232044 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int L=0;
cin>>N;
vector<int>vec(N);
for(int X=0;X<N;X++){
cin>>vec.at(X);
if(X>1){
if(vec.at(X-2)>=vec.at(X-1) && vec.at(X-1)<=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
L++;
}
else if... | a.cc: In function 'int main()':
a.cc:12:90: error: lvalue required as left operand of assignment
12 | if(vec.at(X-2)>=vec.at(X-1) && vec.at(X-1)<=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
| ~~~~~~~~~~~~^... |
s062099004 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector<int> a(N);
for(int i=0;i<N;i++) {
cin>>a[i];
}
int count=0;
for(int i=0;i<N;i++) {
while(i+1<N && a[i] == a[i + 1]) ++i;
if (i+1<N && [i] < a[i+1]){
while (i+1<N && a[i] <= a[i+1])++i;
} else if (i+1<N... | a.cc: In function 'int main()':
a.cc:15:24: error: 'a' is not a type
15 | if (i+1<N && [i] < a[i+1]){
| ^
a.cc:15:30: error: expected '>' before ')' token
15 | if (i+1<N && [i] < a[i+1]){
| ^
a.cc: In lambda function:
a.cc:15:30: error: expec... |
s126025094 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector<int> a(N);
for(int i=0;i<N;i++) {
cin>>[i];
}
int count=0;
for(int i=0;i<N;i++) {
while(i+1<N && a[i] == a[i + 1]) ++i;
if (i+1<N && [i] < a[i+1]){
while (i+1<N && a[i] <= a[i+1])++i;
} else if (i+1<N ... | a.cc: In lambda function:
a.cc:9:13: error: expected '{' before ';' token
9 | cin>>[i];
| ^
a.cc: In function 'int main()':
a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'main()::<lambda()>')
9 | cin>>[i];
| ... |
s248422527 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>A[N];
int ans=0;
int count=0;
for(int i=0;i<N;i++){
cin>>A[i];
}
for(int i=0;i<N;i++){
if(i==0){
continue;
}
if(count==0&&A[i]<A[i-1]){
count==1;
continue;
}
else if(count==0&&A... | a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>')
11 | cin>>A[i];
| ~~~^~~~~~
| | |
| | std::vector<int>
| std::istream {aka std::basic_istream<... |
s116191446 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
vector<int>A[N];
int ans=0;
int count=0;
for(int i=0;i<N;i++){
cin>>A[i];
}
for(int i=0;i<N;i++){
if(i==0){
continue;
}
if(count==0&&A[i]<A[i-1]){
count==1;
continue;
}
else if(count==0&&A[i]>A[i-1]... | a.cc: In function 'int main()':
a.cc:10:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>')
10 | cin>>A[i];
| ~~~^~~~~~
| | |
| | std::vector<int>
| std::istream {aka std::basic_istream<... |
s182368840 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N
vector<int>A(N);
for(int i=0;i<N;i++) cin>>A.at(N);
//途中まで。
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'vector'
6 | vector<int>A(N);
| ^~~~~~
a.cc:8:17: error: 'N' was not declared in this scope
8 | for(int i=0;i<N;i++) cin>>A.at(N);
| ^
a.cc:8:29: error: 'A' was not declared in this scope
8 | for... |
s100187293 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int x;
cin >> x;
vector<int> arr(x);
for (int i = 0; i<x; i++){
cin >> arr[i];
}
vector<vector<int>> B(1);
for (int i = 0; i<x; i++){
if (B.back().size() == 0){
B.back().push_back(arr[i]);
} else if (B.back().size() == 1){
B... | a.cc: In function 'int main()':
a.cc:33:19: error: expected ';' before 'return'
33 | cout << B.size()
| ^
| ;
34 | return 0;
| ~~~~~~
|
s830119686 | p03745 | C++ | # include <iostream>
# include <map>
using namespace std;
const int NEUTRAL = 0;
const int ASCENDING = -1;
const int DESCENDING = 1;
int main(){
int N, numbers[100005];
cin >> N;
for(int i=0; i<N; i++){
cin >> numbers[i];
}
int flag = NEUTRAL;
int ans = 0;
for(int i=0; i<N-1; i++){
if((flag =... | a.cc: In function 'int main()':
a.cc:20:57: error: expected ';' before '{' token
20 | (flag == DESCENDING && numbers[i] < numbers[i+1]) {
| ^~
| ;
a.cc:24:5: error: expected primary-expr... |
s024834713 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
pair<int,int>data=mke_pair(0,0);
int y;
cin >> y;
data.first=y;
int count=1;
for(int i=1;i<N;i++){
int x;
cin >> x;
if(x>data.first&&data.second==2){
count++;
data.second=0;
}
else if(x<data.firs... | a.cc: In function 'int main()':
a.cc:7:21: error: 'mke_pair' was not declared in this scope
7 | pair<int,int>data=mke_pair(0,0);
| ^~~~~~~~
|
s096508614 | p03745 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin.tie(NULL);
ll int n;
cin>>n;
int a[n],ans=0;
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<n;i++)
{
... | a.cc: In function 'int main()':
a.cc:21:17: error: 'else' without a previous 'if'
21 | else if(i+1<n && a[i+1]>a[i])
| ^~~~
|
s223784296 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int>data(N);
for(int i:data){
cin >> data.at(i);
}
int count=1;
int j=0;
while(j<N){
int status=0;
int i=j;
while(i<N-1){
else if(data.at(i)<data.at(i+1)&&status!=2) status=1;
else if(data.at(... | a.cc: In function 'int main()':
a.cc:17:7: error: 'else' without a previous 'if'
17 | else if(data.at(i)<data.at(i+1)&&status!=2) status=1;
| ^~~~
|
s447298608 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
int main(){
int N;
cin >> N;
vector<int> A(N);
rep(i,N){
cin >> A[N];
}
int i=0;
int count=1;
while(i<N-1){
if(A[i]+1 == A[i+1]){
while(A[i] == A[i+1] || A[i]+1 == A[i+1]){
i++;
if(A[i... | a.cc: In function 'int main()':
a.cc:32:10: error: expected ';' before '}' token
32 | i++
| ^
| ;
33 | }
| ~
|
s384080885 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
int main(){
int N;
cin >> N;
vector(int) A(N);
rep(i,N){
cin >> A(N);
}
int i=0;
int count=1;
while(i<N-1){
if(A[i]+1 == A[i+1]){
while(A[i] == A[i+1] || A[i]+1 == A[i+1]){
i++;
if(A[i... | a.cc: In function 'int main()':
a.cc:8:9: error: missing template arguments before '(' token
8 | vector(int) A(N);
| ^
a.cc:8:10: error: expected primary-expression before 'int'
8 | vector(int) A(N);
| ^~~
a.cc:10:12: error: 'A' was not declared in this scope
10 | cin >> ... |
s728583890 | p03745 | C++ | int main(){
int N;
cin >> N;
vector<ll> A(N);
rep(i,N) cin >> A[i];
vector<ll> diff(N-1);
rep(i,N-1){
diff[i]=A[i+1]-A[i];
}
ll ans = 0;
rep(i,N-2){
if(diff[i]*diff[i+1]<0){
// 増減の反転
i++;
ans++;
}
}
ans++;
cout <... | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
4 | vector<ll> A(N);
| ^~~~~~
a.cc:4:12: error: 'll' was not declared in this scope
4 | vector<ll> A(N);
| ... |
s207775369 | p03745 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s796426090 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector... | a.cc: In function 'int main()':
a.cc:66:37: error: expected ']' before ')' token
66 | while(i+1 && a[i]>=a[i+1)++i;
| ^
| ]
|
s148088861 | p03745 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <vector>
#include <sstream>
#include <unordered_map>
using namespace std;
typedef long long ll;
ll ans, mx, mn, flag, sum, cnt;
int main(){
ll n;
cin>>n;
ans=1;
ll a[n];
for(ll i=0; i<n; i++){
cin>>a[i];
... | a.cc: In function 'int main()':
a.cc:30:25: error: 'increase' was not declared in this scope
30 | increase=true;
| ^~~~~~~~
|
s916941993 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>A(N);
for(int i=0;i<N;i++)
cin>>A.at(i);
int ans=1;
int a=1;
for(int i=1;i<N;i++){
if(A.at(i-1)<A.at(i)){
if(a==1){
a=0;
}else if(a==2){
ans++; a=1;
}else
a=0;
}
if(A.at(i)<A.at(i-1)){... | a.cc:29:4: error: 'cout' does not name a type
29 | }cout<<ans<<endl;
| ^~~~
a.cc:30:4: error: expected unqualified-id before 'return'
30 | return 0;
| ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
31 | }
| ^
|
s619343019 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector <int> A(N);
for (int i=0;i<N;i++){
cin >> A[i];
}
bool j=0;
int c=1
if (A[0] > A[1]){
j=1;
}
for (int i=1;i<N;i++){
if (j){
if (A[i] < A[i-1]){
continue;
}
else j=0,c++;
}
else {
if (... | a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'if'
13 | if (A[0] > A[1]){
| ^~
|
s088023778 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int i,j,k;
int 64_t N;
int 64_t a[N];
int count=0;
cin>>N>>a[N];
for(i=0;i<N-1;i=i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
count++;
for(j=i+1;j<N;j++){
if(a[j]-a[j+1]<=0){
k++;}
else if(a[j]-a[j+1]>0){
break;}
... | a.cc: In function 'int main()':
a.cc:6:7: error: expected unqualified-id before numeric constant
6 | int 64_t N;
| ^~~~
a.cc:7:7: error: expected unqualified-id before numeric constant
7 | int 64_t a[N];
| ^~~~
a.cc:9:8: error: 'N' was not declared in this scope
9 | cin>>N>>a[N... |
s643809265 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int i,j,k;
int 64_t N;
int 64_t a[N];
int count=0;
cin>>N>>a[N];
for(i=0;i<N-1;i=i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
count++;
for(j=i+1;j<N;j++){
if(a[j]-a[j+1]<=0){
k++;}
else if(a[j]-a[j+1]>0){
break;}
... | a.cc: In function 'int main()':
a.cc:6:7: error: expected unqualified-id before numeric constant
6 | int 64_t N;
| ^~~~
a.cc:7:7: error: expected unqualified-id before numeric constant
7 | int 64_t a[N];
| ^~~~
a.cc:9:8: error: 'N' was not declared in this scope
9 | cin>>N>>a[N... |
s343391447 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int 64_t N,i,j,k;
int 64_t a[N];
int count=0;
cin>>N>>a[N];
for(i=0;i<N-1;i=i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
count++;
for(j=i+1;j<N;j++){
if(a[j]-a[j+1]<=0){
k++;}
else if(a[j]-a[j+1]>0){
break;}
}}
... | a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before numeric constant
5 | int 64_t N,i,j,k;
| ^~~~
a.cc:6:7: error: expected unqualified-id before numeric constant
6 | int 64_t a[N];
| ^~~~
a.cc:8:8: error: 'N' was not declared in this scope
8 | cin>>... |
s311023465 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int N,i,j,k;
int a[N]
int count=0;
cin>>N>>a[N];
for(i=0;i<N-1;i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
for(j=i+1;j<N-1;j++){
if(a[j]-a[j+1]<=0){
k++;}
else{
count++;
break;}
}}
else if(a[i]-a[i+1]>=0... | a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
7 | int count=0;
| ^~~
a.cc:8:11: error: 'a' was not declared in this scope
8 | cin>>N>>a[N];
| ^
a.cc:17:11: error: 'count' was not declared in this scope
17 | count++;
| ... |
s271003253 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int N,i,j,k;
int a[N]
int count;
cin>>N>>a[];
for(i=0;i<N-1;i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
for(j=i+1;j<N-1;j++){
if(a[j]-a[j+1]<=0){
k++;}
else{
count++;
break;}
}}
else if(a[i]-a[i+1]>=0){
... | a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
7 | int count;
| ^~~
a.cc:8:11: error: 'a' was not declared in this scope
8 | cin>>N>>a[];
| ^
a.cc:8:13: error: expected primary-expression before ']' token
8 | cin>>N>>a[];
| ... |
s539303907 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int a[N],N,i,j,k;
int count;
cin>>N>>a[];
for(i=0;i<N-1;i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
for(j=i+1;j<N-1;j++){
if(a[j]-a[j+1]<=0){
k++;}
else{
count++;
break;}
}}
else if(a[i]-a[i+1]>=0){
for(... | a.cc: In function 'int main()':
a.cc:5:9: error: 'N' was not declared in this scope
5 | int a[N],N,i,j,k;
| ^
a.cc:7:11: error: 'a' was not declared in this scope
7 | cin>>N>>a[];
| ^
a.cc:7:13: error: expected primary-expression before ']' token
7 | cin>>N>>a[];
| ... |
s904354686 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int a[],N,i,j,k;
int count;
cin>>N>>a[];
for(i=0;i<N-1;i+k+2){
k=0;
if(a[i]-a[i+1]<=0){
for(j=i+1;j<N-1;j++){
if(a[j]-a[j+1]<=0){
k++;}
else{
count++;
break;}
}}
else if(a[i]-a[i+1]>=0){
for(j... | a.cc: In function 'int main()':
a.cc:5:7: error: storage size of 'a' isn't known
5 | int a[],N,i,j,k;
| ^
a.cc:7:13: error: expected primary-expression before ']' token
7 | cin>>N>>a[];
| ^
|
s632649863 | p03745 | C++ | #include <vector>
using namespace std;
int main() {
int N; cin >> N;
vector<int> A(N);
for (int i = 0; i < N; ++i) cin>>A[i];
int res = 0;
for (int i = 0; i < N; ++i) {
while (i+1 < N && A[i] == A[i+1]) ++i;
if (i+1 < N && A[i] < A[i+1]) {
while (i+1 < N... | a.cc: In function 'int main()':
a.cc:5:12: error: 'cin' was not declared in this scope
5 | int N; cin >> N;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 | ... |
s679288858 | p03745 | C++ | #include <vector>
using namespace std;
int main() {
int N; cin >> N;
vector<int> A(N);
for (int i = 0; i < N; ++i) cin >> A[i];
int res = 0;
for (int i = 0; i < N; ++i) {
// same を抜ける
while (i+1 < N && A[i] == A[i+1]) ++i;
// up
if (i+1 < N && A[i] < A[i+1]) {
... | a.cc: In function 'int main()':
a.cc:5:12: error: 'cin' was not declared in this scope
5 | int N; cin >> N;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 | ... |
s628953780 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
... | a.cc:113:10: error: redefinition of 'const ll INF'
113 | const ll INF = 1LL << 60;
| ^~~
a.cc:15:10: note: 'const ll INF' previously defined here
15 | const ll INF = 1LL << 60;
| ^~~
a.cc:114:11: error: redefinition of 'const int k_mod'
114 | const int k_mod = 1e9 + 7;
| ... |
s552594090 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int A[N];
for (int i = 0; i < N; i++) cin >> A[i];
int ans = 0;
for (int i = 0; i < N; i++){
while (i+1 <= N; && A[i] == A[i+1]) i++;
if (A[i] > A[i+1]) {
while (A[i] >= A[i+1]) i++;
} else if (A[i] < A[i+1]) {
... | a.cc: In function 'int main()':
a.cc:13:20: error: expected ')' before ';' token
13 | while (i+1 <= N; && A[i] == A[i+1]) i++;
| ~ ^
| )
a.cc:13:26: error: expected ';' before '[' token
13 | while (i+1 <= N; && A[i] == A[i+1]) i++;
| ... |
s035407409 | p03745 | C++ | #include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <lim... | a.cc:201:21: error: redefinition of 'const long long int mod'
201 | const long long int mod = 1000000007;
| ^~~
a.cc:81:21: note: 'const long long int mod' previously defined here
81 | const long long int mod = 1000000007;
| ^~~
a.cc:202:21: error: redefinition o... |
s441831040 | p03745 | C | // 161-C Replacing Integer
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
// qsortで用いる比較用関数.*a<*bならaが先になる.
int compare(const void* a, const void* b) {
return -1 * (*(int*)a - *(int*)b);
}
in... | main.c: In function 'main':
main.c:21:5: error: unknown type name 'bool'
21 | bool isReset = false;
| ^~~~
main.c:11:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
10 | #include <stdlib.h>
+++ |+#include <stdbool.h>
11 |
main.c:21:... |
s566772615 | p03745 | C | // 161-C Replacing Integer
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
// qsortで用いる比較用関数.*a<*bならaが先になる.
int compare(const void* a, const void* b) {
return -1 * (*(int*)a - *(int*)b);
}
in... | main.c: In function 'main':
main.c:21:5: error: unknown type name 'bool'
21 | bool isReset = false;
| ^~~~
main.c:11:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
10 | #include <stdlib.h>
+++ |+#include <stdbool.h>
11 |
main.c:21:... |
s384205366 | p03745 | C | // 161-C Replacing Integer
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
int main() {
int n,i,cnt=1,diff;
int* a;
bool isReset = false;
scanf("%d", &n);
if (n == 1) {
... | main.c: In function 'main':
main.c:15:5: error: unknown type name 'bool'
15 | bool isReset = false;
| ^~~~
main.c:11:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
10 | #include <stdlib.h>
+++ |+#include <stdbool.h>
11 |
main.c:15:... |
s012583887 | p03745 | C | // 161-C Replacing Integer
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
// qsortで用いる比較用関数.*a<*bならaが先になる.
int compare(const void* a, const void* b) {
return -1 * (*(int*)a - *(int*)b);
}
in... | main.c: In function 'main':
main.c:21:5: error: unknown type name 'bool'
21 | bool isReset = false;
| ^~~~
main.c:11:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
10 | #include <stdlib.h>
+++ |+#include <stdbool.h>
11 |
main.c:21:... |
s248223336 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, L, T;
float X[110000];
int W[110000];
int main () {
cin >> N >> L >> T;
for (int i = 1; i < N + 1; i++) cin >> X[i] >> W[i];
for (float t = 0.5; t <= T; t += 0.5) {
//t秒のときの位置へ移動
for (int i = 1; i < N + 1; i++) {
if (W[i] == 1) {
X[i]... | a.cc: In function 'int main()':
a.cc:42:22: error: expected ';' before '}' token
42 | cout << (int)X[i]
| ^
| ;
43 | }
| ~
|
s535967633 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N-1);
for (int i = 0; i < N; i++){
cin >> A.at(i);
}
for (int i = 0; i < N-1; i++){
B.at(i) = A.at(i+1) - A.at(i);
}
queue<int> q;
for ... | a.cc: In function 'int main()':
a.cc:44:27: error: expected '}' at end of input
44 | cout << count << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s240372068 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,S=0,i;cin>>N;int A[N];
for(i=0;i<N;i++)cin>>A[i];
i=0;
while(i<N){
S++;int j=i+1,x=0;
while(j<N-1&&(A[j]-[j+1])*x>=0){
if(A[j]!=A[j+1]){
if(A[j]>A[j+1])x++;
else x--;
}
j++;
}
i=j+1;
}
cout<<S<<... | a.cc: In function 'int main()':
a.cc:9:26: error: expected ',' before '+' token
9 | while(j<N-1&&(A[j]-[j+1])*x>=0){
| ^
| ,
a.cc:9:26: error: expected identifier before '+' token
a.cc: In lambda function:
a.cc:9:29: error: expected '{' before ')' to... |
s344988245 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,S=0,i;cin>>N;int A[N];
for(i=0;i<N;i++)cin>>A[i];
i=0;
while(i<N){
S++;int j=i+1;int x=0;
while(j<N-1&&(A[j]-[j+1])*x>=0){
if(A[j]!=A[j+1]){
if(A[j]>A[j+1])x++;
else x--;
}
j++;
}
i=j+1;
}
cout<... | a.cc: In function 'int main()':
a.cc:9:26: error: expected ',' before '+' token
9 | while(j<N-1&&(A[j]-[j+1])*x>=0){
| ^
| ,
a.cc:9:26: error: expected identifier before '+' token
a.cc: In lambda function:
a.cc:9:29: error: expected '{' before ')' to... |
s091527667 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,S=0;cin>>N;int A[N];
for(int i=0;i<N;i++)cin>>A[i];
for(int i=1;i<N;i++){
int j=i;
while((T.at(i-1)-T.at(i))*(T.at(j-1)-T.at(j))>=0)j++;
i=j-1;
}
} | a.cc: In function 'int main()':
a.cc:8:12: error: 'T' was not declared in this scope
8 | while((T.at(i-1)-T.at(i))*(T.at(j-1)-T.at(j))>=0)j++;
| ^
|
s624730751 | p03745 | C++ | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1,... | a.cc: In function 'int main()':
a.cc:84:9: error: redeclaration of 'int i'
84 | int i=0;
| ^
a.cc:63:9: note: 'int i' previously declared here
63 | int i=0;
| ^
a.cc:100:19: error: 'an1s' was not declared in this scope; did you mean 'ans1'?
100 | if(count){an1s++;i++;... |
s085048985 | p03745 | C++ | {
//ifstream in("subtask_1_02.txt");
//cin.rdbuf(in.rdbuf());
cin >> N;
for (int i = 0; i < N; i++) cin >> A[i];
int counter = 0;
for (int i = 0; i < N; i++){
while (i+1 < N && A[i] == A[i+1]) i++;
if (i+1 < N && A[i] < A[i+1]){
while (i+1 < N && A[i] <= A[i+1]) i++;... | a.cc:1:1: error: expected unqualified-id before '{' token
1 | {
| ^
|
s785637642 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> a(N);
for(int i = 0; i < N; i++) cin << a[i];
int ans = 1;
int pm = 0;
for(int i = 1; i < N; i++){
int npm = 0;
if(a[i] > a[i-1]) npm = 1;
else if(a[i] == a[i-1]) npm = 0;
else npm = -1;
... | a.cc: In function 'int main()':
a.cc:11:34: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
11 | for(int i = 0; i < N; i++) cin << a[i];
a.cc:11:34: note: candidate: 'operator<<(in... |
s963785962 | p03745 | C | (f+=NR~2||p>$1)*(t+=p<p=$1){f=t=!++s}{RS=FS}/\n/,$1=s | main.c:1:3: error: expected ')' before '+=' token
1 | (f+=NR~2||p>$1)*(t+=p<p=$1){f=t=!++s}{RS=FS}/\n/,$1=s
| ^~
| )
main.c:1:38: error: expected identifier or '(' before '{' token
1 | (f+=NR~2||p>$1)*(t+=p<p=$1){f=t=!++s}{RS=FS}/\n/,$1=s
| ^
main.c:1:4... |
s196298309 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int sign(long long int num) {
if (num<0) {
return -1;
}
else if(num > 0) {
return 1;
}
else {
return 0;
}
}
int main() {
long long int n;
cin >> n;
vector<long long int> list(n);
for (long long int i=0;i<n;i++) {
cin >> list.at(i);
}
... | a.cc: In function 'int main()':
a.cc:33:10: error: 'judge' was not declared in this scope
33 | if(judge==0) {
| ^~~~~
a.cc:34:9: error: 'judege' was not declared in this scope
34 | judege = sign(list.at(i)-list.at(i-1));
| ^~~~~~
a.cc:36:12: error: 'judge' was not declar... |
s078881217 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
vector<long long int> list(n);
for (long long int i=0;i<n;i++) {
cin >> list.at(i);
}
long long int count=1;
long long int len=0;
for (long long int i=0;i<n-1;i++) {
len++;
//cout << len << endl;
if (le... | a.cc: In function 'int main()':
a.cc:18:18: error: too few arguments to function 'void (* signal(int, __sighandler_t))(int)'
18 | if ( signal(list.at(i)-list.at(i-1)) * signal(list.at(i+1)-list.at(i)) < 0 ) {
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/csignal:4... |
s957288000 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
vector<long long int> list(n);
for (long long int i=0;i<n;i++) {
cin >> list.at(i);
}
long long int count=1;
long long int len=0;
for (long long int i=0;i<n-1;i++) {
len++;
//cout << len << endl;
if (le... | a.cc: In function 'int main()':
a.cc:18:12: error: 'sign' was not declared in this scope; did you mean 'sin'?
18 | if ( sign(list.at(i)-list.at(i-1)) * sign(list.at(i+1)-list.at(i)) < 0 ) {
| ^~~~
| sin
|
s387717365 | p03745 | C++ | //code by lynmisakura.wish to be accepted!
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <li... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s201982623 | p03745 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin >> n;
int flag=0; //0:なし, 1:減少, 2:増加
ll preNum, cnt=1,;
cin >> preNum;
for(int i=1; i<n; i++){
ll Num;
cin >> Num;
if(Num == preNum) break;
... | a.cc: In function 'int main()':
a.cc:13:22: error: expected unqualified-id before ';' token
13 | ll preNum, cnt=1,;
| ^
|
s984330396 | p03745 | C++ | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using ch char;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
void Solve();
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
cout<<setprecision(20)<<fixed;
So... | a.cc:9:7: error: expected nested-name-specifier before 'ch'
9 | using ch char;
| ^~
a.cc:10:15: error: 'ch' was not declared in this scope
10 | using vch = V<ch>;
| ^~
a.cc:10:17: error: template argument 1 is invalid
10 | using vch = V<ch>;
| ^
a.cc: In f... |
s916503503 | p03745 | C++ | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
void Solve();
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
cout<<setprecision(20)<<fixed;
Solve();
}
/***... | a.cc:9:15: error: 'ch' was not declared in this scope
9 | using vch = V<ch>;
| ^~
a.cc:9:17: error: template argument 1 is invalid
9 | using vch = V<ch>;
| ^
a.cc: In function 'void Solve()':
a.cc:32:3: error: 'vll' was not declared in this scope; did you mean 'll'?
... |
s093616654 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, ans;
cin >> n;
vector<int>a(n);
cin >> a.at(0) >> a.at(1);
bool up=false;
bool down=false;
if(a.at(0)>a.at(1))up=true;
if(a.at(0)<a.at(1))down=true;
for(int i=2;i<n;i++){
cin >> a(i);
if(up&&a.at(i-1)>a.at(i)){
ans++;
... | a.cc: In function 'int main()':
a.cc:13:13: error: no match for call to '(std::vector<int>) (int&)'
13 | cin >> a(i);
| ~^~~
|
s412903604 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, ans;
cin >> n
vector<int>a(n);
cin >> a.at(0) >> a.at(1);
bool up=false;
bool down=false;
if(a.at(0)>a.at(1))up=true;
if(a.at(0)<a.at(1))down=true;
for(int i=2;i<n;i++){
cin >> a(i);
if(up&&a.at(i-1)>a.at(i)){
ans++;
u... | a.cc: In function 'int main()':
a.cc:5:11: error: expected ';' before 'vector'
5 | cin >> n
| ^
| ;
6 | vector<int>a(n);
| ~~~~~~
a.cc:7:10: error: 'a' was not declared in this scope
7 | cin >> a.at(0) >> a.at(1);
| ^
|
s345207075 | p03745 | C++ | #include<bits/stdc++.h>
int main(){
int n, ans;
cin >> n
vector<int>a(n);
cin >> a.at(0) >> a.at(1);
bool up=false;
bool down=false;
if(a.at(0)>a.at(1))up=true;
if(a.at(0)<a.at(1))down=true;
for(int i=2;i<n;i++){
cin >> a(i);
if(up&&a.at(i-1)>a.at(i)){
ans++;
up=false;down=true;
... | a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin >> n
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::... |
s257473354 | p03745 | C++ | include<bits/stdc++.h>
typedef rep(i,n) for(int i=0;i<n;)
int main(){
int N; cin>>N;
vector<int> a(n);
rep(i,N) cin>>a[i];
int count=0;
rep(i,n-1){
if(a[i+1]>=a[i]){
while(a[i+1]>=a[i]){
i++;
if(i<n || a[i+1]<a[i]){
count++;
... | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc:2:30: error: 'i' does not name a type
2 | typedef rep(i,n) for(int i=0;i<n;)
| ^
a.cc:2:34: error: expected unqualified-id before ')' token
2 | typedef rep(i,n) for(int i=0;i<n;... |
s189998266 | p03745 | C++ | #include <iostream>
using namespace std;
//https://atcoder.jp/contests/abc001/submissions/5701454
int main(){
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; ++i)
{
cin >> a[i];
}
//単調 >0: 増加, <0: 減少, 0:未決定
int tan = 0;
int cnt = 1;
for(int i = 0; i < n-1; ++i)
... | a.cc: In function 'int main()':
a.cc:24:16: error: 's' was not declared in this scope
24 | if(s[i] < s[i+1])tan = 1;
| ^
a.cc:25:16: error: 's' was not declared in this scope
25 | if(s[i] > s[i+1])tan = -1;
| ^
a.cc:29:16: error: 's' was not declar... |
s656772460 | p03745 | Java | //ABC13_C
/*
8
1000 1000 1 1000 1000 1 3 2 4
*/
import java.util.Scanner;
public class ABC13_C{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
scan.nextLine();
int arr[] = new int[N];
for (int i=0; i<N; i++) {
arr[i] = scan.nextInt();
}
... | Main.java:10: error: class ABC13_C is public, should be declared in a file named ABC13_C.java
public class ABC13_C{
^
1 error
|
s070610638 | p03745 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n, inc, ans1 = 1, ans2 = 1;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
inc = (a[0] <= a[1] ? 1 : 2);
for (int i = 2; i < n; i++) {
if (inc == ... | a.cc:50:28: error: stray '@' in program
50 | cout << min(ans1, ans2)@ << endl;
| ^
|
s582014656 | p03745 | C++ | #include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
static const long double GRATIO=(long double)(1+sqrt(5))/2;
ll GCD(... | a.cc: In function 'int main()':
a.cc:29:24: error: expected primary-expression before '>' token
29 | else if(A[i-1]=>A[i]&&A[i]<A[i+1]){
| ^
|
s911648228 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i= 0; i < n; ++i) cin >> a[i];
int flag = 0, ans = 0;
int i = 0;
while(i < n){
if(a[i] == a[i+1])i++;
else if(a[i] < a[i+1]){
if(flag == 0) {flag = 1; i++;}
else if (flag == 1) i++;
els... | a.cc: In function 'int main()':
a.cc:17:31: error: expected ';' before '}' token
17 | else{ans++; i++; flag =0}
| ^
| ;
a.cc:22:33: error: expected ';' before '}' token
22 | else {ans++; i++; flag = 0}
| ... |
s748929452 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i= 0; i < n; ++i) cin >> a[i];
int flag = 0, ans = 0;
int i = 0;
while(i < n){
if(a[i] == a[i+1])i++;
else if(a[i] < a[i+1]){
if(flag == 0) {flag = 1; i++;}
else if (flag == 1) i++;
els... | a.cc: In function 'int main()':
a.cc:17:31: error: expected ';' before '}' token
17 | else{ans++; i++; flag =0}
| ^
| ;
a.cc:22:33: error: expected ';' before '}' token
22 | else {ans++; i++; flag = 0}
| ... |
s255240268 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i= 0; i < n; ++i) cin >> a[i];
int flag = 0, ans = 0;
int i = 0;
while(i < n){
if(a[i] == a[i+1])i++;
else if(a[i] < a[i+1]){
if(flag == 0) {flag = 1; i++;}
else if (flag == 1) i++;
els... | a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before '}' token
17 | else{ans++; i++}
| ^
| ;
|
s474532856 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i= 0; i < n; ++i) cin >> a[i];
int flag = 0, ans = 0;
int i = 0;
while(i < n){
if(a[i] == a[i+1])i++;
else if(a[i] < a[i+1]){
if(flag == 0) {flag = 1; i++}
else if (flag == 1) i++;
else... | a.cc: In function 'int main()':
a.cc:15:35: error: expected ';' before '}' token
15 | if(flag == 0) {flag = 1; i++}
| ^
| ;
a.cc:17:22: error: expected ';' before '}' token
17 | else{ans++; i++}
| ... |
s942792224 | p03745 | C++ | int main(){
int N;
cin >> N;
long A[N];
int cnt = 0;
for (int i=0;i<N;++i){
cin >> A[i];
if (i>1){
if(A[i-2]<A[i-1]) {
if(A[i-1]>A[i]) cnt++;
} else if(A[i-2]>A[i-1]) {
if(A[i-1]>A[i]) cnt++;
}
}
}
co... | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
16 | cout << cnt+1 << endl;
| ^~~~
a.cc:16:22: error: 'endl' was not declared in this scope
16 | cout << cnt+1 << en... |
s152431977 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N+1,0);
bool iflag = false, dflag = false;
int ans = 0;
for(int i = 0; i < N; i++){
if(A[i] < A[i+1]){
if(dfalg){
ans++;
dflag = false;
... | a.cc: In function 'int main()':
a.cc:14:16: error: 'dfalg' was not declared in this scope; did you mean 'dflag'?
14 | if(dfalg){
| ^~~~~
| dflag
a.cc:22:16: error: 'ifalg' was not declared in this scope; did you mean 'iflag'?
22 | if(ifalg){
... |
s675595883 | p03745 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll N; cin >> N;
vector<ll> A(N);
for(ll i = 0; i < N; i++){
cin >> A[i];}
if( N >= 3){
ll cnt = 0;
for(ll i = 2w; i < N - 2; ){
if( A[i] > A[i-1] && A[i] > A[i+1]){ cnt++; i += 2;}
else if( A[i] < ... | a.cc: In function 'int main()':
a.cc:16:16: error: unable to find numeric literal operator 'operator""w'
16 | for(ll i = 2w; i < N - 2; ){
| ^~
|
s533475123 | p03745 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N);
for(int i=0; i<N; i++) cin >> A[i];
ll ans = 1;
for(int i=1; i<N-1; i++){
if((A[i-1]<A[i]&&A[i+1]<A[i]) || (A[i]<A[i-1]&&A[i]<A[i+1])) ans++;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:3: error: 'll' was not declared in this scope
11 | ll ans = 1;
| ^~
a.cc:13:66: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | if((A[i-1]<A[i]&&A[i+1]<A[i]) || (A[i]<A[i-1]&&A[i]<A[i+1])) ans++;
| ... |
s901050499 | p03745 | C++ |
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;cin>>n;
vector<int> A(n);
for(int i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
int res=0;
for(int i=0;i<n;++i)
{
//sameを抜ける
while(i+1<n && A[i]==A[i+1])++i;
//単調非減少
if(i+1<N &... | a.cc: In function 'int main()':
a.cc:24:16: error: 'N' was not declared in this scope
24 | if(i+1<N && A[i]<A[i+1])
| ^
|
s062604629 | p03745 | C++ |
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;cin>>n;
vector<int> A(n);
for(int i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
int res=0;
for(int i=0;i<n;++i)
{
//sameを抜ける
while(i+1<n; && A[i]==A[i+1])++i;
//単調非減少
if(i+1<N ... | a.cc: In function 'int main()':
a.cc:21:20: error: expected ')' before ';' token
21 | while(i+1<n; && A[i]==A[i+1])++i;
| ~ ^
| )
a.cc:21:26: error: expected ';' before '[' token
21 | while(i+1<n; && A[i]==A[i+1])++i;
| ... |
s615182473 | p03745 | C++ |
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;cin>>n;
vector<int> A(n);
for(int i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
int res=0;
for(int i=0;i<n;++i)
{
//sameを抜ける
while(i+1<n; && A[i]==A[i+1])++i;
//単調非減少
if(i+1<N ... | a.cc: In function 'int main()':
a.cc:21:20: error: expected ')' before ';' token
21 | while(i+1<n; && A[i]==A[i+1])++i;
| ~ ^
| )
a.cc:21:26: error: expected ';' before '[' token
21 | while(i+1<n; && A[i]==A[i+1])++i;
| ... |
s970740548 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
for (int i=0; i<n; i++){
cin >> a.at(i);
}
int cnt = 1, flag = 0;
for (int i=0; i<n-1; i++){
if (i == 0 || flag == 2){
if (a[i] < a[i+1]){
flag = 0;
}
else if (a[i] > a[... | a.cc: In function 'int main()':
a.cc:28:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | ans++;
| ^~~
| abs
a.cc:33:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
33 | ans++;
| ^~~
| abs
a.cc:38:11... |
s478906030 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))
ty... | a.cc: In function 'int main(int, char**)':
a.cc:28:21: error: expected ')' before '[' token
28 | while ( && A[i] == A[i+1]) ++i;
| ~ ^
| )
a.cc: In lambda function:
a.cc:28:25: error: expected '{' before '==' token
28 | while ( && A[i] == A[i+1]) +... |
s517263849 | p03745 | C++ | #include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int main(void){
int N;
cin >> N;
long long int A[N], divide = 1;
for(int i=0; i<N; i++)
cin >> A[i];
for(int i=0; i<N-1; i++){
while(A[i] == A[i+1])
i++;
if(i+1<N&&a[i]<a[i+1]){
while(i+1<N&&a[i]<=a[i+1]) i++;
}
else... | a.cc: In function 'int main()':
a.cc:21:27: error: 'a' was not declared in this scope
21 | if(i+1<N&&a[i]<a[i+1]){
| ^
|
s937065309 | p03745 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main() {
int N, a, b, ans = 0;
bool first = true, up;
cin >> N >> a;
rep(i, N-1) {
cin >> b;
if (a == b) continue;
if (first) {
up = a < b
first = false;
}
... | a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before 'first'
13 | up = a < b
| ^
| ;
14 | first = false;
| ~~~~~
|
s052307664 | p03745 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <string>
#include <string.h>
#include <deque>
#include <functional>
#include <tuple>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vect... | a.cc:63:16: error: 'LLONG_MAX' was not declared in this scope
63 | const ll INF = LLONG_MAX;
| ^~~~~~~~~
a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
11 | #include <functional>
+++ |+#include <climits>
12 | #includ... |
s085201480 | p03745 | C++ | #include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define mp make_pair
#define timer ((double)clock() / CLOCKS_PER_SEC)
#define endl "\n"
#define spc " "
#define d1(x) cerr<<#x<<":"<<x<<endl
... | a.cc: In function 'int main()':
a.cc:36:24: error: 't' was not declared in this scope
36 | cin >> t[i];
| ^
a.cc:40:20: error: 't' was not declared in this scope
40 | if(t[i] == t[i + 1])
| ^
|
s494538823 | p03745 | C++ | //todo 文字数を少なくする
//mintより高速に計算したい時用に modmul() modadd (正の値限定) を作る
//#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>
using namespace std;
//@起動時
struct initon {
initon() {
cin.tie(0);
ios::sync_with_stdio(false);
cout.setf(ios::fixed);
cout.precision(16);
srand((unsigned)... | a.cc:2751:8: error: redefinition of 'struct initon'
2751 | struct initon {
| ^~~~~~
a.cc:7:8: note: previous definition of 'struct initon'
7 | struct initon {
| ^~~~~~
a.cc:2759:3: error: conflicting declaration 'int __initon'
2759 | } __initon;
| ^~~~~~~~
a.cc:15:3: note: previo... |
s081640828 | p03745 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i++)cin >> a[i];
int b[n];
for(int i = 0; i < n-1; i++)b[i] = a[i+1]-a[i];
int cnt = 1;
for(int i = 1; i < n-1; i++){
if(b[i]*b[i-1]<0 && sign(b[i]) != 0 && sign(b[i-1]) != 0){
cnt += 1;
... | a.cc: In function 'int main()':
a.cc:15:25: error: 'sign' was not declared in this scope; did you mean 'signed'?
15 | if(b[i]*b[i-1]<0 && sign(b[i]) != 0 && sign(b[i-1]) != 0){
| ^~~~
| signed
|
s807042762 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
vector<long long> A(N);
vector<int> A1(0)
for (int i = 0; i<N; i++) cin >> A[i];
for (int i = 0; i<N-1; i++) {
if(A[i+1]>A[i]) A1.push_back(1);
else if(A[i+1]<A[i]) A1.push_back(-1);
}
int cnt = 0;
for (int i = 0; i<A1.... | a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i = 0; i<N; i++) cin >> A[i];
| ^~~
a.cc:8:19: error: 'i' was not declared in this scope
8 | for (int i = 0; i<N; i++) cin >> A[i];
| ^
|
s879516990 | p03745 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#def... | a.cc: In function 'int main()':
a.cc:33:15: error: cannot convert 'std::vector<long long int>' to 'int' in initialization
33 | rep(i,A){
| ^
| |
| std::vector<long long int>
a.cc:9:40: note: in definition of macro 'rep'
9 | #define rep(i,n) for(... |
s254029613 | p03745 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc: In function 'int main()':
a.cc:31:17: error: 'n' was not declared in this scope
31 | while(i+1<n&&A[i]==A[i+1]) i++;
| ^
a.cc:32:13: error: 'n' was not declared in this scope
32 | if(i==n-1) break;
| ^
a.cc:34:19: error: 'n' was not declared in this scope
... |
s903922644 | p03745 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc: In function 'int main()':
a.cc:31:17: error: 'n' was not declared in this scope
31 | while(i+1<n&&a[i]==a[i+1]) i++;
| ^
a.cc:31:20: error: 'a' was not declared in this scope
31 | while(i+1<n&&a[i]==a[i+1]) i++;
| ^
a.cc:32:13: error: 'n' was not de... |
s018504073 | p03745 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc: In function 'int main()':
a.cc:26:15: error: cannot convert 'std::vector<long long int>' to 'll' {aka 'long long int'} in initialization
26 | rep(i,A){
| ^
| |
| std::vector<long long int>
a.cc:4:39: note: in definition of macro 'rep'
4 | ... |
s771410850 | p03745 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#def... | a.cc:11:9: warning: "rep" redefined
11 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
| ^~~
a.cc:2:9: note: this is the location of the previous definition
2 | #define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
| ^~~
a.cc: In function 'int main()':
a.cc:33:15: err... |
s220338909 | p03745 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#def... | a.cc: In function 'int main()':
a.cc:33:15: error: cannot convert 'std::vector<long long int>' to 'int' in initialization
33 | rep(i,A){
| ^
| |
| std::vector<long long int>
a.cc:9:40: note: in definition of macro 'rep'
9 | #define rep(i,n) for(... |
s019304130 | p03745 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s720672087 | p03745 | C++ | #include<bits/stdc++.h>
sing namespce std;
#tyepdef long long ll;
int main(){
ll N;
cin>>N;
vctor<ll> A{
}(N);
for(ll i=0;i<N;i++){
cin>>A[i];
}
bool up=false,down=false;
int CNT=1;
for(ll i-1;i<N;i++){
if(A[i]>A[i-1]){
up=true;
if(down){
CNT++;
up=false;
... | a.cc:3:2: error: invalid preprocessing directive #tyepdef
3 | #tyepdef long long ll;
| ^~~~~~~
a.cc:2:1: error: 'sing' does not name a type
2 | sing namespce std;
| ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
6 | ll N;
| ^~
a.cc:7:3: error... |
s196946638 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int getSign(int i){
int res=(i==0:0?(i>0:1?-1));
return res;
}
int main(){
int N;
cin >> N;
vector<int> A(N);
for (int i=0;i<N;i++){
cin >> A[i];
}
int pre=A[0];
int sign0=0;
int sign1;
int cnt=1;
for (int i=1;i<N;i++){
sign1=getS... | a.cc: In function 'int getSign(int)':
a.cc:5:18: error: expected ')' before ':' token
5 | int res=(i==0:0?(i>0:1?-1));
| ~ ^
| )
|
s954213365 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int getSign(int i){
return (i==0:0?(i>0:1?-1));}
int main(){
int N;
cin >> N;
vector<int> A(N);
for (int i=0;i<N;i++){
cin >> A[i];
}
int pre=A[0];
int sign0=0;
int sign1;
int cnt=1;
for (int i=1;i<N;i++){
sign1=getSign(A[i]-pre);
if(sig... | a.cc: In function 'int getSign(int)':
a.cc:5:17: error: expected ')' before ':' token
5 | return (i==0:0?(i>0:1?-1));}
| ~ ^
| )
|
s651490727 | p03745 | C++ | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int ans=1;
int flag=0;
int bef;
cin>>bef;
for(int i=1;i<n;i++)
{
int a;
cin>>a;
if(flag==0)
{
if(a>bef)flag=1;
if(a<bef)flag=2;
}
else if(flag==1)
{
if(a<bef)
{
ans++;
... | a.cc: In function 'int main()':
a.cc:40:3: error: 'cour' was not declared in this scope
40 | cour<<ans<<endl;
| ^~~~
|
s473161075 | p03745 | C |
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define ll long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000//10^12
int main(void)
{
//変数の宣言
int n;
int a[100010];
//よく... | main.c: In function 'main':
main.c:39:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
39 | scanf_s("%d",&a[i]);
| ^~~~~~~
| scanf
|
s968293191 | p03745 | C++ | int main() {
int n;
cin >> n;
long a[110000];
bool u;
bool d;
int c = 1;
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 0; i < n - 1; i++)
{
if(a[i] < a[i+1]) u = true;
if(a[i] > a[i+1]) d = true;
if(u && d){
u = d = false;
c++;... | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> n;
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope
18 | cout << c << endl;
| ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope
18 | cout << c << endl;
... |
s026007460 | p03745 | C++ | #include <stdio.h>
#include <cstdlib>
#include <iostream>
using namespace std;
int count(const int *array, int size) {
enum Arranged {
None = -1,
Ascending,
Descending
};
int splitNum = 0;
Arranged arranged = array[0] < array[1] ? Ascending : Descending;
Arranged prevState... | a.cc: In function 'int main()':
a.cc:39:23: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
39 | for (int i = 0; i < size; ++i) cin>>array[i];
| ~~^~~~~~
|
s449412981 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i ++) {
cin >> a.at(i);
}
decltype(v)::iterator result = unique(a.begin(), a.end());
a.erase(result, a.end());
int cnt = 1;
for (int i = 1; i < a.size(); i ++) {
bool incre1 =... | a.cc: In function 'int main()':
a.cc:11:12: error: 'v' was not declared in this scope
11 | decltype(v)::iterator result = unique(a.begin(), a.end());
| ^
a.cc:11:25: error: expected initializer before 'result'
11 | decltype(v)::iterator result = unique(a.begin(), a.end());
| ... |
s754809820 | p03745 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,a[100010];
int main(){
cin>>n;
for(int i=0;i<n;++i){cin>>k[i];}
long long ans=1,mon=0;
for(int i=0;i<n-1;++i){
if(mon==0){
if(k[i]<k[i+1])
mon=1;
else if(k[i]>k[i+1])
mon=-1;
}
else if(mon>0){
if(k[i]>k[i+1])... | a.cc: In function 'int main()':
a.cc:6:29: error: 'k' was not declared in this scope
6 | for(int i=0;i<n;++i){cin>>k[i];}
| ^
a.cc:10:10: error: 'k' was not declared in this scope
10 | if(k[i]<k[i+1])
| ^
a.cc:16:10: error: 'k' was not declared in this sco... |
s959556827 | p03745 | C++ | #include<iostream>
using namespace std;
int main()
{
long long n,a[10005],cnt=1,flag=2;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<n;i++)
{
if(a[i]<a[i+1]&&flag!=1) flag=0;
if(a[i]>a[i+1]&&flag!=0) flag=1;
if(a[i]<a[i+1]&&flag==1)
{
cnt++;
flag=2;
}
if(a[i]>a[i+1]&&flag==0)
{
cnt... | a.cc:26:25: error: 'flag' does not name a type
26 | flag=2;
| ^~~~
a.cc:27:17: error: expected declaration before '}' token
27 | }
| ^
a.cc:28:17: error: expected unqualified-id before 'if'
28 | if(a[i]>... |
s847732854 | p03745 | C++ | import pdb
def main():
num = int(input())
array = []
tmp = input()
for i in range(num):
array.append(int(tmp.split()[i]))
ans = 1
div = 0
prev = 0
count = 0
#pdb.set_trace()
for tmp in array:
if(count == 0):
prev = tmp
count = 1... | a.cc:16:6: error: invalid preprocessing directive #pdb
16 | #pdb.set_trace()
| ^~~
a.cc:45:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
45 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
1 | im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.