submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s020734053
p03819
C++
#include <bits/stdc++.h> #define N 400010 using namespace std; namespace fastIO{ #define BUF_SIZE 100005 #define OUT_SIZE 100005 #define ll long long //fread->read bool IOerror=0; inline char nc(){ static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE; if (p1==pend){ ...
a.cc: In function 'void fastIO::readln2(char*)': a.cc:106:34: error: 'gets' was not declared in this scope; did you mean 'getw'? 106 | inline void readln2(char *s){gets(s);} | ^~~~ | getw a.cc: In function 'int main()': a.cc:232:26: war...
s131272366
p03819
Java
import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main{ public static void main(String[] args) { int bentoType = 0; int stationCnt = 0; Scanner scanner = new Scanner(System.in); Syste...
Main.java:23: error: unclosed string literal System.out.print("??"+i+"???????????? ^ Main.java:24: error: illegal character: '\uff1a' ??"); ^ Main.java:24: error: not a statement ??"); ^ Main.java:24: error: unclosed string literal ??"); ^ Main....
s016789349
p03819
Java
import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Java06 { public static void main(String[] args) { int bentoType = 0; int stationCnt = 0; Scanner scanner = new Scanner(System.in); Sy...
Main.java:23: error: unclosed string literal System.out.print("??"+i+"???????????? ^ Main.java:24: error: illegal character: '\uff1a' ??"); ^ Main.java:24: error: not a statement ??"); ^ Main.java:24: error: unclosed string literal ??"); ^ Main....
s162139102
p03819
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<pair<int,int> > v[100010]; int bit[100010],n,m; void add(int x,int k){ while(x<=m+1){ bit[x]+=k; x+=x&-x; } } int sum(int x){ int s=0; while(x){ s+=bit[x]; x-=x&-x; } return s; } int main(){ cin>>n>>m; memset(bit,0,m+1)...
a.cc: In function 'int main()': a.cc:24:9: error: 'memset' was not declared in this scope 24 | memset(bit,0,m+1); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<vector> +++ |+#include <cstring> 4...
s440194566
p03819
C++
#pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <tuple> #include <bitset> #include <queue> #include <complex> #include <set> #include <map> #inc...
a.cc: In function 'void solve()': a.cc:101:9: error: 'BITree' was not declared in this scope 101 | BITree bit(M+1); | ^~~~~~ a.cc:105:25: error: 'bit' was not declared in this scope 105 | bit.add( pts[i][1]+1, 1 ); | ^~~ a.cc:107:35: error:...
s662878650
p03819
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf=1e9; const int64_t inf64=1e18; c...
a.cc: In member function 'int segtree::query(int, int, int, int, int)': a.cc:65:22: error: expected primary-expression before 'or' token 65 | if(/*b<=lb*/ or x<a or b<=x) return 0; | ^~
s328202871
p03819
C++
#include <iostream> #include <vector> #include <algorithm> #include <utility> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define orep(i, n) for (int i = 1; i <= (int)n; i++) #define vec vector class SegmentTree { private: int def = 0; int n; vec<int> data; int query_rec(int a, int b...
a.cc: In member function 'int SegmentTree::query(int, int)': a.cc:51:28: error: no matching function for call to 'SegmentTree::func(int&, int&, int, int, int&)' 51 | return func(a, b, 0, 0, n); | ~~~~^~~~~~~~~~~~~~~ a.cc:28:13: note: candidate: 'int SegmentTree::func(int,...
s479765074
p03819
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define N (int)1e5 #define F first #define S second typedef pair<int, int> P; int n, m, ans; int l[N + 1], r[N + 1]; P lr[N + 1]; vector<int> vec[N + 10]; int bit[N + 1]; int sum(int i, int *b) { int s = 0; while (i > 0) { s += b[i]; ...
a.cc: In function 'int main()': a.cc:57:45: error: expected '}' at end of input 57 | ans += sum(j , bit); | ^ a.cc:56:17: note: to match this '{' 56 | { | ^ a.cc:57:45: error: expected '}' at end of inp...
s259523783
p03819
C++
#include <iostream> #include <vector> class BinaryIndexedTree { private: std::vector<int> vals; int n; public: BinaryIndexedTree(int n_) : vals(n_, 0), n(n_) { } void add(int a, int w) { for (int x = a; x <= n; x += x & -x) { vals[x - 1] += w; } } int s...
a.cc: In member function 'void SnLine::solve()': a.cc:65:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 65 | std::sort(prList.begin(), prList.end(), | ^~~~ | qsort
s466082901
p03819
C++
#include <vector> #include <map> class BinaryIndexedTree { private: std::vector<int> vals; int n; public: BinaryIndexedTree(int n_) : vals(n_, 0), n(n_) { } void add(int a, int w) { for (int x = a; x <= n; x += x & -x) { vals[x - 1] += w; } } int sum(in...
a.cc: In member function 'void SnLine::solve()': a.cc:83:18: error: 'cout' is not a member of 'std' 83 | std::cout << r << std::endl; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <map...
s220338818
p03819
C++
#include <bits/stdc++.h> using namespace std; class FenwickTree { private: long long n; vector<long long> dat; public: FenwickTree(long long _n): n(_n), dat(_n+1, 0) {} FenwickTree(long long _n, long long init): n(_n), dat(_n+1, 0) { for (long long i = 0; i <= _n; i++) { add(i, init...
cc1plus: error: '::main' must return 'int'
s828656951
p03819
C
?????????
main.c:1:1: error: expected identifier or '(' before '?' token 1 | ????????? | ^
s056074173
p03819
C
Fight dayo!
main.c:1:1: error: unknown type name 'Fight' 1 | Fight dayo! | ^~~~~ main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!' token 1 | Fight dayo! | ^
s767272631
p03819
C
QVQ
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | QVQ | ^~~
s580255136
p03819
Java
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int MM = 1e9 + 7; const double eps = 1e-8; const int MAXN = 2e6 + 10; int n, m; void prework(){ } void read(){ } int K; ll C[2222][2222]; ll pw[2222]; ll f[2222][2222]; ll sum[2222][2222]; void solve(int casi)...
Main.java:1: error: illegal character: '#' #include<bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<bits/stdc++.h> ^ Main.java:5: error: class, interface, enum, or record expected typedef long long ll; ^ Main.java:6: error: class, interface, enum, or record expected type...
s910022449
p03819
C++
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
a.cc: In function 'int main()': a.cc:84:9: error: 'cut' was not declared in this scope 84 | cut << ans[i] << endl; | ^~~
s456159292
p03819
C++
#include <vector> #include <iostream> #include <algorithm> #pragma warning(disable : 4996) using namespace std; int N, M, l[300009], r[300009], c[300009]; vector<int> d[100009], lc[100009], rc[100009]; int main() { cin >> N >> M; for (int i = 0; i < N; i++) { scanf("%d%d", &l[i], &r[i]), l[i]--, c[i] = r[i] - l[i];...
a.cc: In function 'int main()': a.cc:15:25: error: 'sqrt' was not declared in this scope 15 | int B = sqrt(i); | ^~~~
s479665412
p03819
C++
#include <stdio.h> #include <algorithm> using namespace std; struct data{ int s,e; bool operator<(const data&r)const{ if(s==r.s)return e<r.e; return s<r.s; } }a[300010]; struct Node{ int cnt; Node *l,*r; Node(int cnt,Node *l,Node *r):cnt(cnt),l(l),r(r){} Node *update(int s,in...
a.cc: In function 'int main()': a.cc:41:23: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing] 41 | data t={j,1e9}; | ^~~
s851675553
p03819
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long using namespace std; typedef pair<int, int> P; int n, m; int l[300010]; int r[300010]; int sum[300010]; int a...
a.cc: In function 'int main()': a.cc:33:9: error: 'd' was not declared in this scope 33 | d[i] = divisor(i); | ^
s688040779
p03819
C++
#include <iostream> using namespace std; int main(){ int n, m; cin >> n >> m; int l[n+1], r[n+1]; for(int i=0; i<=n; i++){ cin >> i[i] >> r[i]; } int s[m]; int a; for(int i=0; i<m; i++) s[i]=0; for(int i=0; i<=n; i++){ a=r[i]-l[i]; for(int j=0; j<a; j++){ s[j]+=1; } } for(int i=0; i<m; i++){ cout <...
a.cc: In function 'int main()': a.cc:8:25: error: invalid types 'int[int]' for array subscript 8 | cin >> i[i] >> r[i]; | ^
s123217370
p03819
C++
#include <cstdio> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <map> #include <set> using namespace std; typedef pair<int , int> P2; typedef pair<pair<int , int> , int> P3; typedef pair<pair<int , int> , pair<int , int> > P4; #define Fst first #define Snd second #define PB(a) push...
a.cc:48:13: error: expected ']' before 'int' 48 | int ans[3333 | ^ | ] 49 | 50 | int main(){ | ~~~
s728514005
p03820
C++
6 7 8 9 10 11 12 13 14 15 16 17 #include<cstdio> #include<algorithm> #define N 2200 #define mod 1000000007 using namespace std; int f[N][N],s[N],n,k,ans; int main(){ //freopen("arc.in","r",stdin); scanf("%d%d",&n,&k);f[0][n+1]=1;s[n+1]=1; for (int i=n;i>=1;--i) s[i]=s[i+1]+f[0][i]; for (int i=1;i<=k-1;++i){ for (...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:14: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_c...
s364123497
p03820
C++
zbr ak ioi wa ha ha ha hhhhh i'm fucking coming!
a.cc:3:2: warning: missing terminating ' character 3 | i'm fucking coming! | ^ a.cc:3:2: error: missing terminating ' character 3 | i'm fucking coming! | ^~~~~~~~~~~~~~~~~~ a.cc:1:1: error: 'zbr' does not name a type 1 | zbr ak ioi | ^~~
s707127638
p03820
C++
#include<bits/stdc++.h> using namespace std; long long P=1000000007,n,k,f[10001],i,j; long long w(long long a,long long x) { if(x<0) return 1; long long s=1000000007; while(x) if(x&1)(s*=a)%=P,a=pow(a,2)%P,x>>=1; return s; } int main( ) { cin>>n>>k; f[0]=1000000007; for(i=1;...
a.cc: In function 'long long int w(long long int, long long int)': a.cc:10:36: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%' 10 | if(x&1)(s*=a)%=P,a=pow(a,2)%P,x>>=1; | ~~~~~~~~^~ | ...
s618554293
p03820
C
#define D(i,a,b)for(int i=a;i>=b;--i) f[2005],n,k,M=1e9+7;main(){scanf("%d%d",&n,&k);f[n+1]=1;D(i,n,n-k+1)D(j,n,1)f[j]=j>i?0:(f[j]+f[j+1])%M;D(i,n-k,2)(f[1]*=2)%=M;printf("%d\n",f[1]);}
main.c:2:1: warning: data definition has no type or storage class 2 | f[2005],n,k,M=1e9+7;main(){scanf("%d%d",&n,&k);f[n+1]=1;D(i,n,n-k+1)D(j,n,1)f[j]=j>i?0:(f[j]+f[j+1])%M;D(i,n-k,2)(f[1]*=2)%=M;printf("%d\n",f[1]);} | ^ main.c:2:1: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] main.c:...
s723398907
p03820
C++
#include <algorithm> #include <cstring> using namespace std; const int MAX_N = 2005, MOD = 1000000007; typedef long long i64; int N, K; i64 fac[MAX_N], ifac[MAX_N], inv[MAX_N], bin[MAX_N]; i64 f[MAX_N][MAX_N], sum[MAX_N]; i64 binom(int n, int m) { if (n < m) return 0; return fac[n] * ifac[m] % MOD * ifac[n - m]...
a.cc: In function 'int main()': a.cc:19:3: error: 'scanf' was not declared in this scope 19 | scanf("%d%d", &N, &K); | ^~~~~ a.cc:45:3: error: 'printf' was not declared in this scope 45 | printf("%lld\n", (res + MOD) % MOD); | ^~~~~~ a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; th...
s896769171
p03820
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; #define fin "\n" #define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) template <typename T> inline void chmin(T &l,T r){l=min(l,r);} template <typename T> inli...
a.cc:64:20: error: macro "REP" passed 3 arguments, but takes just 2 64 | REP(j,0,n+1)ans+=C[n][j]*nHr(j+1,r)%MOD; | ^ a.cc:12:9: note: macro "REP" defined here 12 | #define REP(i,n) FOR(i,0,n) | ^~~ a.cc: In function 'int main()': a.cc:64:9: error: 'REP' was not decl...
s379588289
p03820
Java
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int MM = 1e9 + 7; const double eps = 1e-8; const int MAXN = 2e6 + 10; int n, m; void prework(){ } void read(){ } int K; ll C[2222][2222]; ll pw[2222]; ll f[2222][2222]; ll sum[2222][2222]; void solve(int casi)...
Main.java:1: error: illegal character: '#' #include<bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<bits/stdc++.h> ^ Main.java:5: error: class, interface, enum, or record expected typedef long long ll; ^ Main.java:6: error: class, interface, enum, or record expected type...
s505498207
p03821
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<long long>; using vvi = vector<vector<int>>; using pii = pair<int,int>; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define pb push_back vector<pii> btn(100010); int main() { int n; cin>>n; int cn...
a.cc:34:13: error: redefinition of 'std::vector<std::pair<int, int> > btn' 34 | vector<pii> btn(100010); | ^~~ a.cc:11:13: note: 'std::vector<std::pair<int, int> > btn' previously declared here 11 | vector<pii> btn(100010); | ^~~ a.cc:36:5: error: redefinition of 'int main()' ...
s911779311
p03821
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = nextInt(); long[] As = new long[N]; long[] Bs = new long[N]; for (int i = 0; i < N; i++) { As[i] = nextInt(); Bs[i] = nextInt();...
Main.java:6: error: cannot find symbol int N = nextInt(); ^ symbol: method nextInt() location: class Main Main.java:11: error: cannot find symbol As[i] = nextInt(); ^ symbol: method nextInt() location: class Main Main.java:12: error: cannot find symbol ...
s597080991
p03821
C++
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n,c=0; cin >> n; ll a[n],b[n]; rep(i,n) cin >> a[i] >> b[i]; x; for (ll i = n-1; i >= 0;...
a.cc: In function 'int main()': a.cc:15:6: error: 'x' was not declared in this scope 15 | x; | ^
s810764011
p03821
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t N; cin>>N; vector<int64_t> vecA(N); vector<int64_t> vecB(N); for(int i=0;i<N;i++){ cin>>vecA.at(i)>>vecB.at(i); } int64_t kai=0; int64_t rui=0; for(int i=N-1;i>=0;i--){ int64_t son; if(vecA.at(i)+rui>=vecB.at(i)){ so...
a.cc: In function 'int main()': a.cc:26:19: error: expected '}' at end of input 26 | cout<<kai<<endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s926580887
p03821
Java
j jaiba
Main.java:1: error: class, interface, enum, or record expected j jaiba ^ 1 error
s897183463
p03821
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n), b(n); ll cp = 0; for(int i = 0; i < n; i++) cin >> a[i] >> b[i]; for(int i = n; i--;) { a[i] += cp; cp += (b[i] - a[i]%b[i])%b[i]; } cout << cp; }
a.cc: In function 'int main()': a.cc:7:1: error: 'll' was not declared in this scope 7 | ll cp = 0; | ^~ a.cc:10:9: error: 'cp' was not declared in this scope 10 | a[i] += cp; | ^~ a.cc:13:9: error: 'cp' was not declared in this scope 13 | cout << cp; | ^~
s266535899
p03821
C
#include <stdio.h> int main(){ int idx; scanf("%d", &idx); long a[100005], b[100005], ans = 0; for(int i=1; i<=idx; i++) scanf("%ld %ld", a+i, b+i); if(n==99999&&a[0]==207579012)ans=-89; do{ ans = ans + ((b[idx]==1||a[idx]==0) ? 0 : b[idx]-(a[idx]+ans)%b[idx]) % b[idx]; }while(--idx); printf("%...
main.c: In function 'main': main.c:8:6: error: 'n' undeclared (first use in this function) 8 | if(n==99999&&a[0]==207579012)ans=-89; | ^ main.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
s662349252
p03821
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; long long M=0; cin>>N; vector<long long>vec(N); vector<long long>v(N); for(int X=0;X<N;X++){ cin>>vec.at(N); cin>>v.at(N); } for(int X=N-1;X=>0;X--){ vec.at(X)+=M; M+=v.at(X)-vec.at(X)%v.at(X); } cout<<M<<endl; }
a.cc: In function 'int main()': a.cc:14:19: error: expected primary-expression before '>' token 14 | for(int X=N-1;X=>0;X--){ | ^
s756539755
p03821
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; long long num = 0; cin>>N; int A[N],B[N]; for(int i=0;i<N;i++){ cin>>A[i]>>B[i]; } for(int i=N-1;i>=0;i--){ if((A[i]+num)%B[i]!=0){ num+=B[i]-(A[i]+X)%B[i]; } } cout <<num; retu...
a.cc: In function 'int main()': a.cc:14:29: error: 'X' was not declared in this scope 14 | num+=B[i]-(A[i]+X)%B[i]; | ^
s269247518
p03821
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; long long num = 0; cin>>N; int A[N],B[N]; for(int i=0;i<N;i++){ cin>>A[i]>>B[i]; } for(int i=N-1;i>=0;i--){ if((A[i]+num)%B[i]!=0){ X+=B[i]-(A[i]+X)%B[i]; } } cout <<X; return 0...
a.cc: In function 'int main()': a.cc:14:13: error: 'X' was not declared in this scope 14 | X+=B[i]-(A[i]+X)%B[i]; | ^ a.cc:17:12: error: 'X' was not declared in this scope 17 | cout <<X; | ^
s225723449
p03821
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N), B(N); rep(i, N) cin >> A[i] >> B[i]; long long ans = 0; for (int i = N - 1; i >= 0; i--) { long long r = (ans + A[i]) % B[i]; if (r > 0) ans += B[i] - r; } cout << ans << "\n";...
a.cc: In function 'int main()': a.cc:8:9: error: 'i' was not declared in this scope 8 | rep(i, N) cin >> A[i] >> B[i]; | ^ a.cc:8:5: error: 'rep' was not declared in this scope 8 | rep(i, N) cin >> A[i] >> B[i]; | ^~~
s542712119
p03821
C++
include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N), B(N); rep(i, N) cin >> A[i] >> B[i]; long long ans = 0; for (int i = N - 1; i >= 0; i--) { long long r = (ans + A[i]) % B[i]; if (r > 0) ans += B[i] - r; } cout << ans << "\n"; ...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> N; | ^~~ a.cc:7:5: error: 'vector' was not declared in this scope 7 | vector<int> A(N), B(N); |...
s693365781
p03821
C++
include<bits/stdc++.h> #using namespace std; int main(){ int N; cin >> N; long long a[N], b[N]; for (int i=0;i<(n);i++) cin >> a[i] >> b[i]; long long r = 0; rep(i,n) for (int i=N-1;i>=0;i--){ a[i] += r; r += ((a[i]+b[i]-1)/b[i])*b[i] - a[i]; } cout << r << endl; return 0; }
a.cc:2:2: error: invalid preprocessing directive #using 2 | #using namespace std; | ^~~~~ a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~
s484260253
p03821
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; long long a[N], b[N]; for (int i=0;i<(n);i++) cin >> a[i] >> b[i]; long long r = 0; for (int i=N-1;i>=0;i--){ a[i] += r; r += ((a[i]+b[i]-1)/b[i])*b[i] - a[i]; } cout << r << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:19: error: 'n' was not declared in this scope 8 | for (int i=0;i<(n);i++) | ^
s390434862
p03821
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; long long a[N], b[N]; rep(i,N) cin >> a[i] >> b[i]; long long r = 0; for (int i=N-1;i>=0;i--){ a[i] += r; r += ((a[i]+b[i]-1)/b[i])*b[i] - a[i]; } cout << r << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | rep(i,N) cin >> a[i] >> b[i]; | ^ a.cc:7:3: error: 'rep' was not declared in this scope 7 | rep(i,N) cin >> a[i] >> b[i]; | ^~~
s211641682
p03821
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define DUMP(x) cout << #x << " = " << (x) << endl; #define REP(i, n) for(size_t i = 0; i < (n); i++) #define REPR(i, n) for(size_t i = (n); i >= 0; i--) #define FOR(i, a, b) for(size_t i = (a); i < (b); i++) #define FOREACH(x, a) for(auto& (x) : (a))...
/tmp/ccOsroaL.o: in function `main': a.cc:(.text+0xb4): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccOsroaL.o a.cc:(.text+0x100): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccOsroaL.o a.cc:(.text+0x135): relocation tru...
s449958625
p03821
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pint = pair<int, int>; using pll = pair<ll, ll>; using pld = pair<ld, ld>; const int INF=1e9+7; const ll LINF=9223372036854775807; const ll MOD=1e9+7; const ld PI=acos(-1); const ld EPS = 1e-9; //微調整用(EPSより小さいと0と判定など) /...
a.cc: In function 'int main()': a.cc:121:42: error: expected ';' before '}' token 121 | pushed += ( a % b == 0 ? 0 : a % b ) | ^ | ; 122 | } | ~
s241584818
p03821
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pint = pair<int, int>; using pll = pair<ll, ll>; using pld = pair<ld, ld>; const int INF=1e9+7; const ll LINF=9223372036854775807; const ll MOD=1e9+7; const ld PI=acos(-1); const ld EPS = 1e-9; //微調整用(EPSより小さいと0と判定など) /...
a.cc: In function 'int main()': a.cc:118:9: error: 'i' was not declared in this scope 118 | for ( i = n-1; i >= 0; i--){ | ^ a.cc:121:20: error: no match for 'operator%' (operand types are 'std::vector<long long int>' and 'std::vector<long long int>') 121 | pushed += ( as % bs == 0 ? 0 : as % bs...
s996077915
p03821
Java
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { private static Scanner sc = new Scanner(System.in); //result = Math.pow(num1, num3) //StringBuffer str = new StringBuffer(hoge1); //String hoge2 = str.reverse().toString(); //map.containsKey(A) //Map<String, Integer...
Main.java:40: error: incompatible types: possible lossy conversion from long to int long a[]=new long[N]; ^ Main.java:41: error: incompatible types: possible lossy conversion from long to int long b[]=new long[N]; ^ 2 errors
s910845100
p03821
C++
#include <bits/stdc++.h> using namespace std; #define debug(a) cerr << #a << ": " << a << '\n' #define endl '\n' typedef long long ll; const ll maxn = 200010; void solve(ll case_no) { ll n; cin >> n; vector<ll> a(n), b(n); for (ll i = 0; i < n; i++) cin >> a[i] >> b[i]; ll res = 0; ...
a.cc:30:1: error: '::main' must return 'int' 30 | ll main() | ^~
s310982609
p03821
C++
#include <bits/stdc++.h> #include<algorithm> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define INF 1000000000000 inline ll mod(ll a, ll m) { return (a % m + m) % m; } signed main() { int n; cin>>n; int a[n],b[n]; rep(i,n){ cin>>a[i]>>b[i]; ...
a.cc:9:8: error: 'll' does not name a type 9 | inline ll mod(ll a, ll m) { | ^~
s767691671
p03821
C++
#include <bits/stdc++.h> #include<algorithm> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) inline ll mod(ll a, ll m) { return (a % m + m) % m; } #define INF 1000000000000 signed main() { int n; cin>>n; int a[n],b[n]; rep(i,n){ cin>>a[i]>>b[i]; ...
a.cc:6:8: error: 'll' does not name a type 6 | inline ll mod(ll a, ll m) { | ^~
s655105214
p03821
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:29:23: error: no matching function for call to 'gcd(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 29 | g[i]=a[i]*b[i]/gcd(a[i]*b[i]); | ~~~^~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/b...
s927406700
p03821
Java
use v5.18; # strict say state use warnings; use List::Util qw(reduce first max min sum0); chomp (my $n = <STDIN>); my (@a, @b); for my $i (0..$n-1) { chomp (($a[$i], $b[$i]) = split / /, <STDIN>); } my $ans = 0; for my $i (0..($n-1)) { $ans += ($b[$n-$i-1] - ($a[$n-$i-1]+$ans) % $b[$n-$i-1]) % $b[$n-$i-1]; } say $...
Main.java:1: error: class, interface, enum, or record expected use v5.18; # strict say state ^ Main.java:1: error: illegal character: '#' use v5.18; # strict say state ^ Main.java:1: error: class, interface, enum, or record expected use v5.18; # strict say state ^ Main.java:3: error: clas...
s175026120
p03821
C++
#include <bits/stdc++.h> using namespace std; int main () { long N, sum = 0; cin >> N; vector<pair<long, long>> data(N); for(int i = 0; i < N; i++){ cin >> data.at(i).first >> data.at(i).second; } for(int i = N - 1; i >= 0; i--){ if((sum + data.at(i).first) % data.at(i).second == 0)continue; els...
a.cc: In function 'int main()': a.cc:16:11: error: 'aum' was not declared in this scope; did you mean 'sum'? 16 | cout << aum << endl; | ^~~ | sum
s358530564
p03821
C++
#include <bits/stdc++.h> using namespace std; int n; int a[MAXN], b[MAXN]; long long ans; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; for (int i = n - 1; ~i; i--) { a[i] += ans; if (a[i] == b[i]) continue; b[i] = ((a[i] + b[i] - 1) / b[i]) * b[i]; ans +...
a.cc:5:7: error: 'MAXN' was not declared in this scope 5 | int a[MAXN], b[MAXN]; | ^~~~ a.cc:5:16: error: 'MAXN' was not declared in this scope 5 | int a[MAXN], b[MAXN]; | ^~~~ a.cc: In function 'int main()': a.cc:11:16: error: 'a' was not declared in this scope 11 | ...
s930459518
p03821
C++
#include<iostream> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) typedef long long ll; int main(){ int n; cin >> n; ll c = 0; vector<ll>a(n),b(n); rep(i,n){ cin >> a[i] >> b[i]; } reverse(a.begin(),a.end()); reverse(b.begin(),b.end()); rep(i,n){ a[i] += c; ll t = (a[i]/b...
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<ll>a(n),b(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | usin...
s157002921
p03821
C++
#include<iostream> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) typedef long long ll; int main(){ int n; cin >> n; ll c = 0; vector<ll>a(n),b(n); rep(i,n){ cin >> a[i] >> b[i]; } reverse(a.begin(),a.end()); reverse(b.begin(),b.end()); rep(i,n){ a[i] += c; ll t = (a[i]/b...
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<ll>a(n),b(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | usin...
s461310373
p03821
C++
if __name__ == '__main__': N = int(input()) A = [] B = [] for i in range(N): a, b = map(int, input().split()) A.append(a) B.append(b) ans = 0 for i in range(N-1, -1, -1): if (A[i]+ans) % B[i] == 0: continue ans += B[i] - (A[i]+ans) % B[i] print(ans)
a.cc:3:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 3 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:3:1: error: expected unqualified-id before 'if' 3 | if __name__ == '__main__': | ^~
s711783721
p03821
C++
#include<algorithm> #include<stdio.h> using namespace std; int N, A[100000], B[100000]; int x; int sum = 0; int kai(int a, int b) { int t = (a / b) + 1; return b * (t + 1) - a; } int main() { cin >> N; for (int i = 0;i < N;i++)cin >> A[i] >> B[i]; for (int i = N;i >= 0;i--) { x = kai(A[i], B[i]); sum += x; ...
a.cc: In function 'int main()': a.cc:15:9: error: 'cin' was not declared in this scope 15 | cin >> N; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<stdio.h> +++ |+#include <iostream> 3 | using ...
s959601089
p03821
C++
#include <iostream> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> using namespace std; #define rep(i,n) for(ll i = 0;i < n; i++) typedef long long ll; int main(){ ll N,ans = 0; cin >> N; ll A[100010]; ll B[100010]; rep(i,N) cin >> A[i] >> B[i]; ...
a.cc:23:5: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s445045071
p03821
C++
/* これを入れて実行 g++ code.cpp ./a.out */ #include <iostream> #include <vector> #include <string> #include <queue> #include <deque> #include <algorithm> #include <utility> #include <set> #include <map> #include <cmath> #include <math.h> #include <tuple> #include <iomanip> using namespace std; typedef long long ll; typedef...
a.cc: In function 'int main()': a.cc:93:36: error: expected ';' before '}' token 93 | added[i] = added[i + 1] | ^ | ; 94 | } | ~
s720642941
p03821
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; typedef vector<int> VI; template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } #define _overload3(_1,_...
a.cc: In function 'int main()': a.cc:11:21: error: expected unqualified-id before 'for' 11 | #define repi(i,a,b) for(int i=int(a);i<int(b);++i) | ^~~ a.cc:10:19: note: in expansion of macro 'repi' 10 | #define _rep(i,n) repi(i,0,n) | ^~~~ a.cc:9:39: note: in expan...
s574091883
p03821
C++
#include<iostream> #include<string> #include<typeinfo> #include<vector> #include<algorithm> using namespace std; int main() { int N; cin >> N; vector<int> A(N), B(N); for(int i=0; i<N; i++){ cin >> A.at(i) >> B.at(i); } int ans=0; int tmp=0; for(int p=N-1; p>=0; p--){ int tmp = A.at(p)+ans; // if(tmp%B.at...
a.cc: In function 'int main()': a.cc:28:17: error: expected ';' before '}' token 28 | return 0 | ^ | ; 29 | } | ~
s864807441
p03821
C++
#include<iostream> #include<string> #include<typeinfo> #include<vector> #include<algorithm> using namespace std; int main() { int N; cin >> N; vector<int> A(N), B(N); for(int i=0; i<N; i++){ cin >> A.at(i) >> B.at(i); } int ans=0; int tmp=0; for(int p=N-1; p>=0; p--){ int tmp = A.at(p)+ans; // if(tmp%B.at...
a.cc: In function 'int main()': a.cc:28:17: error: expected ';' at end of input 28 | return 0 | ^ | ; a.cc:28:17: error: expected '}' at end of input a.cc:8:1: note: to match this '{' 8 | { | ^
s154447110
p03821
C++
#include<iostream> using namespace std; long long[100000],b[100000],cnt; main(){ cin>>n; for(int i=0;i<n;i++)cin>>a[i]>>b[i]; for(int i=n-1;i>=0;i--){ a[i]+=cnt; if(a[i]%b[i])cnt+=b[i]-a[i]%b[i]; } cout<<cnt<<endl; }
a.cc:3:11: error: expected identifier before numeric constant 3 | long long[100000],b[100000],cnt; | ^~~~~~ a.cc:3:11: error: expected ']' before numeric constant 3 | long long[100000],b[100000],cnt; | ^~~~~~ | ] a.cc:3:10: error: structured binding declaration ca...
s435459318
p03821
C++
#include <bits/stdc++.h> using namespace std; main(){ int n,i; cin>>n; int a[n],b[n]; for(i=0;i<n;i++) cin>>a[i]>>b[i]; for(;i;i--) if((a[i]+res)%b[i]) res+=b[i]-(a[i]+res)%b[i]; cout<<res; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:26: error: 'res' was not declared in this scope 8 | for(;i;i--) if((a[i]+res)%b[i]) res+=b[i]-(a[i]+res)%b[i]; | ^~~ a.cc:9:11:...
s224457614
p03821
C++
#include <bits/stdc++.h> using namespace std; main(){ int n,i; cin>>n; int a[n],b[n]; for(i,n) cin>>a[i]>>b[i]; rev(i,n) if((a[i]+res)%b[i]) res+=b[i]-(a[i]+res)%b[i]; cout<<res; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:7:12: error: expected ';' before ')' token 7 | for(i,n) cin>>a[i]>>b[i]; | ^ | ; a.cc:8:5: error: 'rev' was not declared in th...
s027827313
p03821
C++
/*#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <array> #include <vector> #include <deque> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <unordered_map> #include <unordered_set> */ #include <bits/stdc++.h> using namespace std; // #def...
a.cc: In member function 'void Kruskal::add(int, int, ll)': a.cc:108:23: warning: narrowing conversion of 'z' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing] 108 | e.push_back({ z,{x,y} }); | ^ a.cc: In function 'int main()': a.cc:128:38: error: expected ';' before 'long' ...
s760925934
p03821
C++
/*#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <array> #include <vector> #include <deque> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <unordered_map> #include <unordered_set> */ #include <bits/stdc++.h> using namespace std; // #def...
a.cc: In member function 'void Kruskal::add(int, int, ll)': a.cc:108:23: warning: narrowing conversion of 'z' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing] 108 | e.push_back({ z,{x,y} }); | ^ a.cc: In function 'int main()': a.cc:128:38: error: expected ';' before 'long' ...
s682821604
p03821
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:33:24: error: extended character   is not valid in an identifier 33 | ans += temp == 0 ? 0 : B[i] - temp; | ^ a.cc:33:32: error: extended character   is not valid in an identifier 33 | ans += temp == 0 ? 0 : B[i] - temp; | ...
s073523657
p03821
C++
n=int(input()) ans=0 ab=[] for i in range(n): ab.append(list(map(int, input().split()))) ab.reverse() for i in range(n): a=ab[i][0]+ans b=ab[i][1] if a%b!=0: ans+=b-a%b print(ans)
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s845928520
p03821
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; #define MM = 1000000000; #define mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) #define MAX 10000000005 #define NIL -1 int main(){ ll n; cin >> n; ll a[n], b[n]; for(ll i = 0; i < n; i++){ cin >> a[i] << b[i]; } ll ...
a.cc: In function 'int main()': a.cc:14:21: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'll' {aka 'long long int'}) 14 | cin >> a[i] << b[i]; | ~~~~~~~~~~~ ^~ ~~~~ | | | |...
s732435233
p03821
C++
#include<bits/stdc++.h> using namespace std; int main(){ ll n,c=0; cin>>n; ll a[n],b[n]; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; } for(int i=n-1;i>=0;i--){ a[i]+=c; if(a[i]%b[i]!=0) c+=b[i]-(a[i]%b[i]); } cout<<c; }
a.cc: In function 'int main()': a.cc:4:3: error: 'll' was not declared in this scope 4 | ll n,c=0; | ^~ a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | cin>>n; | ^ | yn a.cc:6:5: error: expected ';' before 'a' 6 | ll a[n],b[n]; | ...
s017628821
p03821
C++
#include <bits/stdc++.h> using namespace std; const int N=100005; int read(){ int x=0,f=1; char ch=getchar(); while (!isdigit(ch)&&ch!='-') ch=getchar(); if (ch=='-') f=-1,ch=getchar(); while (isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); return x*f; } int n; vector <int> e[N]; int Log[N],ans=0; int f[...
a.cc: In function 'void solve()': a.cc:21:25: error: 'x' was not declared in this scope 21 | for (auto y : e[x]) | ^ a.cc:22:24: error: 'pre' was not declared in this scope; did you mean 'pread'? 22 | if (y!=pre){ | ^~~ | ...
s051359166
p03821
C++
#include<iostream> using namespace std; int main() { int n; cin >> n; int a[n],b[n]; for (int i = 0; i < n; i++){ cin >> a[i] >> b[i]; } long long ans=0; long long aa; for (int i = n - 1; i >= 0; i--) { aa = a[i] + ans; if (&& aa % b[i] == 0) continue; if (aa > b[i]) { ans+=b[i] * (aa / b[i] + ...
a.cc: In function 'int main()': a.cc:17:27: error: invalid operands of types 'void*' and 'int' to binary 'operator%' 17 | if (&& aa % b[i] == 0) continue; | ~~~~~ ^ ~~~~ | | | | void* int a.cc:17:24: error: la...
s026113087
p03821
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define FOR(i,m,n) for(int i=m;i<n;i++) #define FORR(i,m,n) for(int i=m;i>=n;i--) #define pb(x) push_back(x) #define SORT(x) sort((x).begin(),(x).end()) #define INF 999999999999 using namespace std; #define int long long int n; vector<int> a, b, c; in...
a.cc: In function 'long long int dfs(long long int, long long int)': a.cc:28:40: error: 'm' was not declared in this scope 28 | return m[make_pair(u, ret)]=x; | ^
s411326537
p03821
C++
#include <bits/stdc++.h> using namespace std; int a[10005], b[10005]; int main() { int n, ans = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &b[i]); for (int i = n; i >= 1; i--) { if ((a[i] + ans) % b[i] > 0) { ans = ans + b[i] - r; } } printf(...
a.cc: In function 'int main()': a.cc:13:32: error: 'r' was not declared in this scope 13 | ans = ans + b[i] - r; } } | ^
s755135839
p03821
C
#include <stdio.h> int main() { int n,a[100000],b[100000],i; long long c=0; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d %d",&a[i],&b[i]); } for (i=0;i<n;i++) { c+=(b[n-i-1]-(a[n-i-1]+c)%b[n-i-1])%b[n-i-1]; if (a[n-i-1]==0) { c+=b[n-i-1] } } printf("%lld\n",c); return 0; }
main.c: In function 'main': main.c:12:18: error: expected ';' before '}' token 12 | c+=b[n-i-1] | ^ | ; 13 | } | ~
s610664158
p03821
C
#include <stdio.h> int main() { int n,a[100000],b[100000],i; long long c=0; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d %d",&a[i],&b[i]); } for (i=0;i<n;i++) { c+=(b[n-i-1]-(a[n-i-1]+c)%b[n-i-1])%b[n-i-1]; if (a[n-i-1]==0) { c+=b[n-i-1] } } printf("%d\n",c); return 0; }
main.c: In function 'main': main.c:12:18: error: expected ';' before '}' token 12 | c+=b[n-i-1] | ^ | ; 13 | } | ~
s533936227
p03821
C++
#include<cstdio> #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #define N 10005 #define INF 111111 using namespace std; int a[1e5+5],b[1e5+5]; long long ans=0; inline long long read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>=...
a.cc:10:10: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 10 | int a[1e5+5],b[1e5+5]; | ~~~^~ a.cc:10:10: error: could not convert '(1.0e+5 + (double)5)' from 'double' to 'long unsigned int' 10 | int a[1e5+5],b[1e5+5]; | ~~~^~ | | ...
s754511832
p03821
C++
#include<cstdio> #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #define N 10005 #define INF 111111 using namespace std; int a[1e+5],b[1e+5]; long long ans=0; inline long long read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0...
a.cc:10:7: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 10 | int a[1e+5],b[1e+5]; | ^~~~ a.cc:10:7: error: could not convert '1.0e+5' from 'double' to 'long unsigned int' 10 | int a[1e+5],b[1e+5]; | ^~~~ | | | double a.cc...
s769421580
p03821
C++
n = input() a = [map(int, raw_input().strip().split()) for i in range(n)] a.reverse() s = 0 for i in range(n): u, v = a[i] u += s s += (v - u % v) % v print s
a.cc:1:1: error: 'n' does not name a type 1 | n = input() | ^
s374266565
p03821
C++
// clang-format off #include <bits/stdc++.h> #define int long long int #define main signed main() #define bye return 0 #define rep(i, n) for (int i = 0; i < (n); i++) #define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++) #define all(v) (v).begin(), (v).end() #define prec(n) fixed << setprecision(n) #defi...
a.cc: In function 'int main()': a.cc:44:31: error: expected ';' before '}' token 44 | c += (q - (p + c) % q) % q | ^ | ; 45 | } | ~
s741278465
p03821
C++
#include <cstdio> #include <map> #include <vector> #include <cmath> using namespace std; #define sz(x) (int)((x).size(x)) #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) #define all(x) (x).begin(), (x).end() #define sci(x) int x; scanf("%d", &x); #define scii(x, y) in...
a.cc: In function 'int main()': a.cc:48:3: error: 'cout' was not declared in this scope 48 | cout<<update<<endl; | ^~~~ a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <cmath> +++ |+#include <iostream> 5 | a.cc:...
s450166310
p03821
C++
#include <cstdio> #include <map> #include <vector> #include <cmath> using namespace std; #define sz(x) (int)((x).size(x)) #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) #define all(x) (x).begin(), (x).end() #define sci(x) int x; scanf("%d", &x); #define scii(x, y) in...
a.cc: In function 'int main()': a.cc:48:3: error: 'cout' was not declared in this scope 48 | cout<<update<<endl; | ^~~~ a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <cmath> +++ |+#include <iostream> 5 | a.cc:...
s283085592
p03821
C++
#include <cstdio> #include <map> #include <vector> #include <cmath> using namespace std; #define sz(x) (int)((x).size(x)) #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) #define all(x) (x).begin(), (x).end() #define sci(x) int x; scanf("%d", &x); #define scii(x, y) int...
a.cc: In function 'int main()': a.cc:39:7: error: 'k' was not declared in this scope 39 | k = B[i]/(A[i]+update) + 1; | ^
s181396398
p03821
C++
int main(){ llong N; llong A[100000]; llong B[100000]; llong count[100000] = {0}; llong sum = 0; llong tmp = 0; cin >> N; REP(i,N){ cin >> A[i] >> B[i]; } REPR(j,N-1){ if(B[j] >= A[j]){ count[j] = B[j] - A[j]; }else if( A[j] % B [j] == 0){ count[j] = 0; }else{ count[j] = B[j]*((A[j] / B[j]) + 1) - A[j]; } sum = su...
a.cc: In function 'int main()': a.cc:2:1: error: 'llong' was not declared in this scope; did you mean 'long'? 2 | llong N; | ^~~~~ | long a.cc:3:6: error: expected ';' before 'A' 3 | llong A[100000]; | ^~ | ; a.cc:4:6: error: expected ';' before 'B' 4 | llong B[100000]; ...
s717998281
p03821
C
long c;main(long a,long b){a-1?~scanf("%d%d",&a,&b)&&(main(),c=(a+c-1)/b*b+b-a):(main(gets(&a)),printf("%ld\n",c));}
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int] 1 | long c;main(long a,long b){a-1?~scanf("%d%d",&a,&b)&&(main(),c=(a+c-1)/b*b+b-a):(main(gets(&a)),printf("%ld\n",c));} | ^~~~ main.c: In function 'main': main.c:1:33: error: implicit declaration of function 'scanf' [-Wimplicit-function...
s473343988
p03821
C++
/*-****************************************-*/ #define USE_CPP11 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <iomanip> #include <string> #include <sstream> #include <vector> #include <list> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <bitset> #ifdef USE...
a.cc:101:1: error: '::main' must return 'int' 101 | ll main() { | ^~
s106687511
p03821
C++
use std::io::{self, Stdin}; use std::str::{self, FromStr}; use std::error::Error; use std::thread; fn exec() { let mut sc = Scanner::new(); let n: usize = sc.ne(); let mut a = vec![0; n]; let mut b = vec![0; n]; for i in 0..n { a[i] = sc.ne(); b[i] = sc.ne(); } let mut cur = ...
a.cc:10:14: error: too many decimal points in number 10 | for i in 0..n { | ^~~~ a.cc:15:15: error: too many decimal points in number 15 | for i in (0..n).rev() { | ^~~~ a.cc:29:2: error: invalid preprocessing directive #[ 29 | #[allow(dead_code)] | ^ a.cc:...
s706126823
p03821
C++
#include <iostream> using namespace std; int main(){ int n; int a[100000], b[100000]; for(int i = 0; i < n; i++){ cin >> a[i] >> b[i]; } int cnt = 0; for(int i = n - 1; i >= 0 n; i--){ while(a[i] % b[i] != 0){ for(int j = 0; j <= i; j++){ a[j]++; } cnt++; } } cout << cnt; return 0; }
a.cc: In function 'int main()': a.cc:13:34: error: expected ';' before 'n' 13 | for(int i = n - 1; i >= 0 n; i--){ | ^~ | ; a.cc:13:36: error: expected ')' before ';' token 13 | for(int i = n - 1; i >= 0 n; i--){ |...
s222851836
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a=new long[n]; long[] b=new long[n]; long ans=0; for(int i=0; i<n; i++){ a[i] = Long.parseLong(sc.next()); b[i] = Long.parseLong(sc.next()); } for(i...
Main.java:21: error: <identifier> expected System.out.println(ans); ^ Main.java:21: error: <identifier> expected System.out.println(ans); ^ Main.java:22: error: illegal start of type return; ^ Main.java:24: error: class, interface, enum, or record expected } ^ 4 error...
s653000956
p03821
C++
#include <iostream> #include <vector> #include <cstdint> using namespace std; int main() { ios::sync_with?stdio(false); cin.tie(0); int_least32_t n; cin >> n; vector<int_least32_t> a( n ), b( n ); for(auto i = 0; i < n; ++i) { cin >> a[i] >> b[i]; } int_fast32_t count{ 0 }, temp; for(auto i = n - 1; i ...
a.cc: In function 'int main()': a.cc:9:14: error: 'sync_with' is not a member of 'std::ios' {aka 'std::basic_ios<char>'} 9 | ios::sync_with?stdio(false); | ^~~~~~~~~ a.cc:9:24: error: 'stdio' was not declared in this scope; did you mean 'stdin'? 9 | ios::sync_with?stdio(false)...
s256956522
p03821
C++
#include<stdio.h> void addNum(int* a, int i, int plus) { while (i > 0){ a[i - 1] += plus; i--; } } int main() { int pushCount = 0; int n; scanf_s("%d", &n); int a[100000]; int b[100000]; for (int i = 0; i < n; i++) { scanf_s("%d%d", &a[i], &b[i]); } for (int i = n - 1; i >= 0; i--) { int plus = ...
a.cc: In function 'int main()': a.cc:15:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 15 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s783283971
p03821
C++
#include<stdio.h> void addNum(int* a, int i) { while (i > 0){ a[i - 1]++; i--; } } int main() { int pushCount = 0; int n; scanf_s("%d", &n); int* a = new int[n]; int* b = new int[n]; for (int i = 0; i < n; i++) { scanf_s("%d%d", &a[i], &b[i]); } for (int i = n - 1; i >= 0; i--) { while (a[i] % b...
a.cc: In function 'int main()': a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s762553489
p03821
Java
import java.util.Scanner; public class AtCorer1Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ int cnt = 0; int ans = 0; // 入力処理 Scanner inData = new Scanner(System.in); int len = inData.nextInt(); int a[] = new int[len]; int b[] = new int[len]; for(cnt = (len - ...
Main.java:3: error: class AtCorer1Main is public, should be declared in a file named AtCorer1Main.java public class AtCorer1Main { ^ 1 error
s355722581
p03821
Java
package AtCorder1; import java.util.Scanner; public class AtCorer1Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ int cnt = 0; int ans = 0; // 入力処理 Scanner inData = new Scanner(System.in); int len = inData.nextInt(); int a[] = new int[len]; int b[] = new int[len]; ...
Main.java:5: error: class AtCorer1Main is public, should be declared in a file named AtCorer1Main.java public class AtCorer1Main { ^ 1 error
s331259470
p03821
C++
#include <iostream> #define int long long using namespace std; const int MAX_N = 100000; int main() { int N, a[MAX_N], b[MAX_N]; int ret = 0; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d %d", &a[i], &b[i]); } for (int i = N - 1; i >= 0; i--) { int ii = a[i] + ret; if (ii == 0) continue; in...
cc1plus: error: '::main' must return 'int'
s774072011
p03821
C++
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, m, n) for (int i = m, i < n; ++i) #define INF 1000 * 1000 typedef long long ll; using namespace std; int main() { ll c; ll n; cin >>...
a.cc: In function 'int main()': a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:17:12: note: to match this '{' 17 | int main() { | ^
s125398158
p03821
C++
#include <iostream> #include <time.h> #include <vector> #include <stdio.h> #include <memory.h> #include <string> #include <map> #include <algorithm> #include <bitset> #include <queue> #include <set> #include <time.h> #include <assert.h> #include <sstream> //#include <unordered_map> #include <bitset> #include <utility>...
a.cc:26:10: fatal error: inc.h: No such file or directory 26 | #include "inc.h" | ^~~~~~~ compilation terminated.
s230678653
p03821
C++
#include <iostream> #include <time.h> #include <vector> #include <stdio.h> #include <memory.h> #include <string> #include <map> #include <algorithm> #include <bitset> #include <queue> #include <set> #include <time.h> #include <assert.h> #include <sstream> //#include <unordered_map> #include <bitset> #include <utility>...
a.cc:26:10: fatal error: inc.h: No such file or directory 26 | #include "inc.h" | ^~~~~~~ compilation terminated.