submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s355911939 | p03845 | Java | import java.util.Scanner;
public class Proc {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] t = new int[n+1];
int sum = 0;
for(int i=1; i<=n; i++) {
t[i]=scan.nextInt();
sum+=t[i];
}
int m = scan.nextInt();
int[] result = new int[... | Main.java:3: error: class Proc is public, should be declared in a file named Proc.java
public class Proc {
^
1 error
|
s898108862 | p03845 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N;
vector<int> T[N];
for (int i = 1; i <= N; i++) {
cin >> T[i - 1];
}
cin >> M;
vector<int> P[M], X[M];
for (int i = 1; i <= M; i++) {
cin >> P[i - 1] >> X[i - 1];
}
for (... | a.cc: In function 'int main()':
a.cc:11:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>')
11 | cin >> T[i - 1];
| ~~~ ^~ ~~~~~~~~
| | |
| | std::vector<int>
| ... |
s811091482 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n; cin>>n;
int time=0;
vector<int> t(n);
rep(i,n){
cin>>t.at(i);
time+=t.at(i);
}
int m; cin>>m;
vector<vector<int>> X(m,vector<int>(2));... | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s667673162 | p03845 | C | 5
7 2 3 8 5
3
4 2
1 7
4 13 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 5
| ^
|
s617515966 | p03845 | C | #include<stdio.h>
int mian(void){
int n,d,i,j;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++){
scanf("%d",a[i]);
}
scanf("%d",&d);
int dr[n][2],sum=0;
for(i=0;i<d;i++){
scanf("%d %d",dr[i][0],dr[i][1]);
}
for(i=0;i<d;i++){
for(j=0;j<n;j++){
if(a[j]==dr[j][0]){
sum+=dr[j][1];
... | /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
|
s840459001 | p03845 | C++ | #include <iostream>
using namespace std;
int a[105]
int main()
{
int n;
cin>>n;
int sum=0;
for(int i=1;i<=n;i++)
{
cin>>a[i];
sum+=a[i];
}
int m;
cin>>m;
for(int i=1;i<=m;i++)
{
int x,y;
cin>>x>>y;
sum=sum-a[x]+y;
cout<<sum<<endl;
... | a.cc:4:1: error: expected initializer before 'int'
4 | int main()
| ^~~
|
s589434230 | p03845 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
int main(){
ll n;
cin>>n;
ll t[n];
for(ll i=0;i<n;++i){
cin>>t[i];
}
ll t_copy[n];
ll flag;
ll sum=0;
ll m;
cin>>m;
ll p[m];
ll x[m];
for(ll i=0;i<m;++i){
... | a.cc: In function 'int main()':
a.cc:24:18: 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'})
24 | cin>>p[i]<<x[i];
| ~~~~~~~~~^~~~~~
| | |
| ... |
s564988219 | p03845 | C++ | N=int(input())
T=[int(x) for x in input().split()]
M=int(input())
sm=sum(T)
for _ in range(M):
a,b=map(int,input().split())
res=sm+b-T[a-1]
print(res) | a.cc:1:1: error: 'N' does not name a type
1 | N=int(input())
| ^
|
s897264115 | p03845 | C++ | N=int(input())
T=[int(x) for x in input().split()]
M=int(input())
sm=sum(T)
for _ in range(M):
a,b=map(int,input().split())
res=sm+b-T[a-1]
print(res) | a.cc:1:1: error: 'N' does not name a type
1 | N=int(input())
| ^
|
s121871244 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
main(){
int n;cin>>n;
long long int a[101000],s=0;
for(int i=1;i++;i<=n){
cin>>a[i];sum+=a[i];}
int m;cin>>m;
while(m--){
int p,x;
cin>>p>>x;
cout<<s+x-a[p]<<endl;}
}
| 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:13: error: 'sum' was not declared in this scope
7 | cin>>a[i];sum+=a[i];}
| ^~~
|
s377022020 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
main(){
int n;cin>>n;
long long int a[101000],s=0;
for(int i=1;i++;i<=n){
cin>>a[i];sum+=a[i];}
int m;cin>>m;
while(m--){
int p,x;
cin>>p>>x;
cout<<sum+x-a[p]<<endl;}
}
| 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:13: error: 'sum' was not declared in this scope
7 | cin>>a[i];sum+=a[i];}
| ^~~
a.cc:12:9: error: 'sum' was not declared in this scope
12 |... |
s930377448 | p03845 | C++ | # include <bits/stdc++.h>
using namespace std;
# define res(a,b,c) for (int64 a=b ; a<c ; a++)
# define ress(a,b) for (auto a = b.begin() ; a!=b.end() ; a++)
# define all(con) con.begin() , con.end()
# define INF (int)1e9
# define MOD 1000000007
# define pb push_back
# define mp make_pair
# define f first
# de... | a.cc: In function 'int main()':
a.cc:32:9: error: 'in64t' was not declared in this scope; did you mean 'int64_t'?
32 | in64t n;
| ^~~~~
| int64_t
a.cc:33:14: error: 'n' was not declared in this scope; did you mean 'yn'?
33 | cin>>n;
| ^
| ... |
s382212048 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_bas::sync_with_stdio(0); cout.tie(0); cin.tie(0);
int n, m, sum = 0, p, x;
cin >> n;
vector<int> t(n);
for(int i = 0; i < n; i++)
{
cin >> t[i];
sum += t[i];
}
cin >> m;
while(m--)
{
cin >> p >> x;
cout << sum-t[p-... | a.cc: In function 'int main()':
a.cc:6:3: error: 'ios_bas' has not been declared
6 | ios_bas::sync_with_stdio(0); cout.tie(0); cin.tie(0);
| ^~~~~~~
|
s766110061 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,t[101],p,x,sum = 0;
cin >> n;
for(int i=0;i<n;i++){
cin >> t[i];
sum += t[i];
}
cin >> m;
for(int i=0;i<m;i++){
cin >> p;
cin >> x;
cout << sum + x - t[p-1]
}
} | a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '}' token
17 | cout << sum + x - t[p-1]
| ^
| ;
18 | }
| ~
|
s678191723 | p03845 | C++ | # include <bits/stdc++.h>
using namespace std;
int x, y, z, t1, t2, t3, cnt, bnt;
int main(){
cin >> n;
for (int i = 0; i < n; i ++){
cin >> a;
if (n == 3 && a == 2){
cout << 6 << endl << 9;
break;
}
else if (n == 5 && a == 7){
cout << 19 << en... | a.cc: In function 'int main()':
a.cc:5:12: error: 'n' was not declared in this scope
5 | cin >> n;
| ^
a.cc:7:16: error: 'a' was not declared in this scope
7 | cin >> a;
| ^
a.cc:17:12: error: 'b' was not declared in this scope
17 | cin >> b;
| ... |
s576677206 | p03845 | C++ | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;
int main() {
int n, m, s = 0;
cin >> n;
vector<int> t(n);
rep(i, n) cin >> t[i];
cin >> m;
vector<int> p(m), x(m);
rep(i, m) cin >> p[i] >> x[i];
rep(i, n) s += v[i];
rep(i, m) cout << s -... | a.cc: In function 'int main()':
a.cc:14:18: error: 'v' was not declared in this scope
14 | rep(i, n) s += v[i];
| ^
a.cc:15:25: error: 'v' was not declared in this scope
15 | rep(i, m) cout << s - v[p[i]-1] + x[i] << endl;
| ^
|
s883557373 | p03845 | C++ | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;
int main() {
int n, m, s = 0;
cin >> n;
vector<int> t(n);
rep(i, n) cin >> t[i];
cin >> m;
vector<int> p(m), x(m);
rep(i, m) cin >> p[i] >> x[i];
rep(i, n) s += v[i];
rep(i, m){
cout <... | a.cc: In function 'int main()':
a.cc:14:18: error: 'v' was not declared in this scope
14 | rep(i, n) s += v[i];
| ^
a.cc:16:17: error: 'v' was not declared in this scope
16 | cout << s - v[p[i]-1] + x[i] << endl;
| ^
a.cc:18:2: error: expected '}' at end of input... |
s618438709 | p03845 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int total = 0;
int[] T = new int[N];
for(int i=0;i<N;i++) {
T[i] = sc.nextInt();
total += T[i];
}
int m = sc.nextInt();
for... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s207101246 | p03845 | C++ | #include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define SQ(a) (a)*(a)
typedef long long ll;
using namespace std;
int solve(int p, int x) {
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, sum ... | a.cc: In function 'int solve(int, int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
17 | }
| ^
a.cc: In function 'int main()':
a.cc:37:12: error: redeclaration of 'int x'
37 | int p, x;
| ^
a.cc:28:9: note: 'int x' previously declared here
... |
s093809435 | p03845 | Java | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] t = new int[n];
int totalTime = 0;
for(int i=0; i<n; i++){
t[i] = sc.nextInt();
totalTime += t[i];
}
int m = sc.nextInt()... | Main.java:23: error: cannot find symbol
System.out.prinln(totalTime-t[p[i][0]]+p[i][1]);
^
symbol: method prinln(int)
location: variable out of type PrintStream
1 error
|
s427266915 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> T;
for(int i=0; i<N; i++){
int c;
cin >> c;
T.push_back(c);
}
int M;
cin >> M;
vector<int> P, X;
for(int i=0; i<M; i++){
int a, b;
cin >> a >> b;
P.p... | a.cc: In function 'int main()':
a.cc:39:2: error: expected '}' at end of input
39 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s610628054 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M,sum=0,dsum; cin>>N>>M;
vector<int> T(N),P(M),X(M);
for(int i=0; i<N;i++){
cin>>T.at(i);}
for(int i=0; i<N; i++){
sum+= T.at(i);}
for(int j=0; j<M;j++){
cin>>P.at(i)>>X.at(i);}
for(int k=0;k<M;k++){dsum=sum;
dsum-=T.at(P... | a.cc: In function 'int main()':
a.cc:14:15: error: 'i' was not declared in this scope
14 | cin>>P.at(i)>>X.at(i);}
| ^
a.cc:17:21: error: 'i' was not declared in this scope
17 | dsum-=T.at(P.at(i)); dsum+=X.at(i);cout<<dsum<<endl;}
| ^
|
s875401789 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M,sum=0,dsum; cin>>N>>M;
vector<int> T(N),P(M),X(M);
for(int i=0; i<N;i++){
cin>>T(i);}
for(int i=0; i<N; i++){
sum+= T(i);}
for(int j=0; j<M;j++){
cin>>P(i)>>X(i);}
for(int k=0;k<M;k++){dsum=sum;
dsum-=T(P(i)); dsum+=X(i... | a.cc: In function 'int main()':
a.cc:10:11: error: no match for call to '(std::vector<int>) (int&)'
10 | cin>>T(i);}
| ~^~~
a.cc:12:12: error: no match for call to '(std::vector<int>) (int&)'
12 | sum+= T(i);}
| ~^~~
a.cc:14:12: error: 'i' was not declared in this scope
1... |
s799710631 | p03845 | C++ | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define printd(val) std::cout<< #val" = " <<val<<"\n";
#define printv(val) std::for_each(val.begin(),val.end(),[](auto x){cout<<x<<"\n";});
#define ALL(f,... | a.cc:100:2: error: stray '\' in program
100 | \\ ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
| ^
a.cc:100:3: error: stray '\' in program
100 | \\ ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
| ^
|
s968939474 | p03845 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int t = new int[N];
int sum = 0;
for(int i=0;i<N;i++)
{
t[i] = sc.nextInt();
sum += t[i];
}
int M = sc.nextInt();
int p;
int x;
int... | Main.java:7: error: incompatible types: int[] cannot be converted to int
int t = new int[N];
^
Main.java:11: error: array required, but int found
t[i] = sc.nextInt();
^
Main.java:12: error: array required, but int found
sum += t[i];
^
Main.java:25: error: array required, but i... |
s137204932 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
#define re register
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
x=(x<<1)+(x<<3)+(ch^48);//x=x*10+ch-'0';
ch=getcha... | a.cc: In function 'int main()':
a.cc:49:17: error: 'out' was not declared in this scope
49 | out(sum-a[x]+y);
| ^~~
|
s339754600 | p03845 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();//回答時間
int time[] = new int[N];
for(int i = 0;i < N;i++){
time[i] = sc.nextInt();
}
int M = sc.nextInt();//ドリンク
for(int j = 0;j < M;j++){
int targe... | Main.java:24: error: cannot find symbol
total = total - time[target[k]] +change[k];
^
symbol: variable target
location: class Main
Main.java:24: error: cannot find symbol
total = total - time[target[k]] +change[k];
^
symbol: variabl... |
s900291296 | p03845 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int n,a[100+5],x,y,h;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++){scanf("%d",&a[i]);h+=a[i];}
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d%d",&x,&y);。
printf("%d\n",h-a[x]+y);
}
return 0;
} | a.cc:12:25: error: extended character 。 is not valid in an identifier
12 | scanf("%d%d",&x,&y);。
| ^
a.cc: In function 'int main()':
a.cc:12:25: error: '\U00003002' was not declared in this scope
12 | scanf("%d%d",&x,&y);。
| ^~
|
s744702606 | p03845 | C++ | n=int(input())
t=[int(i) for i in input().split()]
s=sum(t)
m=int(input())
for i in range(m):
p,m=[int(i) for i in input().split()]
print(s-(t[p-1]-m)) | a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s256999380 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n;
int t[n];
cin>>t;
cin>>m;
int sum=0;
int i;
for(i=0;i<n;i++){
sum+=t[i];
}
int p[m],x[m];
for(i=0;i<m;i++){
cin>>p[i]>>x[i];
}
for(i=0;i<m;i++){
cout<<sum+(x[i]-t[p[i]]);
}
} | a.cc: In function 'int main()':
a.cc:8:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [n]')
8 | cin>>t;
| ~~~^~~
| | |
| | int [n]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include... |
s393549520 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,a[100+5],x,y,h;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);h+=a[i];
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d%d",&x,&y);
printf("%d\n",h-a[x]+y);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:48: error: 'i' was not declared in this scope
7 | for(int i=1;i<=n;i++) scanf("%d",&a[i]);h+=a[i];
| ^
|
s987997696 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt =0;
vector<int> t(n),T(n);
for(int i=0;i<n;i++){
cin >> t.at(i);
cnt += t.at(i);
}
cin >> m;
vector<int> p(m),x(m);
for(int i=0;i<m;i++){
cin >> p.at(i) >> x.at(i);
T.at(p.at(i)-1) = t.at(p.at(i)-1) - ... | a.cc: In function 'int main()':
a.cc:13:10: error: 'm' was not declared in this scope
13 | cin >> m;
| ^
|
s164136947 | p03845 | Java | import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;
public class Main {
public static void main(String[] args) {
int i,j;
Scanner sc = new Scanner(in);
int n = parseInt(sc.next());
... | Main.java:16: error: not a statement
t[i] = parseInt(sc.next());1
^
Main.java:16: error: ';' expected
t[i] = parseInt(sc.next());1
^
2 errors
|
s156377370 | p03845 | C++ | // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
std::cout << "This world is so great\n";
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug... | a.cc:4:10: fatal error: pch.h: No such file or directory
4 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s559945032 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a[105],sum=0;
int main(){
cin>>n
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
sin>>m;
while(m--){
int p,x;
scanf("%d%d",&p,&x);
printf("%d\n",sum-a[p]+x);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:11: error: expected ';' before 'for'
5 | cin>>n
| ^
| ;
6 | for(int i=1;i<=n;i++){
| ~~~
a.cc:6:17: error: 'i' was not declared in this scope
6 | for(int i=1;i<=n;i++){
| ^
a.cc:10:8: error... |
s582465888 | p03845 | C++ | #include<iostream>
using namespace std;
int main() {
int N;
cin >> N;
int a[N], sum = 0;
for (int i = 0; i < N; i++) {
cin >> a[i];
sum = sum + a[i];
}
int M;
cin >> M;
int P[M], X[M], sum[M];
for (int j = 0; j < M; j++) {
cin >> P[j] >> X[j];
sum[j] = sum - (a[P[j] - 1] + X[j]);
cout << sum[j] << en... | a.cc: In function 'int main()':
a.cc:13:25: error: conflicting declaration 'int sum [M]'
13 | int P[M], X[M], sum[M];
| ^~~
a.cc:6:19: note: previous declaration as 'int sum'
6 | int a[N], sum = 0;
| ^~~
a.cc:16:20: error: invalid types 'int[i... |
s943104552 | p03845 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(){
int N;
cin >> N;
int T[N];
long long int all = 0LL;
for(int = 0; i < N; i++){
cin >> T[i];
all += T[i];
}
int M;
cin >> M;
pair<int, int> D[M];
for(int i = 0; i < M; i++){
int a, b;
cin >> a >> b;... | a.cc: In function 'int main()':
a.cc:12:11: error: expected unqualified-id before '=' token
12 | for(int = 0; i < N; i++){
| ^
a.cc:12:10: error: expected ';' before '=' token
12 | for(int = 0; i < N; i++){
| ^~
| ;
a.cc:12:11: error: expected primary-expression b... |
s785155567 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int N;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
}
int M;
cin ... | a.cc: In function 'int main()':
a.cc:21:23: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)'
21 | cout << accumulate(T.begin(), T.end()) << endl;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
... |
s176459349 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int N;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
}
int M;
cin ... | a.cc: In function 'int main()':
a.cc:21:23: error: no matching function for call to 'accumulate(std::vector<int>&)'
21 | cout << accumulate(T) << endl;
| ~~~~~~~~~~^~~
In file included from /usr/include/c++/14/numeric:62,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:... |
s196955804 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int N;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
}
int M;
cin ... | a.cc: In function 'int main()':
a.cc:21:13: error: 'sum' was not declared in this scope
21 | cout << sum(T) << endl;
| ^~~
|
s963321379 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,T=0;
cin >> N;
vector<int> t(N);
for (int i = 0; i < N; i++){
cin >> t[i];
T+=t[i];
}
int M,
cin >> M;
int P,X;
for (int i = 0; i < M; i++){
cin >> P >> X;
cout << T-t[P]+X;
}
} | a.cc: In function 'int main()':
a.cc:12:7: error: expected initializer before '>>' token
12 | cin >> M;
| ^~
|
s428575964 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
vector<int> base(a);
for(int &x:base){
cin>>x;
}
int b;
cin>>b;
vector<vector<int>> pow(b,vector<int>(2));
for(int i=0;i<b;i++){
cin>>pow[i][0]>>pow[i][1];
}
int sum=0;
for(int i=0;i<a;i++){
sum+=base[i];
}
... | a.cc: In function 'int main()':
a.cc:24:5: error: expected ',' or ';' before 'log'
24 | log+=pow[i][1]-base[g];
| ^~~
|
s337115390 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
vector<int> base(a);
for(&x:base){
cin>>x;
}
int b;
vector<vector<int>> pow(b,vector<int>(2));
for(int i=0;i<b;i++){
cin>>pow[i][0]>>pow[i][1];
}
int sum=0;
for(int i=0;i<a;i++){
sum+=base[i];
}
for(int i=0;i... | a.cc: In function 'int main()':
a.cc:8:9: error: found ':' in nested-name-specifier, expected '::'
8 | for(&x:base){
| ^
| ::
a.cc:8:8: error: 'x' has not been declared
8 | for(&x:base){
| ^
a.cc:11:8: error: expected initializer before ';' token
11 | int b;
... |
s532579865 | p03845 | C++ | // luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int sum=0;
int main(){
int n,m,a[1005];
int u,q;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]
sum+=a[i];
}
cin>>m;
while(m--){
cin>>u>>q;
cout<<sum-a[u]+q;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'sum'
10 | cin>>a[i]
| ^
| ;
11 | sum+=a[i];
| ~~~
|
s572487129 | p03845 | C++ | // luogu-judger-enable-o2
#include<cstdio>
using namespace std;
int sum=0;
int main(){
int n,m,a[1005];
int u,q;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]
sum+=a[i];
}
cin>>m;
while(m--){
cin>>u>>q;
cout<<sum-a[u]+q;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
8 | cin>>n;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<cstdio>
+++ |+#include <iostream>
3 | using namespace st... |
s566162685 | p03845 | C++ | #include <cstdio>
#include <vector>
int main() {
int n;
scanf("%d", &n);
vector<int> t;
vector<int> sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &t[i]);
sum += t[i];
}
int m;
scanf("%d", &m);
vector<int> p;
vector<int> x;
for (int i = 0; i < n; i++) {
scanf("%d", &p[i]);
... | a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> t;
| ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector... |
s567750997 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int N, M;
int main () {
int total = 0;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
total += T[i];
}
cin >> M;
vrctor<int> P(M);
vector<int> X(M);
for (int i = 0; i < M; i++){
cin >> P[i] >> X[i];
}
for (int ... | a.cc: In function 'int main()':
a.cc:16:3: error: 'vrctor' was not declared in this scope
16 | vrctor<int> P(M);
| ^~~~~~
a.cc:16:10: error: expected primary-expression before 'int'
16 | vrctor<int> P(M);
| ^~~
a.cc:20:12: error: 'P' was not declared in this scope
20 | cin >> P[i... |
s793767902 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int N, M;
int main () {
int total = 0;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
total += T[i];
}
cin >> M;
vrctor<int> P(M);
vector<int> X(M);
for (int i = 0; i < M; i++){
cin >> P[i] >> X[i];
}
for (int ... | a.cc: In function 'int main()':
a.cc:16:3: error: 'vrctor' was not declared in this scope
16 | vrctor<int> P(M);
| ^~~~~~
a.cc:16:10: error: expected primary-expression before 'int'
16 | vrctor<int> P(M);
| ^~~
a.cc:20:12: error: 'P' was not declared in this scope
20 | cin >> P[i... |
s421920728 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int N, M;
int main () {
int total = 0;
cin >> N;
vector<int> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
total += T[i];
}
cin >> M;
vrctor<int> P(M);
vector<int> X(M);
for (int i = 0; i < M; i++){
cin >> P[i] >> X[i];
}
for (int ... | a.cc: In function 'int main()':
a.cc:16:3: error: 'vrctor' was not declared in this scope
16 | vrctor<int> P(M);
| ^~~~~~
a.cc:16:10: error: expected primary-expression before 'int'
16 | vrctor<int> P(M);
| ^~~
a.cc:20:12: error: 'P' was not declared in this scope
20 | cin >> P[i... |
s207457242 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int N, M;
int main () {
long total = 0;
cin >> N;
vector<long> T(N);
for (int i = 0; i < N; i++){
cin >> T[i];
total += T[i];
}
cin >> M;
vrctor<int> P(M);
vector<long> X(M);
for (int i = 0; i < M; i++){
cin >> P[i] >> X[i];
cout ... | a.cc: In function 'int main()':
a.cc:17:3: error: 'vrctor' was not declared in this scope
17 | vrctor<int> P(M);
| ^~~~~~
a.cc:17:10: error: expected primary-expression before 'int'
17 | vrctor<int> P(M);
| ^~~
a.cc:21:12: error: 'P' was not declared in this scope
21 | cin >> P[i... |
s149391273 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bool chmin(T &a, T b) {
if(a > b) {
... | a.cc: In function 'int main()':
a.cc:41:13: error: found ':' in nested-name-specifier, expected '::'
41 | int x, p:
| ^
| ::
a.cc:41:12: error: 'p' has not been declared
41 | int x, p:
| ^
a.cc:42:9: error: qualified-id in declaration before '>>' token
... |
s566672949 | p03845 | C++ | #include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
char n[100] ;
int x,y,sum;
cin>>x;
for(int i=0;i<x;i++)
cin>>n[i];
int m[100][100];
cin>>y;
for(int k=0;k<y;k++){
for(int j=0;j<2;j++)
cin>>m[j];
}
cout<<n;
} | a.cc: In function 'int main()':
a.cc:17:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [100]')
17 | cin>>m[j];
| ~~~^~~~~~
| | |
| ... |
s204903288 | p03845 | C++ | #include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;
int main(){
int N; cin >> N;
vector<int> T(N);
for(int i = 0; i < N; i++) cin >> T[... | a.cc: In function 'int main()':
a.cc:18:15: error: expected primary-expression before '>>' token
18 | int M; cin> >> M;
| ^~
|
s483869623 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
int main(){
int N, M;
cin >> N;
vector<int> T(N);
int sum = 0;
rep(i, N){
cin >> T.at(i);
sum += T,at(i);
}
cin >> M;
rep(i, M){
int Num, time;
cin >> Num >> time;
int ans = sum - T.at(Num - 1) + time;
... | a.cc: In function 'int main()':
a.cc:12:21: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<int>')
12 | sum += T,at(i);
| ~~~~^~~~
a.cc:12:26: error: 'at' was not declared in this scope
12 | sum += T,at(i);
| ... |
s138657048 | p03845 | C++ | #include "stdafx.h"
#include<math.h>
#include<map>
#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include<array>
#include<tuple>
#include<queue>
#include<stack>
#include<iomanip>
#include<bitset>
#include <list>
#include<numeric>
//AtCoderC++.cpp
using namespace std;
inline int ceiling(in... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s467407716 | p03845 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#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) FFOR(i,0,n)
#define SORT(V) sor... | a.cc: In function 'int main()':
a.cc:31:50: error: expected primary-expression before '<<' token
31 | for(int i=1; i<=M; ++i) cout<<ans-T[P[i]]+X[i];<<endl;
| ^~
|
s483179020 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
int n,m;
vector<int> t(n... | a.cc: In function 'int main()':
a.cc:27:29: error: expected primary-expression before '<<' token
27 | cout<<sum-t[p[i]-1]+x[i];<<endl;
| ^~
|
s591391761 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,v[105],m,sum;
int main(){
scanf("%d",&n);
for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
scanf("%d",&m);
while(m--){
int x,p;
scanf("%d%d",&x,&p);
printf("%d\n",sum-v[x]+p);
}
return 0;
} | a.cc:6:42: warning: missing terminating " character
6 | for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
| ^
a.cc:6:42: error: missing terminating " character
6 | for(register int i=1;i<=n;i++) scanf("%d,&v[i]),sum+=v[i];
| ... |
s251521303 | p03845 | C++ |
#include<stdio.h>
using namespace std;
int a[103];
int main(){
int n,m,p,x;
int sum=0;
cin>>n;
for(int i=0;i<n;++i){
scanf("%d",&a[i]);
sum+=a[i];
}
cin>>m;
for(int i=0;i<m;++i){
scanf("%d %d",&p,&x);
if(x<a[p-1])
printf("%d\n",sum-(a[p-1]-x));
else
printf("%d\n",sum+(x-a[p-1]));}} | a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | 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 nam... |
s179945781 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long N = 1e4;
char arr[N][N];
char arr1[N][N];
int main()
{
int n,m;
scanf("%d %d",&n,&m);
for(int i=0; i<n; i++)
scanf("%s",arr[i]);
for(int i=0; i<m; i++)
scanf("%s",arr1[i]);
for(int i=0; i<n; i++)
{
for(... | a.cc: In function 'int main()':
a.cc:40:20: error: expected '}' at end of input
40 | printf("No\n");
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s768133153 | p03845 | C++ | #include<iostream>
using namespace std;
int main()
{
int s,arr[100],m,a,b;
int sum=0;
cin>>s;
for(int i=0; i<s; ++i)
{
cin>>arr[i];
}
cin>>m;
while(m--)
{
sum=0;
cin>>a>>b;
for(int i=0; i<n; ++i)
{
if(i==a-1)
sum+=b;... | a.cc: In function 'int main()':
a.cc:17:24: error: 'n' was not declared in this scope
17 | for(int i=0; i<n; ++i)
| ^
|
s536124524 | p03845 | C++ | #include <bits
using namespace std;
long long n, m;
long long t[100010] ;
long long t;
struct t {
long long x, y;
} He[100010];
int main () {
cin>>n;
for(int i=1;i<=n;i++)
cin>>t[i] ;
cin>>m;
for(int i=1;i<=m;i++)
cin>>He[i].x>>He[i]. y;
for(int i=1;i<=n;i++){
long long sum=0;
for(int j=1;j<=He[i].x;j++)
sum+=t[i] ;
su... | a.cc:1:15: error: missing terminating > character
1 | #include <bits
| ^
a.cc:1:10: fatal error: bits: No such file or directory
1 | #include <bits
| ^
compilation terminated.
|
s548937519 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n;
int t[n];
int s[n];
for(int a=0;a<n;a++)
{
cin>>t[a];
s[a]=t[a];
}
cin>>m;
int p[m]={0};
int x[m]={0};
int sum[m]={0};
for(int a=0;a<m;a++)
... | a.cc: In function 'int main()':
a.cc:33:23: error: 'i' was not declared in this scope
33 | t[i]=s[j];
| ^
|
s941352276 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int w,s,c=0,z;
scanf("%d%d",&k,&s);
for(int x=0;x<=w;x++)
{
for(int y=0;y<=w;y++)
{
int z=s-(x+y);
if(z>=0&&z<=w)
c++;
}
}
printf("%d",c);
} | a.cc: In function 'int main()':
a.cc:6:23: error: 'k' was not declared in this scope
6 | scanf("%d%d",&k,&s);
| ^
|
s473030170 | p03845 | C++ | 7:36 م
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t[100100];
int n;
cin >> n;
int i = 1;
while(n --)
{
cin >> t[i];
i ++;
}
int m;
cin >> m;
while(m --)
{
int p, x;
cin >> p >> x;
int c;
c = t[p];
t[p] = ... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 7:36 م
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/... |
s072944781 | p03845 | C++ |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t[100100];
int n;
cin >> n;
int m = 1;
while(n --)
{
cin >> t[m];
i ++;
}
int m;
cin >> m;
while(m --)
{
int p, x;
cin >> p >> x;
int c;
c = t[p];
t[p] = x;
... | a.cc: In function 'int main()':
a.cc:13:9: error: 'i' was not declared in this scope
13 | i ++;
| ^
a.cc:15:9: error: redeclaration of 'int m'
15 | int m;
| ^
a.cc:9:9: note: 'int m' previously declared here
9 | int m = 1;
| ^
a.cc:25:28: error: 'i' wa... |
s321809489 | p03845 | C++ | #include<iostream>
using namespace std;
int main()
{
int n,m,u;
cout<<"please enter the number of times \n";
cin>>n;
int time[n];
for (int i=0;i<n;i++)
cin>>time[i];
cin>>m;
int drink[m][2];
for(int j=0;j<m;j++)
{
for(int i=0;i<2;i++)
cin>>drink[j][i];
}
for(int j=0;j<m;j++)
{
u=0;
for(int i=0;i<n;i++)
{
u+=... | a.cc: In function 'int main()':
a.cc:31:15: error: 's' was not declared in this scope
31 | cout<<s<<endl;
| ^
|
s662838627 | p03845 | C++ | #include<iostream>
using namespace std;
int main()
{
int n,m,u;
cout<<"please enter the number of times \n";
cin>>n;
int time[n];
for (int i=0;i<n;i++)
cin>>time[i];
cin>>m;
int drink[m][2];
for(int j=0;j<m;j++)
{
for(int i=0;i<2;i++)
cin>>drink[j][i];
}
for(int j=0;j<m;j++)
{
u=0;
for(int i=0;i<n;i++)
{
u+=... | a.cc: In function 'int main()':
a.cc:31:15: error: 's' was not declared in this scope
31 | cout<<s<<endl;
| ^
|
s794323902 | p03845 | C++ | include<iostream> using namespace std; #define h 100100 int t[h]; int main(){ int n; cin>>n; int i=1; while(n --){ cin>>t[i]; i++; } int m; cin>>m; while(m--){ int p,x; cin>>p>>x; int c; c=t[p]; t[p]=x; int sum=0; for(int j=1;j<i;j++){ sum+=t[j]; } cout<<sum<<endl; t[p]=c; } return... | a.cc:1:40: error: stray '#' in program
1 | include<iostream> using namespace std; #define h 100100 int t[h]; int main(){ int n; cin>>n; int i=1; while(n --){ cin>>t[i]; i++; } int m; cin>>m; while(m--){ int p,x; cin>>p>>x... |
s126055133 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
struct Line{
ll a;
ll b;
ll p;
};
const ll inf = (ll)4e18;
struct cht{
deque<Line> hull;
void clean(){
hull.clear();
}
ll div(ll x, ll y){
return (x/y - (x%y != 0 && (x ^ y) < 0));
}
void push(Line T){
int ... | a.cc:6:5: error: 'll' does not name a type
6 | ll a;
| ^~
a.cc:7:5: error: 'll' does not name a type
7 | ll b;
| ^~
a.cc:8:5: error: 'll' does not name a type
8 | ll p;
| ^~
a.cc:11:7: error: 'll' does not name a type
11 | const ll inf = (ll)4e18;
| ^... |
s572421196 | p03845 | C++ | #include<iostream>
using namespace std;
#define h 100100
int t[h];
int main(){
int n;
cin>>n;
int i=1;
while(n --){
cin>>t[i];
i++;
}
int m;
cin>>m;
while(m--){
int p,x;
cin>>p>>x;
int c;
c=t[p];
t[p]=x;
int sum=0;
for(int j=1;j<i;j++){
sum+=t[j];
}
cout<<sum<<endl;
t[p]=c;
}
retur... | a.cc: In function 'int main()':
a.cc:28:17: error: expected ';' before '}' token
28 | return 0
| ^
| ;
29 | }
| ~
|
s904385662 | p03845 | C++ |
Copy
Copy
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ld, ld> pdd;
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
st... | a.cc:2:1: error: 'Copy' does not name a type
2 | Copy
| ^~~~
|
s798563482 | p03845 | C++ | A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Time limit
2000 ms
Memory limit
262144 kB
D - Contest with Drinks Easy
All Copyright Reserved © 2010-2019 Xu Han
Server Time: 2019-07-15 20:10:56 UTC+2
#20465742 | Nermeenatalla's solution for [Problem D]
Status
Compilation Error
Length
214
Lang
C++14 (... | a.cc:34:24: error: extended character © is not valid in an identifier
34 | All Copyright Reserved © 2010-2019 Xu Han
| ^
a.cc:37:11: error: "|" is not a valid filename
37 | #20465742 | Nermeenatalla's solution for [Problem D]
| ^
a.cc:37:26: warning: missing terminatin... |
s811652913 | p03845 | C++ | A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Time limit
2000 ms
Memory limit
262144 kB
D - Contest with Drinks Easy
All Copyright Reserved © 2010-2019 Xu Han
Server Time: 2019-07-15 22:20:31 UTC+2
#20466522 | Nermeenatalla's solution for [Problem D]
Status
Submit Failed
Length
236
Lang
C++14 (GCC... | a.cc:34:24: error: extended character © is not valid in an identifier
34 | All Copyright Reserved © 2010-2019 Xu Han
| ^
a.cc:37:11: error: "|" is not a valid filename
37 | #20466522 | Nermeenatalla's solution for [Problem D]
| ^
a.cc:37:26: warning: missing terminatin... |
s596115795 | p03845 | C++ | ticle
Logout
Nermeenatalla
Begin: 2019-07-12 16:30 UTC+2
level zero week 1 contest
End: 2019-07-19 16:30 UTC+2
77:48:33
Elapsed: 77:48:33 Running Remaining: 90:11:26
Overview
Problem
Status
Rank (77:48:24)
3 Comments
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Time limit
2000 ms
Memory limit
262144 kB
D - Cont... | a.cc:47:24: error: extended character © is not valid in an identifier
47 | All Copyright Reserved © 2010-2019 Xu Han
| ^
a.cc:50:11: error: "|" is not a valid filename
50 | #20466522 | Nermeenatalla's solution for [Problem D]
| ^
a.cc:50:26: warning: missing terminatin... |
s973221703 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-(T[p[j]]+x[j])>>endl;
}} | a.cc: In function 'int main()':
a.cc:18:23: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
18 | cout<<t-(T[p[j]]+x[j])>>endl;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
... |
s179211451 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
} | a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s562301336 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin<<M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
} | a.cc: In function 'int main()':
a.cc:13:4: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
13 | cin<<M;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:13:4: note: candidate: 'operator<<(int, int)' ... |
s504185427 | p03845 | C++ |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
} | a.cc: In function 'int main()':
a.cc:14:4: error: expected ';' before 'M'
14 | cin M;
| ^~
| ;
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s845852250 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,I=0,j=0,t=0,M;
cin>>N;
int T[N];
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin M;
int p[M],x[M];
for(j=1;j<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
}
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'i' was not declared in this scope
8 | for(i=1;i<=N;i++)
| ^
a.cc:13:4: error: expected ';' before 'M'
13 | cin M;
| ^~
| ;
|
s434400500 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N,i=0,j=0,T[N],t=0,M,p[M],x[M];
cin>>N;
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
for(j=1;i<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s482659840 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int i=0,j=0,T[N],t=0,M,p[M],x[M];
cin>>N;
for(i=1;i<=N;i++)
{
cin>>T[i];
t+=T[i];
}
cin>>M;
for(j=1;i<=M;j++)
{
cin>>p[j]>>x[j];
cout<<t-T[p[j]]+x[j];
} | a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
5 | int i=0,j=0,T[N],t=0,M,p[M],x[M];
| ^
a.cc:9:6: error: 'T' was not declared in this scope
9 | cin>>T[i];
| ^
a.cc:16:9: error: 'T' was not declared in this scope
16 | cout<<t-T[p[j]]+x[j];
... |
s272121672 | p03845 | C++ | using namespace std;
int main()
{
int a,b,x,count=0;
cin>>a>>b>>x;
if(a>=0&&b>=0&&x>0)
{
for(int i=a; I<=b; i++)
{
if(i%x==0){
count ++;
}
}}
count <<count;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:14: error: 'I' wa... |
s437012988 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[100000];
int n;
scanf("%d",&n);
int i = 1;
while(n --)
{
cin >> arr[i];
i ++;
}
int m;
cin >> m;
while(m --)
{
int p, x;
cin >> p >> x;
int c;
c = arr[p];
ar... | a.cc: In function 'int main()':
a.cc:30:6: error: expected '}' at end of input
30 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s447932837 | p03845 | C | #include<stdio.h>
#include<iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;
int main(){
int n,i;
cin>>n;
int a[n];
for(i=0;i<n;i++){
cin>>a[i];
}
int m;
cin>>m;
int x[m],y[m],d,z=0,p=0;
for(i=0;i<m;i++){
cin>>x[i]>>y[i];
}
for(i=0;i<m;... | main.c:2:9: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s648404335 | p03845 | C++ | #include<iostream>
using namespace::std;
int main(){
int n;
cin>>n;
int ar[n],sum=0;
for(int i=0;i<n;i++)
cin>>ar[i],sum+=ar[i];
int m;
cin>>m;
for(int j=0,l,r;j<m;j++){
cin>>l<<r;
cout<<sum+r-ar[l-1]<<'\n';
}
} | a.cc: In function 'int main()':
a.cc:14:13: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
14 | cin>>l<<r;
| ~~~~~~^~~
| | |
| | int
| std::basic_istream<ch... |
s233556632 | p03845 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int N;
cin > N;
int T[N];
for(int i = 0; i < N; i++) {
cin >> T[i];
}
int M;
cin >> M;
int P[M];
int X[M];
for(int i = 0; i < M; i++) {
cin >> P[i] >> X[i];
}
i... | a.cc: In function 'int main()':
a.cc:8:9: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin > N;
| ~~~ ^ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:9: note: candidate: 'o... |
s611367716 | p03845 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int N = keyboard.nextInt();
int[] T = new int[N]
int sum = 0;
for(int i = 0; i < N; i++){
T[i] = keyboard.nextInt();
... | Main.java:10: error: ';' expected
int[] T = new int[N]
^
Main.java:15: error: ';' expected
sum += T[i]
^
Main.java:20: error: ';' expected
int[] P = new int[M]
^
Main.java:21: error: ';' expected
int[] X = new int[M]
... |
s054207907 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n;
cin>>n;
int t[n];
int i, j;
int ans = 0;
REP(i, n){
c... | a.cc: In function 'int main()':
a.cc:31:15: error: 'gokei' was not declared in this scope
31 | cout<<gokei-t[p[i]+1]+x[i]<<endl;
| ^~~~~
|
s140823684 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n;
cin>>n;
int t[n];
int i, j;
int ans = 0;
REP(i, n){
c... | a.cc: In function 'int main()':
a.cc:8:13: error: overloaded function with no contextual type information
8 | #define INF 2e9
| ^~~
a.cc:30:14: note: in expansion of macro 'INF'
30 | max = -1*INF;
| ^~~
a.cc:33:15: error: 'gokei' was not declared in this scope
33 | ... |
s417754502 | p03845 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int N;
cin >> N;
vector<int>time(N,0);
for(int i=0;i<N;i++){
cin >> time[i];
}
int M;
cin >> M;
vector<vector<int>>drink(M,vector<int>(2,0));
for(int i=0;i<M;i++){
for(int j=0;j<2;j++){
cin >> drink[i][j]... | a.cc:38:5: error: redefinition of 'int main()'
38 | int main(void){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(void){
| ^~~~
a.cc:72:5: error: redefinition of 'int main()'
72 | int main(void){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined he... |
s275007588 | p03845 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int N;
cin >> N;
vector<int>time(N,0);
for(int i=0;i<N;i++){
cin >> time[i];
}
int M;
cin >> M;
vector<vector<int>>drink(M,vector<int>(2,0));
for(int i=0;i<M;i++){
for(int j=0;j<2;j++){
cin >> drink[i][j]... | a.cc:38:5: error: redefinition of 'int main()'
38 | int main(void){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(void){
| ^~~~
|
s021316166 | p03845 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main(){
int N;
cin >> N;
int T[N];
for(int i = 0; i < N; i++){
cint >> T[i];
}
int sum = 0;
for(int i = 0; i < N; i++){
sum += T[i];
}
int M = 0;
cin >> M;
for(int i = 0; i < M; i++){
int P, X;
cin... | a.cc: In function 'int main()':
a.cc:13:17: error: 'cint' was not declared in this scope; did you mean 'uint'?
13 | cint >> T[i];
| ^~~~
| uint
|
s259138138 | p03845 | C++ | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int timeArray = new int[n];
int sum = 0;
for (int i=0;i<n;i++){
timeArray[i] = sc.nextInt();
sum += timeArray[i... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s687928257 | p03845 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
int main(){
ll n,m,sumt=0;
cin >> n;
vll t(n);
for (ll i=0;i<n;i++) {
cin>>t[i];
sumt += t[i];
}
cin>>m;
for (ll i=0;i<m;i++) {
cin>>p[i]>>x[i];
cout<<sumt-t[p[i]-1]+x[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:15:10: error: 'p' was not declared in this scope
15 | cin>>p[i]>>x[i];
| ^
a.cc:15:16: error: 'x' was not declared in this scope
15 | cin>>p[i]>>x[i];
| ^
|
s212423912 | p03845 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else... | a.cc: In function 'int main()':
a.cc:106:20: error: expected ';' before '}' token
106 | ans += t[j]
| ^
| ;
107 | }
| ~
|
s278591366 | p03845 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int N,M,sum=0;
cin>>N;
int T[N];
for(int i=0;i<N;i++){
cin>>T[i];
sum+=T[i];
}
cin>>M;
int P[N],X[M],sum[M];
for(int i=0;i<M;i++){
cin>>P[i]>>X[i];
cout<<sum+X[i]-T[P[i]-1]<<endl;
}
retu... | a.cc: In function 'int main()':
a.cc:13:19: error: conflicting declaration 'int sum [M]'
13 | int P[N],X[M],sum[M];
| ^~~
a.cc:5:13: note: previous declaration as 'int sum'
5 | int N,M,sum=0;
| ^~~
|
s074225189 | p03845 | C++ | #include<iostream>
using namespace std;
int time[101];
struct drink
{
int x,y;
}a[101];
int main()
{
int N,M,cnt=0;
cin>>N;
for(int i=1;i<=N;i++)
{
cin>>time[i];
cnt+=time[i];
}
cin>>M;
for(int i=1;i<=M;i++)
cin>>a[i].x>>a[i].y;
for(int i=1;i<=M;i++)
c... | a.cc:3:13: error: 'int time [101]' redeclared as different kind of entity
3 | int time[101];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.... |
s343532896 | p03845 | C | #include <stdio.h>
int main (){
int n;
int t[101];
int m;
int p[101];
int x[101];
int sum = 0;
int i;
scanf("%d" ,&n);
for( i = 0; i < n; i++) {
scanf("%d" &t[i]);
sum = sum + t[i];
}
scanf("%d" ,&m);
for( i = 0; i < m; i++) {
scanf... | main.c: In function 'main':
main.c:17:20: error: invalid operands to binary & (have 'char *' and 'int')
17 | scanf("%d" &t[i]);
| ~~~~ ^~~~~
| | |
| char * int
|
s577073102 | p03845 | C++ | #include <bits10_1.h/stdc++.h>
using namespace std;
int main(){
int n, m, i, p, x, sum = 0;
cin >> n;
int t[n];
for(i=0; i<n; i++){
cin >> t[i];
sum += t[i];
}
cin >> m;
for(i=0; i<m; i++){
cin >> p >> x;
cout << sum + x - t[p-1] << '\n';
}
return 0;
... | a.cc:1:10: fatal error: bits10_1.h/stdc++.h: No such file or directory
1 | #include <bits10_1.h/stdc++.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.