submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s643489911 | p04034 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) ... | a.cc: In function 'int main()':
a.cc:46:12: error: expected '(' before '{' token
46 | else if{
| ^
| (
|
s038641248 | p04034 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) ... | a.cc: In function 'int main()':
a.cc:33:7: error: 'i' was not declared in this scope
33 | ANS[i]=1;
| ^
|
s536043695 | p04034 | C++ | #include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(i... | a.cc: In function 'int main()':
a.cc:78:39: error: no matching function for call to 'std::vector<std::pair<int, int> >::vector(int&, int)'
78 | vector<pair<int,int>> c(b),d(a,(1,0));
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/incl... |
s739637136 | p04034 | C++ | #pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(... | a.cc: In function 'int main()':
a.cc:67:13: error: redeclaration of 'int res'
67 | int res = accumulate(b+1,b+n+1,res);
| ^~~
a.cc:66:13: note: 'int res' previously declared here
66 | int res = 0;
| ^~~
|
s148938071 | p04034 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define ... | a.cc: In function 'int main()':
a.cc:35:13: error: 'r' was not declared in this scope
35 | r = y[i];
| ^
|
s207530666 | p04034 | Java |
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Jiakang Chen
*/
public class AGC_002B {
public static void main(String[] args) {
... | Main.java:14: error: class AGC_002B is public, should be declared in a file named AGC_002B.java
public class AGC_002B {
^
1 error
|
s040559743 | p04034 | C++ | #include <iostream>
#include <vector>
#include <queue>
struct edge{
int to;
long long cost;
};
using namespace std;
//ダイクストラで多用する型
typedef pair<long long, int> P;//(その頂点までの距離,頂点)として使う。
vector<edge> G[100000];//頂点iから出る辺の配列G[i]の配列。
vector<int> dist(100000,-1);//特定の頂点から各頂点への距離が格納される。
bool used[100000];//dijkst... | a.cc: In function 'int main()':
a.cc:46:7: error: 'i' was not declared in this scope
46 | REP(i,m){
| ^
a.cc:46:3: error: 'REP' was not declared in this scope
46 | REP(i,m){
| ^~~
|
s414869610 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int n,m,i,x,y,ans=1;
cin >> n >> m;
vector<int> box(n+5,1);
vector<bool> can(n+5,false);
can.at(1)=true;
for (i=0;i<m;i++){
cin >> x >> y;
box.at(x)--;
box.at(y)++;
if (!can.at(y)){
can.at(y)=true;
ans++;
}
if ... | a.cc: In function 'int main()':
a.cc:23:12: error: expected '}' at end of input
23 | return 0;
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s459247666 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
signed main(){
lli n,m;
cin>>n>>m;
lli flag[100100];
lli boal[100100];
REP(i,0,100100){
flag[i]=0;
boal[i]=1;
}
flag[0]=1;
REP(i,0,m){
lli x,y;
ci... | a.cc: In function 'int main()':
a.cc:40:2: error: expected '}' at end of input
40 | }
| ^
a.cc:10:14: note: to match this '{'
10 | signed main(){
| ^
|
s638756454 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
//玉の数の配列を作る
vector<int> tama(N,1);
//赤が入っている確率のある箱の番号に1、そうでない箱に0をつける配列を作る
vector<int> kakuritu(N,0);
kakuritu[0] = 1;
for(int i = 0; i < M; i++){
cin >> x >> y;
//球を動かす
tama[x-1]--;
tama[y-1]++;
//ka... | a.cc: In function 'int main()':
a.cc:14:12: error: 'x' was not declared in this scope
14 | cin >> x >> y;
| ^
a.cc:14:17: error: 'y' was not declared in this scope
14 | cin >> x >> y;
| ^
|
s011100035 | p04034 | C++ | #include <iostream>using namespace std;int main() { int n, m, x, y; cin >> n >> m; bool red[n + 5]; red[1] = true; int count[n + 5]; for(int i = 1; i <= n; i++) count[i] = 1; for (int i=2;i<=n;i++)red[i]=false; for (int i = 1; i <= m; i++) { cin >> x >> y; count[x]--; count[y]++... | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;int main() { int n, m, x, y; cin >> n >> m; bool red[n + 5]; red[1] = true; int count[n + 5]; for(int i = 1; i <= n; i++) count[i] = 1; for (int i=2;i<=n;i++)red[i]=false; for (int i = 1; i <... |
s140610912 | p04034 | C++ | #include <iostream>using namespace std;int main() { int n, m, x, y; cin >> n >> m; bool red[n + 5]; red[1] = true; int count[n + 5]; for(int i = 1; i <= n; i++){ count[i] = 1; red[i]=false;} red[i]=true; for (int i = 1; i <= m; i++) { cin >> x >> y; count[x]--; count[y]++; ... | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;int main() { int n, m, x, y; cin >> n >> m; bool red[n + 5]; red[1] = true; int count[n + 5]; for(int i = 1; i <= n; i++){ count[i] = 1; red[i]=false;} red[i]=true; for (int i = 1; i <= m; i+... |
s065862791 | p04034 | C++ | int n, m;
cin >> n >> m;
vector<int> r;
int t1, t2;
vector<int> v;
r.push_back(1);
v.push_back(1);
for(int i = 1; i < n; i++){
r.push_back(0);
v.push_back(1);
}
for(int i = 0; i < m; i++){
cin >> t1 >> t2;
t1--;
t2--;
v[t1]--;
v[t2]++;
if(r[t1]==1){
if(v[t1]==0){
r[t1... | a.cc:2:1: error: 'cin' does not name a type
2 | cin >> n >> m;
| ^~~
a.cc:3:1: error: 'vector' does not name a type
3 | vector<int> r;
| ^~~~~~
a.cc:5:1: error: 'vector' does not name a type
5 | vector<int> v;
| ^~~~~~
a.cc:6:1: error: 'r' does not name a type
6 | r.push_back(1);
... |
s662878413 | p04034 | C++ | int n, m;
cin >> n >> m;
vector<int> r;
int t1, t2;
vector<int> v;
r.push_back(1);
v.push_back(1);
for(int i = 1; i < n; i++){
r.push_back(0);
v.push_back(1);
}
for(int i = 0; i < m; i++){
cin >> t1 >> t2;
t1--;
t2--;
v[t1]--;
v... | a.cc:2:5: error: 'cin' does not name a type
2 | cin >> n >> m;
| ^~~
a.cc:3:5: error: 'vector' does not name a type
3 | vector<int> r;
| ^~~~~~
a.cc:5:5: error: 'vector' does not name a type
5 | vector<int> v;
| ^~~~~~
a.cc:6:5: error: 'r' does not name a type
6... |
s910385095 | p04034 | C++ | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
/*BigInteger
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace xxx = boost::multiprecision;
using Bint = xxx::cpp_int;
using Real =... | a.cc: In function 'int main()':
a.cc:100:22: error: 'A' was not declared in this scope
100 | if (v[y] < 0) {A
| ^
|
s730227254 | p04034 | C++ | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
/*BigInteger
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace xxx = boost::multiprecision;
using Bint = xxx::cpp_int;
using Real =... | a.cc: In function 'int main()':
a.cc:100:22: error: 'A' was not declared in this scope
100 | if (v[y] < 0) {A
| ^
|
s131169270 | p04034 | C++ | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
int n;
cin>>n;
int m;
cin>>m;
int canf[n+1]=0;
int val[n+1]=1;
canf[1]=1;
rep1(i, m... | a.cc: In function 'int main()':
a.cc:13:17: error: array must be initialized with a brace-enclosed initializer
13 | int canf[n+1]=0;
| ^
a.cc:14:16: error: array must be initialized with a brace-enclosed initializer
14 | int val[n+1]=1;
| ^
a.cc:32:19: error: expecte... |
s407047932 | p04034 | C++ | #include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using llong = long long;
using ullong = unsigned long long;
#i... | /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
|
s910003146 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(M), B(M);
for (int i = 0; i < M; i++) {
cin >> A(i) >> B(i);
}
int c = 1, s = 0;
for (int i = 0; i < M; i++) {
if (A.at(i) == c){
c == B.at(i);
s += 1;
}
}
cout << s << ... | a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
10 | cin >> A(i) >> B(i);
| ~^~~
a.cc:10:21: error: no match for call to '(std::vector<int>) (int&)'
10 | cin >> A(i) >> B(i);
| ~^~~
|
s148974296 | p04034 | C++ | #include<bits/stdc++.h>
using namespace std;
int n, m;
int cnt[N], vis[N];
int main() {
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; i++) {
cnt[i] = 1;
}
vis[1] = 1;
for (int i = 1; i <= m; i++) {
int x, y;
scanf("%d %d", &x, &y);
if (vis[x]) {
vis[y] = 1;
}
++cnt[y];
i... | a.cc:6:9: error: 'N' was not declared in this scope
6 | int cnt[N], vis[N];
| ^
a.cc:6:17: error: 'N' was not declared in this scope
6 | int cnt[N], vis[N];
| ^
a.cc: In function 'int main()':
a.cc:11:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
11 |... |
s672582124 | p04034 | Java | import java.io.*;
import java.util.StringTokenizer;
public class BoxandBall {
public static void main(String[] args) {
try {
FileReader in_file = new FileReader("b&b.in");
BufferedReader buff_in = new BufferedReader(in_file);
FileWriter out_file = new FileWriter("b&b.ou... | Main.java:4: error: class BoxandBall is public, should be declared in a file named BoxandBall.java
public class BoxandBall {
^
1 error
|
s276130292 | p04034 | C++ | #include<iostream>#include<cstdio>#include<iostream>#include<cstring>using namespace std; bool a[100005];int b[100005]; int main(){ int n,m; while(cin>>n>>m) { int i; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(i=1;i<=n;i++) b[i]=1; a[1]=1; while(m--) ... | a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include<iostream>#include<cstdio>#include<iostream>#include<cstring>using namespace std; bool a[100005];int b[100005]; int main(){ int n,m; while(cin>>n>>m) { int i; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); ... |
s943676136 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int N, M;
int pos[100010], cnt[100010];
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(10);
cin >> N >> M;
pos[0] = 1;
fill_n((int*)cnt, 100010, 1);
for (int i =... | a.cc:36:5: error: redefinition of 'int N'
36 | int N, M;
| ^
a.cc:6:5: note: 'int N' previously declared here
6 | int N, M;
| ^
a.cc:36:8: error: redefinition of 'int M'
36 | int N, M;
| ^
a.cc:6:8: note: 'int M' previously declared here
6 | int N, M;
| ^
a.cc... |
s814321071 | p04034 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int n,m;
cin>>n>>m;
int x[100010],y[100010];
bool b[100010];
rep(i,n){
b[i]=false;
}
b[1]=true;
int c[100010];
rep(i,n){
c[i+1]=1;
}
rep(i,m){
cin>>x[i]>>y[i... | a.cc: In function 'int main()':
a.cc:39:2: error: expected '}' at end of input
39 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s552988236 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,m;
bool b[100005];
int tot[100005];
int ans=0;
int main()
{
int x,y;
cin>>n>>m;
for(int i=1;i<=n;i++)tot[i]=1;
b[1]=true;
for(int i=1;i<=m;i++)
{
cin>>x>>y;
if(tot[x])
{
tot[x]--;
tot[y]++;... | a.cc: In function 'int main()':
a.cc:23:23: error: expected ';' before '}' token
23 | b[x]=false
| ^
| ;
24 | }
| ~
|
s635313335 | p04034 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args)throws Exception {
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader (is);
String input[] = br.readLine().split(" ");
//[x][0] = ボールの個数
//... | Main.java:41: error: reached end of file while parsing
}
^
1 error
|
s558557065 | p04034 | C++ | #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <utility>
#i... | a.cc:45:10: error: expected unqualified-id before 'for'
45 | }for(int i=1;i<=M;i++){
| ^~~
a.cc:45:22: error: 'i' does not name a type
45 | }for(int i=1;i<=M;i++){
| ^
a.cc:45:27: error: 'i' does not name a type
45 | }for(int i=1;i<=M;i++){
... |
s501858155 | p04034 | C++ | #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <utility>
#i... | a.cc:47:9: error: expected unqualified-id before 'for'
47 | for(int i=1;i<=M;i++){
| ^~~
a.cc:47:21: error: 'i' does not name a type
47 | for(int i=1;i<=M;i++){
| ^
a.cc:47:26: error: 'i' does not name a type
47 | for(int i=1;i<=M;i++){
| ... |
s836867625 | p04034 | C++ | #include <bits/stdc++.h>
#define eps 1e-6
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=(n-1);i!=-1;i--)
#define snc(a,b,c) ((a)?(b):(c))
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define ins insert
#define pi acos(-1.0)
#de... | a.cc: In function 'int main()':
a.cc:30:14: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
30 | ari[b]++,ari[a]--;
| ~~~~~^
a.cc:30:23: error: use of an operand of type 'bool' in 'operator--' is forbidden
30 | ari[b]++,ari[a]--;
| ... |
s343927374 | p04034 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<ll,ll> pi;
#define inf 1000000000000000000
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define f first
#define s second
#define pb push_back
#define mp make_pair
int ans=0, x, y, b[101010... | a.cc: In function 'int main()':
a.cc:9:11: error: request for member 'first' in 'b[i]', which is of non-class type 'int'
9 | #define f first
| ^~~~~
a.cc:37:30: note: in expansion of macro 'f'
37 | if(b[v[i].f]<=0)vis[b[i].f]=false;
| ^
|
s852539154 | p04034 | C++ | // ------------------------------------
// Date:2018/ 2/24
// Problem:AGC 002 BoxAndBall b.cpp
//
// ------------------------------------
#include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int... | a.cc: In function 'int main()':
a.cc:29:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
29 | cnt = 0;
| ^~~
| int
|
s641639372 | p04034 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
typedef long long int ll;
int main(){
int N, M;
bool memo[100000];
int num[100000];
cin >> N >> M;
fill(memo, memo + N, false);
fill(num, num + N, 1);
memo[0] = true;
for(int i = 1; i <= M; i++){
int x, y;
cin >> x >> y;
x--; y--;
if(memo[x] ==... | a.cc: In function 'int main()':
a.cc:26:18: error: expected '}' at end of input
26 | return 0;
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s103469341 | p04034 | C++ | #include <biits/stdc++.h>
using namespace std;
const int N = 200010;
int tag[N], n, x, y, m, ans, siz[N];
vector<int>v;
int main()
{
scanf("%d%d", &n, &m);
tag[1] = 1;
for (int i = 1; i <= n; i++)
siz[i] = 1;
while (m--)
{
scanf("%d%d", &x, &y);
if (tag[x])
tag[y] = 1;
siz[x]--;
siz[y]++;
}
for (int... | a.cc:1:10: fatal error: biits/stdc++.h: No such file or directory
1 | #include <biits/stdc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s058131722 | p04034 | C++ | n,m = [int(x) for x in input().split(' ')]
prob = [1] + [0 for x in range(n-1)]
ball = [1 for x in range(n)]
for i in range(m):
x,y = [int(x) for x in input().split(' ')]
ball[x-1] -= 1
ball[y-1] += 1
if prob[x-1] == 1:
prob[y-1] = 1
if ball[x-1] == 0:
prob[x-1] = 0
print(sum(prob)) | a.cc:1:1: error: 'n' does not name a type
1 | n,m = [int(x) for x in input().split(' ')]
| ^
|
s142912994 | p04034 | C | 4 4
1 2
2 3
4 1
3 4 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 4 4
| ^
|
s852528556 | p04034 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
using namespace std;
template<class T> void gc(T &x)
{
int s, k, m = 0;
x = 0;
k = getchar_unlocked();
if (k == '-') s = 1;
k = getchar_unlocked();
while (true)
{
k = getchar_unlocked();
if (k < '0' || ... | a.cc: In instantiation of 'void gc(T&) [with T = int]':
a.cc:33:7: required from here
33 | gc(N);
| ~~^~~
a.cc:26:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
26 | return x;
| ^
|
s487934468 | p04034 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
using namespace std;
template<class T> void gc(T &x)
{
int s, k, m = 0;
T x = 0;
k = getchar_unlocked();
if (k == '-') s = 1;
k = getchar_unlocked();
while (true)
{
k = getchar_unlocked();
if (k < '0' |... | a.cc: In function 'void gc(T&)':
a.cc:9:7: error: declaration of 'T x' shadows a parameter
9 | T x = 0;
| ^
a.cc:6:30: note: 'T& x' previously declared here
6 | template<class T> void gc(T &x)
| ~~~^
a.cc: In instantiation of 'void gc(T&) [with T = int]':
a.cc:33:... |
s427683114 | p04034 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
using namespace std;
template<class T> T gc()
{
int s, k, m = 0;
T x = 0;
k = getchar_unlocked();
if (k == '-') s = 1;
k = getchar_unlocked();
while (true)
{
k = getchar_unlocked();
if (k < '0' || k > '... | a.cc: In function 'int main()':
a.cc:33:7: error: no matching function for call to 'gc(int&)'
33 | gc(N);
| ~~^~~
a.cc:6:21: note: candidate: 'template<class T> T gc()'
6 | template<class T> T gc()
| ^~
a.cc:6:21: note: candidate expects 0 arguments, 1 provided
a.cc:34:7... |
s250944577 | p04034 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
using namespace std;
template<class T>
inline T gc()
{
int s, k, m = 0;
T x = 0;
k = getchar_unlocked();
if (k == '-') s = 1;
k = getchar_unlocked();
while (true)
{
k = getchar_unlocked();
if (k < '0' |... | a.cc: In function 'int main()':
a.cc:32:15: error: no matching function for call to 'gc()'
32 | int N = gc();
| ~~^~
a.cc:7:10: note: candidate: 'template<class T> T gc()'
7 | inline T gc()
| ^~
a.cc:7:10: note: template argument deduction/substitution failed:
a.cc:32:15: n... |
s235892886 | p04034 | C | #include <stdio.h>
int N, M;
int x[100010];
int y[100010];
int box[100010];
bool exist[100010];
int main() {
scanf("%d %d",&N,&M);
int i;
for (i = 0; i < M; i++) {
scanf("%d %d",&x[i],&y[i]);
}
for (i = 1; i <= N; i++) {
box[i] = 1;
exist[i] = false;
}
exist[1] = true;
for (i = 0; i < M; i++) {
... | main.c:9:1: error: unknown type name 'bool'
9 | bool exist[100010];
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'main':
main.c:23:28: error: 'f... |
s615266428 | p04034 | C | #include <stdio.h>
//デバッグ
void debug(int matrix[], int max)
{
int i;
for(i=0; i<max; i++)
printf("%d ", matrix[i]);
printf("\n");
}
//boxセット
void set_box(int matrix[], int max)
{
int i;
matrix[0] = 1;
for(i=1; i<max; i++)
matrix[i] = 0;
}
void set_clone(int clone[], int N)
{
int i;
for(i=0; i<N... | main.c: In function 'main':
main.c:55:28: error: expected ';' before 'continue'
55 | i--
| ^
| ;
56 | continue;
| ~~~~~~~~
|
s625928738 | p04034 | C++ | #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
using namespace std;
bool p[100010];
int num[100010];
int main() {
int N, M, x, y, ans = 0;
cin >> N >> M;
for (int i = 0; i <= N; i++) {
p[i] = false;
num[i] = 1;
}
p[0] = true;
for (int i = 0; i < M; i++) {
scanf_s("%d %d", &x, &y);
... | a.cc: In function 'int main()':
a.cc:17:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
17 | scanf_s("%d %d", &x, &y);
| ^~~~~~~
| scanf
|
s880417712 | p04034 | C++ | int main(){
int N, M;
cin >> N >> M;
pair<int,bool> boxs[100000] = {};
for(int i = 0; i < N; i++){
boxs[i].first = 1;
if(i == 0) boxs[i].second = true;
else boxs[i].second = false;
}
for(int i = 0; i < M; i++){
int a,b;
cin >> a >> b;
a--;
... | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N >> M;
| ^~~
a.cc:4:5: error: 'pair' was not declared in this scope
4 | pair<int,bool> boxs[100000] = {};
| ^~~~
a.cc:4:10: error: expected primary-expression before 'int'
4 | pa... |
s911328657 | p04034 | C++ | #include<iostream>
#include<vector>
#define eps 1e-18
using namespace std;
int main(){
int n, m, x, y, ans = 0;
std::cin >> n >> m;
vector<int> ball(n, 1);
vector<long double> box(n, 0);
box[0] = 1;
for (int i = 0; i < m; i++) {
std::cin >> x >> y;
x--, y--;
box[y] += box[x]/ball[x];
box[x]... | a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s036400171 | p04034 | C++ | int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M; cin >> N >> M;
vector<int> boxes(N), flags(N);
for (int i = 0; i < N; i++) boxes[i] = 1;
for (int i = 0; i < N; i++) flags[i] = 0;
flags[0] = 1;
for (int i = 0; i < M; i++) {
int x, y; cin >> x >> y; x--; y--;
... | a.cc: In function 'int main()':
a.cc:2:5: error: 'cin' was not declared in this scope
2 | cin.tie(0);
| ^~~
a.cc:3:5: error: 'ios' has not been declared
3 | ios::sync_with_stdio(false);
| ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
6 | vector<int> boxes(N), f... |
s206582323 | p04034 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
int n, m;
int ok[100005];
\
int main(){
cin >> n >> m;
ok[1] = 1;
while(m--){
int s, e;
scanf("%d %d",&s,&e);
if(ok[s]) ok[e] = 1;
disj.uni(s, e);
}
cout << count(ok, ok + n + 1, 1) << endl;
} | a.cc: In function 'int main()':
a.cc:16:17: error: 'disj' was not declared in this scope
16 | disj.uni(s, e);
| ^~~~
|
s835979855 | p04035 | C++ | 5 50
10 20 30 40 50 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 50
| ^
|
s595116809 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()... | a.cc:97:1: error: expected unqualified-id before 'else'
97 | else{
| ^~~~
a.cc:98:31: error: expected declaration before '}' token
98 | cout << "Impossible" << endl;}}
| ^
|
s318822539 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x) __builtin_popcount(x)
#defin... | a.cc:158:11: error: redefinition of 'const int INF'
158 | const int INF = (int)1e9;
| ^~~
a.cc:20:11: note: 'const int INF' previously defined here
20 | const int INF = (int)1e9;
| ^~~
a.cc:159:10: error: redefinition of 'const long long int IINF'
159 | const ll IINF=1LL<<62;
... |
s384293153 | p04035 | C++ | #include <bits/stdc++.h>
#include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll... | a.cc:2:10: fatal error: /home/itohdak/AtCoder/000/print.hpp: No such file or directory
2 | #include "/home/itohdak/AtCoder/000/print.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s064621404 | p04035 | C++ | #include <iostream>
//#include <bits/stdc++.h>
// a&1 check odd or not and a>>=1 halfs a
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pb(x) push_back(x)
#define F first
#define S second
using namespace std;
#define ll long ... | a.cc: In function 'void solve()':
a.cc:26:22: error: 'INT_MAX' was not declared in this scope
26 | ll maxlen=-1*INT_MAX;
| ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
8 | #include <algorithm>
+++ ... |
s998370222 | p04035 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n, L;
ll a[100000];
int main() {
cin >> n >> L;
for(int i = 0; i < n; i++){
cin >> a[i];
}
if(a[0] + a[1] >= L){
cout << "Possible" << endl;
for(int i = n - 1; i >= 1; i--)cout << i << endl;
return 0;
}
if(a[n - 1] ... | a.cc: In function 'int main()':
a.cc:28:9: error: 'vector' was not declared in this scope
28 | vector<pair<int, int>> ans;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include<algorithm>
+++ |+#include ... |
s278526882 | p04035 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n, L;
ll a[100000];
int main() {
cin >> n >> L;
for(int i = 0; i < n; i++){
cin >> a[i];
}
if(a[0] + a[1] >= L){
cout << "Possible" << endl;
for(int i = n - 1; i >= 1; i--)cout << i << endl;
return 0;
}
if(a[n - 1] ... | a.cc: In function 'int main()':
a.cc:29:9: error: 'vector' was not declared in this scope
29 | vector<pair<int, int>> ans;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include<algorithm>
+++ |+#include ... |
s488516605 | p04035 | C++ | /#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n, L;
ll a[100000];
int main() {
cin >> n >> L;
for(int i = 0; i < n; i++){
cin >> a[i];
}
if(a[0] + a[1] >= L){
cout << "Possible" << endl;
for(int i = n - 1; i >= 1; i--)cout << i << endl;
return 0;
}
if(a[n - 1]... | a.cc:1:2: error: stray '#' in program
1 | /#include<iostream>
| ^
a.cc:1:1: error: expected unqualified-id before '/' token
1 | /#include<iostream>
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.c... |
s570670761 | p04035 | C++ | #include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)
using namespace std;
typedef long long ll;
int main(){
... | a.cc: In function 'int main()':
a.cc:43:27: error: 'coninue' was not declared in this scope
43 | if(i == last) coninue;
| ^~~~~~~
|
s292406708 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
#define N 100001
int n, m;
int main() {
scanf("%d%d", &n, &m);
int add = 0;
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i < n; i++)
if (a[i] + a[i + 1] >= m) add = i;
if (add) {
puts("Possible");
for (int i = ... | a.cc: In function 'int main()':
a.cc:8:47: error: 'a' was not declared in this scope
8 | for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
| ^
a.cc:10:13: error: 'a' was not declared in this scope
10 | if (a[i] + a[i + 1] >= m) add = i;
| ... |
s070330141 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:381:10: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'std::pair<long long int, long long int>'} and '__gnu_cxx::__alloc_traits<std::... |
s406930822 | p04035 | C++ | #define s second
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
using namespace std;
int arr[100005];
int main(){
faster
int T = 1;
while(T--){
int n,l;
cin>>n>>l;
rep(i,0,n-1) {
cin>>arr[i];
}
int ind;
in... | a.cc: In function 'int main()':
a.cc:8:5: error: 'faster' was not declared in this scope
8 | faster
| ^~~~~~
a.cc:10:11: error: 'T' was not declared in this scope
10 | while(T--){
| ^
a.cc:12:9: error: 'cin' was not declared in this scope
12 | cin>>n>>l;
| ... |
s603160756 | p04035 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n,l
cin>>n>>l;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
cout<<"Impossible";
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'cin'
9 | cin>>n>>l;
| ^~~
|
s557399431 | p04035 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n,l
cin>>n>>l;
int a[n];
for(int i=0;i<l;i++){
cin>>a[i];
}
cout<<"Impossible";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'cin'
9 | cin>>n>>l;
| ^~~
a.cc:11:19: error: 'l' was not declared in this scope
11 | for(int i=0;i<l;i++){
| ^
|
s024548288 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
const int a=100001;
int main()
{
int n, l, k, A[a];
cin>>n>>l;
for (int i = 0; i < n; i ++)
cin>>A[i];
for (int i = 1; i < n; i ++)
if (A[i] + A[i + 1] >= l)
k = i;
if (!k)
return cout<<"Impossible"<<endl;
cout<<"Pos... | a.cc:15:11: warning: missing terminating " character
15 | cout<<"Possible<<endl;
| ^
a.cc:15:11: error: missing terminating " character
15 | cout<<"Possible<<endl;
| ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:34: error: cannot convert 'std::basic_ostream<char>... |
s357428783 | p04035 | C++ | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl
using namespace std;
typede... | a.cc: In function 'int main()':
a.cc:27:16: error: 'a' was not declared in this scope
27 | cin >> a[i];
| ^
a.cc:30:13: error: 'a' was not declared in this scope
30 | if (a[i] + a[i+1] >= l) {
| ^
|
s500117362 | p04035 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
ll num[100005]={0};
int main(){
ll n,x;
cin>>n>>x;
for(int i=1;i<=n;i++) cin>>num[i];
ll ok_l=0;
for(int i=1;i<n;i++){
if(num[i]+num[i+1]>=x) ok_l=i;
}
if(ok_l==0){
cout<<"Impossible"<<endl;
return 0;
}
cout<<"Possible"<<endl;
... | a.cc:25:4: error: redefinition of 'll num [100005]'
25 | ll num[100005]={0};
| ^~~
a.cc:4:4: note: 'll num [100005]' previously defined here
4 | ll num[100005]={0};
| ^~~
a.cc:26:5: error: redefinition of 'int main()'
26 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously ... |
s668665140 | p04035 | C++ | #include <iostream>
#include<algorithm>
#include<vector>
#define int long long
using namespace std;
int re(int i){return (i/2)*2;}
int solve(int i,int j,int l){
return re(i)+re(j)+re(l);
}
#define vel vector<long long>
int ret(int i,int j){
for(int k=i;k<=j;k++){
cout << k<<endl;
}
}
signed main(voi... | a.cc: In function 'long long int ret(long long int, long long int)':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
15 | }
| ^
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
19 | rep(i,n){cin >>a[i];}
| ^
a.cc:19... |
s210906033 | p04035 | C++ | #include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | a.cc: In function 'int main()':
a.cc:46:9: error: 'RandNum' was not declared in this scope
46 | RandNum ran;
| ^~~~~~~
|
s132284329 | p04035 | C++ | nya~n | a.cc:1:1: error: 'nya' does not name a type
1 | nya~n
| ^~~
|
s491283929 | p04035 | C++ | #include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
using namespace std;
#define INF 10000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;
int main(){
int N,ans;
ll L,a[110000];
cin>>N>>L;
... | a.cc: In function 'int main()':
a.cc:35:18: error: expected ';' before '-' token
35 | for(int i-N-1;i>=0;i--){
| ^
| ;
a.cc:35:27: error: expected ')' before ';' token
35 | for(int i-N-1;i>=0;i--){
| ~ ^
| ... |
s745656573 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll N,L ; cin >> N >> L
vector<ll> A(N);
for(ll i = 0; i < N; i++){ cin >> A[i];}
for(ll i = 0; i < N-1; i++){ if(A[i]+A[i+1] >= L){
cout << "Possible" << endl;
for(int j = 1; j <= i; j++){ cout << j << endl;}
for(int k = ... | a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before 'vector'
5 | ll N,L ; cin >> N >> L
| ^
| ;
6 | vector<ll> A(N);
| ~~~~~~
a.cc:7:37: error: 'A' was not declared in this scope
7 | for(ll i = 0; i < N;... |
s047094987 | p04035 | C++ | #include <bits/stdc++.h>
typedef long long;
const int N = 1e5 + 5;
int n, l;
ll a[N];
int main()
{
scanf("%d%lld", &n, &l);
int mark = 0;
for (int i = 1; i <= n; i ++)
{
scanf("%lld", &a[i]);
if (a[i] + a[i - 1] >= l)
mark = i;
}
if (mark == 0)
{
printf("Impossible");
}
else
{
mark --;
printf... | a.cc:3:14: error: declaration does not declare anything [-fpermissive]
3 | typedef long long;
| ^~~~
a.cc:8:1: error: 'll' does not name a type
8 | ll a[N];
| ^~
a.cc: In function 'int main()':
a.cc:16:32: error: 'a' was not declared in this scope
16 | scanf("%lld", &... |
s274040095 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
signed main(){
int n,l;cin>>n>>l;
vector<int>a(n);
for(auto&& u:a)cin>>u;
int tmp=-1;
rep(i,n-1)if(a[i]+a[i+1]>=l){tmp=i;break;}
if(tmp=-1){
cout<<"Impossible"<<endl;
}else{
cout<<"Possible"<<endl;
for(in... | a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before '-' token
17 | for(int n-1;i>tmp;i--)cout<<i+1<<endl;
| ^
| ;
a.cc:17:21: error: 'i' was not declared in this scope
17 | for(int n-1;i>tmp;i--)cout<<i+1<<endl;
| ... |
s074540167 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
#define IL inline
#define rep(i,j,k) for(int i=j;i<=k;++i)
#define repd(i,j,k) for(int i=j;i>=k;--i)
#define pb push_back
#define db double
#define mp make_pair
#define mp3(a,b,c) mp(mp(a,b),c)
#define pii pair<int,int>
#define piii pair<pii,int>
#define fr first
#define se ... | a.cc: In function 'int main()':
a.cc:47:28: error: 'j' was not declared in this scope
47 | repd(i,n-1,j+1)write(i);
| ^
a.cc:5:36: note: in definition of macro 'repd'
5 | #define repd(i,j,k) for(int i=j;i>=k;--i)
| ^
|
s547225952 | p04035 | C++ | #include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)
#define ALL(v) v.begin()... | a.cc:97:8: error: redefinition of 'double EPS'
97 | double EPS = 1e-9;
| ^~~
a.cc:40:8: note: 'double EPS' previously defined here
40 | double EPS = 1e-9;
| ^~~
a.cc:98:5: error: redefinition of 'int INFi'
98 | int INFi = 1000000005;
| ^~~~
a.cc:41:5: note: 'int INFi' previo... |
s345758764 | p04035 | C++ | #include <iostream>
#include <sstream>
#include <functional>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <cmath>
#include <queue>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
# define my_sizeof(type) ((char *)(&type+1)-(char*)(&type))
string makestring(int x)
{
stringstr... | a.cc: In function 'int main()':
a.cc:47:30: error: expected primary-expression before '=' token
47 | for(int i = n-1; i > =x; i--){
| ^
|
s641845675 | p04035 | C++ | #include <iostream>
#include <sstream>
#include <functional>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <cmath>
#include <queue>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
# define my_sizeof(type) ((char *)(&type+1)-(char*)(&type))
string makestring(int x)
{
stringstr... | a.cc: In function 'int main()':
a.cc:47:30: error: expected primary-expression before '=' token
47 | for(int i = n-1; i > =x; i--){
| ^
|
s992903706 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, l;
int main() {
scanf("%d %d", &n, &l);
vector<int> a(n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int last = 0;
for (int i = 1; i <= n; i++) {
if (a[i - 1] + a[i] >= l) {
last = i;
break;
}
}
if (!last) {
put... | a.cc: In function 'int main()':
a.cc:21:23: error: expected ';' before '}' token
21 | puts("Impossible")
| ^
| ;
22 | } else {
| ~
|
s369336228 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, l;
int main() {
scanf("%d %d", &n, &l);
vector<int> a(n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int last = 0;
for (int i = 1; i <= n; i++) {
if (a[i - 1] + a[i] >= L) {
last = i;
break;
}
}
if (!last) {
put... | a.cc: In function 'int main()':
a.cc:15:28: error: 'L' was not declared in this scope
15 | if (a[i - 1] + a[i] >= L) {
| ^
a.cc:21:23: error: expected ';' before '}' token
21 | puts("Impossible")
| ^
| ;
22 | } e... |
s243082930 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n,k,m=0;
cin>>n>>k;
ll a[i];
for(int i=0;i<n;i++){
cin>>a[i];
if(i!=0){
if(a[i]+a[i-1]>=k){
m=i;
}
}
}
if(m==0)cout<<"Impossible";
else{
cout<<"Possible"<<endl;
for(int i=1;i<m;i++) cou... | a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
7 | ll a[i];
| ^
a.cc:9:10: error: 'a' was not declared in this scope
9 | cin>>a[i];
| ^
|
s273701907 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1e9+7;
int main() {
... | a.cc: In function 'int main()':
a.cc:32:19: error: 'n' was not declared in this scope
32 | for(int i=n-1;i>pos;i--){
| ^
|
s199773902 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1e9+7;
int main() {
... | a.cc: In function 'int main()':
a.cc:25:23: error: unable to find string literal operator 'operator""endl' with 'const char [11]', 'long unsigned int' arguments
25 | cout<<"Impossible"endl;
| ^~~~~~~~~~~~~~~~
a.cc:32:19: error: 'n' was not declared in this scope
32 | ... |
s113470150 | p04035 | C |
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
//変数の宣言
int n,l;
int a[100010];
//よく使う変数
int i,j,k,l;
int flag=0;
long int ans=0;
int count=0;
int temp,temp1,temp2;
int max,min;
int len;
//データの読み込み
scanf("%d %d",&n,&l);
for(i=0;i<n;i++){
scanf("%d",&a[... | main.c: In function 'main':
main.c:13:19: error: redeclaration of 'l' with no linkage
13 | int i,j,k,l;
| ^
main.c:9:15: note: previous declaration of 'l' with type 'int'
9 | int n,l;
| ^
|
s528333744 | p04035 | Java | import java.io.*;
import java.util.StringTokenizer;
public class Knot {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
... | Main.java:4: error: class Knot is public, should be declared in a file named Knot.java
public class Knot {
^
1 error
|
s926667925 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n, l;
cin >>n >>l;
int a; b;
int t =1;
int k =0;
cin << a;
for(int i =1;i<n;i++){
cin <<b;
if(l<a+b){
k =1;
break;}
a =b;
t++
}
if(k==1){
... | a.cc: In function 'int main()':
a.cc:8:12: error: 'b' was not declared in this scope
8 | int a; b;
| ^
a.cc:11:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
11 | cin << a;
| ~~~ ^~ ~
| | ... |
s674535787 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a[100010];
long long b[100010];
int main()
{
int n,l;
cin>>n>>l;
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
long long ans=0;
int pos=0;
for(int i=1;i<n;i++)
{
if(a[i]+a[i+1]>ans)
{
ans=a[i]+a[i+1];
pos=i;
}
}
if(ans>=l)
... | a.cc: In function 'int main()':
a.cc:25:33: error: 'j' was not declared in this scope
25 | for(int i=n-1;i>j;i--)
| ^
a.cc:27:31: error: 'j' was not declared in this scope
27 | for(int i=1;i<j;i++)
| ^
|
s824107851 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n;
long long l;
long long a[N];
int main()
{
scanf("%d%lld",&n,&l);
long long maxn=0;
int mid;
for(int i=1;i<=n;i++)
{
scanf("%lld",&a[i]);
if(i>1&&a[i-1]+a[i]>maxn)
{
maxn=a[i-1]+a[i];
mid=i-1;
}
}
if(maxn>l)
{
printf("Possibl... | a.cc: In function 'int main()':
a.cc:27:31: error: 'i' was not declared in this scope
27 | printf("%d\n",i);
| ^
|
s736734913 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n;
long long l;
long long a[N];
int main()
{
scanf("%d%lld",&n,&l);
long long maxn=0;
int mid;
for(int i=1;i<=n;i++)
{
scanf("%lld",&a[i]);
if(i>1&&a[i-1]+a[i]>maxn)
{
maxn=a[i-1]+a[i];
mid=i-1;
}
}
if(maxn>l)
{
printf("Possibl... | a.cc: In function 'int main()':
a.cc:27:31: error: 'i' was not declared in this scope
27 | printf("%d\n",i)
| ^
|
s388237314 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,L,a[N],i,j;
int main(){
scanf("%d%d",&n,&L);
for(i=1;i<=n;i++)scanf("%d",&a[i]);
for(i=1,j=1;i<n;i++)if(a[i]+a[i+1]>a[j]+a[j+1])j=i;
if(a[j]+a[j+1]<L){puts("Impossible");return;}
puts("Possible");
for(i=n-1;i>j;i--)printf("%d\n",i);
for(i=1;i<... | a.cc: In function 'int main()':
a.cc:9:46: error: return-statement with no value, in function returning 'int' [-fpermissive]
9 | if(a[j]+a[j+1]<L){puts("Impossible");return;}
| ^~~~~~
|
s696532537 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100001];
vector <int> ans;
int main () {
cin >> n >> k;
int pos = 0;
for (int i = 1;i <= n;i ++) {
cin >> a[i];
if (i > 1 && a[i] + a[i - 1] >= k) {
pos = i - 1;
}
}
if (!pos) {
cout << "Impossible";
return 0;
}
cout << "Possible\n"; ... | a.cc: In function 'int main()':
a.cc:26:47: error: expected ';' before 'return'
26 | for (auto to : ans) cout << to << "\n"
| ^
| ;
27 | return 0;
| ~~~~~~ ... |
s163510242 | p04035 | C++ | #include <iosteam>
using namespace std;
int main () {
int a,b;
bool ok = false;
int d;
cin >> a >> b;
int c[a];
for (int i = 0;i < a;i++) {
cin >> c[i];
}
for (int i = 0;i < a - 1;i++){
if (c[i]+c[i+1] >= b) {
ok = true;
d = i;
}
}
if (ok) {
... | a.cc:1:10: fatal error: iosteam: No such file or directory
1 | #include <iosteam>
| ^~~~~~~~~
compilation terminated.
|
s716211232 | p04035 | C++ | 我是洛谷大佬 | a.cc:1:1: error: '\U00006211\U0000662f\U00006d1b\U00008c37\U00005927\U00004f6c' does not name a type
1 | 我是洛谷大佬
| ^~~~~~~~~~~~
|
s175400058 | p04035 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n, l; cin >> n >> l;
vector<long long> a(n);
for(int i = 0; i < (int)n; i++){
cin >> a[i];
}
bool flag = false;
int idx;
for(int i = 1; i < (int)n; i++){
if(a[i] + a[i - 1] >= l){
idx = i;
... | a.cc: In function 'int main()':
a.cc:18:17: error: expected ';' before 'true'
18 | flag true;
| ^ ~~~~
| ;
|
s566434000 | p04035 | C++ | #include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = ... | a.cc:83:1: error: unterminated comment
83 | /*
| ^
|
s251084345 | p04035 | C++ | #include <iostream>
int v[100000];
int main()
{
int n, k, i, maxx, poz1, poz2;
cin >> n >> k >> v[0] ;
maxx = 0;
for( i = 1; i < n; i++ )
{
cin >> v[i];
if( v[i - 1] + v[i] > maxx )
{
maxx = v[i - 1] + v[i];
poz1 = i - 1;
poz2 = i;
... | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> n >> k >> v[0] ;
| ^~~
| 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; ... |
s715508993 | p04035 | C++ | #include <iostream>
using namespace std;
int v[100000] ;
int main()
{
int n ,l ,i ,poz1 = 0 ,poz2 = 0 ,x ,y;
cin >> n >> l ;
for (i = 1 ; i <= n ; i ++)
{
cin >> v[i];
if (v[i] + v[i-1] >= maxx)
{
maxx = v[i] + v[i-1] ;
poz2 = i ,poz1 = i - 1;
}... | a.cc: In function 'int main()':
a.cc:14:30: error: 'maxx' was not declared in this scope
14 | if (v[i] + v[i-1] >= maxx)
| ^~~~
a.cc:21:9: error: 'maxx' was not declared in this scope
21 | if (maxx < k )
| ^~~~
a.cc:21:16: error: 'k' was not declared in... |
s026976737 | p04035 | C++ | #include <iostream>
using namespace std;
int v[100000] ;
int main()
{
int n ,l ,i ,poz1 = 0 ,poz2 = 0 ,x ,y;
cin >> n >> l ;
for (i = 1 ; i <= n ; i ++)
{
cin >> v[i];
if (v[i] + v[i-1] >= l)
poz2 = i ,poz1 = i - 1;
}
if (poz1 == 0 && poz2 == 0)
{
cout ... | a.cc: In function 'int main()':
a.cc:27:23: error: 'b' was not declared in this scope
27 | for (i = n-1 ; i >b ; i --)
| ^
|
s903631099 | p04035 | C++ | #include <bits/stdc++.h>
using namespace std;
int v[100000];
long long s;
int main()
{
int n, k;
cin>>n>>k;
for (it i=0; i<n; i++){
cin>>v[i];
s+=v[i];
}
if (s<k){
cout<<"impossible";
return 0;
}
}
| a.cc: In function 'int main()':
a.cc:9:10: error: 'it' was not declared in this scope; did you mean 'int'?
9 | for (it i=0; i<n; i++){
| ^~
| int
a.cc:9:18: error: 'i' was not declared in this scope
9 | for (it i=0; i<n; i++){
| ^
|
s802429927 | p04035 | C++ | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <str... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s719917954 | p04035 | C++ | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <str... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s709366412 | p04035 | C++ | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <str... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s142259642 | p04035 | C++ | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <str... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s986880734 | p04035 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef pair<int ,int> P;
int main(void){
int n, l, ans = 0;
int a[100005];
int length[100005];
cin >> n >> l;
vector<int> front;
vector<int> back;
for(int i=0; i<n; i++){
cin >> a[i];
}
for(int i=0; i<n-1; i++){
... | a.cc: In function 'int main()':
a.cc:27:5: error: 'reverse' was not declared in this scope
27 | reverse(back.begin(), back.end());
| ^~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.