submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s826022851
p03844
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in()) int a = sc.nextInt(); String op = sc.next(); int b = sc.nextInt(); if (op.equals("+")) { System.out.println(a + b); }else if (op.equals("-")) { ...
Main.java:4: error: ';' expected Scanner sc = new Scanner(System.in()) ^ 1 error
s947190424
p03844
Java
public class Test002 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); String[] N = line.split(" "); int a=Integer.parseInt(N[0]); int b=Integer.parseInt(N[2]); for(int i=0; i<3; i++){ char T = N[i].charAt(0) ; if(N[1].eq...
Main.java:3: error: class Test002 is public, should be declared in a file named Test002.java public class Test002 { ^ Main.java:7: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Test002 Main.java:7: error: cannot find symbol Scanner sc = new Scanner(S...
s355979164
p03844
C++
#include<iostream> using namespace std; int main(){ int x,y;char c; cin>>x>>c>>y; if(c=="+"){cout<<x+y<<endl;}else{cout<<x-y<<endl;} return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(c=="+"){cout<<x+y<<endl;}else{cout<<x-y<<endl;} | ~^~~~~
s144738541
p03844
C++
#include<bits/stdc++.h> using namespace std; int main() { char a[1000]; int p=0,b=0,sum=0,f=0,i; gets(a); int len=strlen(a); for(i=0;i<len;i++) { if(a[i]!=' '&&a[i]!='+'&&a[i]!='-') { sum=sum+a[i]-48; sum=sum*10; // cout<<sum<<endl; } ...
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s516507335
p03844
C++
#include<bits/stdc++.h> using namespace std; int main() { char d[100]; char *a,b[10]; int p,q; gets(d); a=strtok(d," "); p=atoi(a); for(int i=0;a!=NULL;i++) { if(i==1)strcpy(b,a); if(i==2)q=atoi(a); a=strtok(NULL," "); } if(strcmp(b,"+")==0)cout<<p+q<<en...
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(d); | ^~~~ | getw
s773213514
p03844
C++
#include<iostream> using namespace std; int main(){ int a,b; char op( cin>>a>>op>>b; if(op=='+'){ cout<<(a+b)<<endl; }else{ cout<<(a-b)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: expected ')' before ';' token 6 | cin>>a>>op>>b; | ^ | ) a.cc:5:9: note: to match this '(' 5 | char op( | ^
s863694123
p03844
C++
#include <iostream> #include <string> using namespace std; int main(){ int a,b; string op; cin>>a>>op>>b; if(op=='+'){ cout<<a+b<<endl; }else{ cout<<a-b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 13 | if(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11...
s054545775
p03844
C++
s = input().split() a, b = int(s[0]), int(s[2]); if s[1]== '+': a+=b; print (a) else: a-=b; print (a)
a.cc:1:1: error: 's' does not name a type 1 | s = input().split() | ^ a.cc:3:1: error: expected unqualified-id before 'if' 3 | if s[1]== '+': | ^~ a.cc:5:11: error: expected constructor, destructor, or type conversion before '(' token 5 | print (a) | ^ a.cc:8:11: error: expec...
s243139277
p03844
Java
public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int A = scan.nextInt(); String op = scan.next(); int B = scan.nextInt(); int res; if(op.equals("+")){ res = A+B; }else{ res = A-B; } System.out.println(res); } }
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s383127669
p03844
C++
static void Main(string[] args) { try { uint a = uint.Parse(args[0]); var op = args[1]; int b = int.Parse(args[2]); if (op == "+") System.Console.Out.WriteLine(a + b); else if (op == "-") System.Console.Out....
a.cc:1:13: error: variable or field 'Main' declared void 1 | static void Main(string[] args) | ^~~~ a.cc:1:18: error: 'string' was not declared in this scope 1 | static void Main(string[] args) | ^~~~~~ a.cc:1:25: error: expected primary-expression before ']' token 1...
s845889515
p03844
C++
#include <stdio> int main() { long a,b; char op; scanf("%d %c %d", &a, &op, &b); if(op == '+') printf("%d", a+b); if(op == '-') printf("%d", a-b); }
a.cc:1:10: fatal error: stdio: No such file or directory 1 | #include <stdio> | ^~~~~~~ compilation terminated.
s195957009
p03844
C++
#include <bits/stat.h> using namespace std; int main() { int a,b; char c; cin >> a >> c >> b; if(c == '+') cout << a + b << endl; else cout << a - b << endl; return 0; }
In file included from a.cc:1: /usr/include/x86_64-linux-gnu/bits/stat.h:19:3: error: #error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/stat.h:...
s205319601
p03844
C++
#include<iostream> #include<string> int main() { std::string input; int a,b; std::cin >> input; a = std::stoi(input[0]); b = std::stoi(input[4]); if(input[2] == "-") { std::cout << a - b << std::endl; } else{ std::cout << a + b << std::endl; } }
a.cc: In function 'int main()': a.cc:8:18: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 8 | a = std::stoi(input[0]); | ~~~~~~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c...
s638175352
p03844
C++
#include<iostream> #include<string> int main() { std::string input; int a b; std::cin >> input; a = std::stoi(input[0]); b = std::stoi(input[4]); if(input[2] == "-") { std::cout << a - b << std::endl; } else{ std::cout << a + b << std::endl; } }
a.cc: In function 'int main()': a.cc:6:11: error: expected initializer before 'b' 6 | int a b; | ^ a.cc:8:5: error: 'a' was not declared in this scope 8 | a = std::stoi(input[0]); | ^ a.cc:8:18: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::alloca...
s699024161
p03844
C++
#include <iostream> #include <vector> using namespace std; int Gets(char *buff,int buffMaxSize) { buff[0]='\0'; if (fgets(buff,buffMaxSize,stdin)==NULL){ return -1; } size_t strLen = strlen(buff); if (strLen>0){ while (buff[strLen-1] == '\r' || buff[strLen-1]=='\n'){//改行コード strLen--; buff[strLen]='\0'; ...
a.cc: In function 'int Gets(char*, int)': a.cc:10:25: error: 'strlen' was not declared in this scope 10 | size_t strLen = strlen(buff); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <v...
s499292688
p03844
Java
import java.util.Scanner; public class A050 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String op = sc.next(); String b = sc.next(); sc.close(); if (op.equals("+")) { System.out.println(Integer.valueOf(a) + Integer.valueOf(b));; } else { ...
Main.java:3: error: class A050 is public, should be declared in a file named A050.java public class A050 { ^ 1 error
s305918423
p03844
Java
package atcoder.beg50; import java.util.Scanner; public class A050 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String op = sc.next(); String b = sc.next(); sc.close(); if (op.equals("+")) { System.out.println(Integer.valueOf(a) + Integer.value...
Main.java:5: error: class A050 is public, should be declared in a file named A050.java public class A050 { ^ 1 error
s231134442
p03844
C++
#incluide<cstdio> void main() { int A, B; char op; scanf("%d%c%d", &A, &op, &B); printf("%d\n", op == '+' ? A + B : A - B); }
a.cc:1:2: error: invalid preprocessing directive #incluide; did you mean #include? 1 | #incluide<cstdio> | ^~~~~~~~ | include a.cc:3:1: error: '::main' must return 'int' 3 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:7:3: error: 'scanf' was not declared in this scope 7 | s...
s373362139
p03844
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); byte op = sc.nextByte(); int B = sc.nextInt(); int answer; if (op == '+') answer = A + B; else if (op == '-') answer = A - B; ...
Main.java:15: error: variable answer might not have been initialized System.out.println("" + answer); ^ 1 error
s752202771
p03844
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); byte op = sc.nextByte(); int B = sc.nextInt(); int answer; if (op == '+') answer = A + B; else if (op == '-') answer = A - B; ...
Main.java:15: error: variable answer might not have been initialized System.out.print("" + answer); ^ 1 error
s137836299
p03844
Java
import java.util.Scanner; pubilc class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); byte op = sc.nextByte(); int B = sc.nextInt(); int answer; if (op == '+') answer = A + B; else if (op == '-') answer = A - B; ...
Main.java:3: error: class, interface, enum, or record expected pubilc class Main ^ 1 error
s850267320
p03844
C
#include<stdio.h> int main() { int a,b; char op; scanf("%d %c %d",&a,&op,&b); if(op == '-'){ print("%d\n",a-b); } else { print("%d\n",a+b); } return 0; }
main.c: In function 'main': main.c:9:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 9 | print("%d\n",a-b); | ^~~~~ | printf
s029612523
p03844
C++
#include <iostrem> using namespace std; int main(){ int a,b; char c; cin>>a>>c>>b; if(c=='+') cout<<a+b<<endl; else cout<<a-b<<endl; }
a.cc:1:10: fatal error: iostrem: No such file or directory 1 | #include <iostrem> | ^~~~~~~~~ compilation terminated.
s443398838
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c; cin>>a>>c>>b; if(n=='+') cout<<a+b<<endl; else cout<<a-b<<endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'n' was not declared in this scope 9 | if(n=='+') cout<<a+b<<endl; | ^
s995975524
p03844
C++
#include <iostrem> using namespace std; int main(){ int a,b; char c; cin>>a>>c>>b; if(n=='+') cout<<a+b<<endl; else cout<<a-b<<endl; }
a.cc:1:10: fatal error: iostrem: No such file or directory 1 | #include <iostrem> | ^~~~~~~~~ compilation terminated.
s164160473
p03844
C
#include<stdio.h> int main(){ int a,b,c,d; a=b=c=d=0; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(c==+){ d=a+b; } if(c==-){ d=a-b; } printf("%d",d); return 0; }
main.c: In function 'main': main.c:8:8: error: expected expression before ')' token 8 | if(c==+){ | ^ main.c:11:8: error: expected expression before ')' token 11 | if(c==-){ | ^
s170521514
p03844
C
#include<stdio.h> int main(){ int a,b,c,d; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(c==+){ d=a+b; } if(c==-){ d=a-b; } printf("%d",d); return 0; }
main.c: In function 'main': main.c:7:8: error: expected expression before ')' token 7 | if(c==+){ | ^ main.c:10:8: error: expected expression before ')' token 10 | if(c==-){ | ^
s026676874
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { char str[100]; gets(str); long a, b; char op; sscanf(str, "%ld %c %ld", &a, &op, &b); long ans = 0; if (op=='-') ans = a-b; else ans = a+b; cerr << a << ' ' << op << ' ' << b; printf("%ld", ans); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(str); | ^~~~ | getw
s774028130
p03844
C
#include<stdio.h> int main(){ int a,b,c,d; a=b=c=d=0; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(c==+){ d=a+b; } if(c==-){ d=a-b; } printf("%d",d); return 0; }
main.c: In function 'main': main.c:8:8: error: expected expression before ')' token 8 | if(c==+){ | ^ main.c:11:8: error: expected expression before ')' token 11 | if(c==-){ | ^
s952312798
p03844
C++
#include < bits/stdc++.h> using namespace std; int main(){ int a, b;char c; cin>> a>> c>> b; cout<< a-b << endl; }
a.cc:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include < bits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s809708324
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { char str[100]; gets(str); int a, b; char op; sscanf(str, "%d %c %d", &a, &op, &b); int ans = 0; if (op=='-') ans = a-b; else ans = a+b; cout << ans << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(str); | ^~~~ | getw
s892230618
p03844
C++
#include <IOstream> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b;
a.cc:1:10: fatal error: IOstream: No such file or directory 1 | #include <IOstream> | ^~~~~~~~~~ compilation terminated.
s676025927
p03844
C++
#include <IOstream> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b;
a.cc:1:10: fatal error: IOstream: No such file or directory 1 | #include <IOstream> | ^~~~~~~~~~ compilation terminated.
s964499282
p03844
C++
#include <IOstream> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b;
a.cc:1:10: fatal error: IOstream: No such file or directory 1 | #include <IOstream> | ^~~~~~~~~~ compilation terminated.
s300328004
p03844
Java
import java.util.Scanner; public class main { public static void main(String[] args){ try { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); String b = scan.next(); int c = scan.nextInt(); if (b.equals("+")) { a = a...
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s295281139
p03844
C
#include <stdio.h> int main(){ int A,B; char c; scanf("%d %c %d",&A,&c,&B); if( c == '+'){ printf("%d\n",A+B); }else if (c == '-'){ printf("%d\n",A-B); } return EXIT_SUCCESS; }
main.c: In function 'main': main.c:12:11: error: 'EXIT_SUCCESS' undeclared (first use in this function) 12 | return EXIT_SUCCESS; | ^~~~~~~~~~~~ main.c:2:1: note: 'EXIT_SUCCESS' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>' 1 | #include <stdio.h> ...
s428064695
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() [ int a,b; char c; cin >> a >> c >> b; if(c == '+')cout << a + b << endl; else cout << a - b << endl; return 0; }
a.cc:5:1: error: expected primary-expression before 'int' 5 | int a,b; | ^~~ a.cc:4:2: error: expected ']' before 'int' 4 | [ | ^ | ] 5 | int a,b; | ~~~ a.cc:7:1: error: 'cin' does not name a type 7 | cin >> a >> c >> b; | ^~~ a.cc:8:1: error: expected unqualified-id befo...
s634091553
p03844
C++
#include <set> #include <cstring> #include <algorithm> #include <iostream> #include <cstdio> #include <cmath> #include <queue> #include <stack> #include <vector> #define mp make_pair #define pb push_back #define X first #define Y second using namespace std; typedef long long LL; const int maxn = 100005; char res[m...
a.cc: In function 'void init()': a.cc:24:24: error: 'c' was not declared in this scope 24 | scanf("%d%c%d",&a,&c,&b); | ^
s701179513
p03844
C++
/* Sourav Verma IPG_2013 ABV_IIITMG Task @ Codeforces & Atcoder */ #include<bits/stdc++.h> #define ll long long int #define loop(i,a,b) for(int i=(int)a;i<(int)b;++i) #define rloop(i,a,b) for(int i=(int)a;i<=(int)b;++i) #define loopr(i,a,b) for(int i=(int...
a.cc: In function 'void solve(std::istream&, std::ostream&)': a.cc:37:25: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 37 | if(op=='+') out<<a+b<"\n"; | ~~~~~~~~^~~~~ | | | | | c...
s368097604
p03844
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; static const int R = 10000; int main(){ int n[R],t,m; int sum = 0; int k = 0; cin >> t; for( int i = 0, i < n, i++) cin >> n[i]; cin >> m; for( int i = 0, i < m, i++) { cin >> number >> sec; n[number - 1] = sec; for( int i = 0,...
a.cc: In function 'int main()': a.cc:12:26: error: expected ';' before '<' token 12 | for( int i = 0, i < n, i++) cin >> n[i]; | ^~ | ; a.cc:12:27: error: expected primary-expression before '<' token 12 | for( int i = 0, i < n, i++) cin...
s277754843
p03844
C++
#include <iostream> #include <vector> #include <cmath> #define rep(a, b) for(int a = 0; a < b; a++) #define repr(a, b) for(int a = b; a >= 0; a++) using namespace std; int main() { int N; cin >> N; int A[N]; rep(i, N) cin >> A[i]; int count[(N + 1) / 2]; rep(i, (N + 1) / 2) count[i] = 0; ...
a.cc: In function 'int main()': a.cc:42:31: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 42 | cout << pow(2, N / 2) % 1000000007 << endl; | ~~~~~~~~~~~~~ ^ ~~~~~~~~~~ | | | ...
s820345702
p03844
C++
#include <iostream> using namespace std; typedef unsigned long long uint; int main() { // your code goes here long long a,b; char op; cin>>a>>op>>b; if (op=='+') cout<<a+b<<endl; else cout<<a-b<<endl; return 0; }
a.cc:4:28: error: conflicting declaration 'typedef long long unsigned int uint' 4 | typedef unsigned long long uint; | ^~~~ In file included from /usr/include/stdlib.h:514, from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_con...
s271953149
p03844
C++
using System; namespace ConsoleApplication { public class A { int a, b; string op; public A() { string[] s = Console.ReadLine().Split(' '); this.a = int.Parse(s[0]); this.b = int.Parse(s[2]); this.op = s[1]; } pu...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:6:5: error: expected unqualified-id before 'public' 6 | public class A | ^~~~~~ a.cc:28:5: error: expected unqualified-id before 'public' 28 | public class Program | ^~~~~~
s534821379
p03844
C++
#include <iostream> int main(){ int a,b,c; std::string s; std::cin >> a; std::cin >> s; std::cin >> b; if(s == '+'){ c = a+b; }else if(s == '-'){ c = a-b; } std::cout << c << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:11:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | if(s == '+'){ | ~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In fi...
s093550448
p03844
C++
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> using namespace std; int main(void){ long long int a,b; char c; scanf("%lld %c %lld",&a,&c.&b); if(c=='+') printf("%lld\n",a+b); else printf("%lld\n",a-b); return 0; }
a.cc: In function 'int main()': a.cc:10:30: error: expected unqualified-id before '&' token 10 | scanf("%lld %c %lld",&a,&c.&b); | ^
s584246630
p03844
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace abc060 { class Program { static void Main(string[] args) { //a string[] s = Console.ReadLine().Split(' '); int a, b; stri...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s873727786
p03844
C++
#include <iostream> using namespace std; int main(void) { string s, t, op; int ans = 0; cin >> s >> op >> t; if (op == '+') { ans = stoi(s) + stoi(t); } else { ans = stoi(s) - stoi(t); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if (op == '+') { | ~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic...
s347011746
p03844
C++
#include <iostream> using namespace std; int main() { int a, b; char c; cin >> a >> c >> b; cout << (c == '+') ? a + b : a - b << endl; }
a.cc: In function 'int main()': a.cc:9:38: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 9 | cout << (c == '+') ? a + b : a - b << endl; | ~~~~~~^~~~~~~
s090275660
p03844
C++
#include <iostream> int main() { int a, b; char c; cin >> a >> c >> b; cout << (c == '+') ? a + b : a - b << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> a >> c >> b; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Lin...
s373511909
p03845
C++
3 2 1 4 2 1 1 2 3
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 | ^
s859576746
p03845
C++
#include <bits/stdc++.h> //#include <atcoder/all> #define ll long long int #define MOD 1000000007 #define P pair<ll,ll> #define INF 1000000000000000000 //using namespace atcoder; using namespace std; int main(void){ ll n; cin >> n; ll sum = 0; vector<ll> t(n); for (int i = 0; i < n; i++){ cin >> t[i]...
a.cc: In function 'int main()': a.cc:25:12: error: 'p' was not declared in this scope 25 | cin >> p >> x; | ^ a.cc:25:17: error: 'x' was not declared in this scope 25 | cin >> p >> x; | ^
s653206933
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:17: error: no match for 'operator==' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 30 | if (count == P.at(i)) { | ~~~~~ ^~ ~~~~~~~ | | ...
s573607542
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:36:13: error: 'total' was not declared in this scope 36 | cout << total << endl; | ^~~~~ a.cc: At global scope: a.cc:38:1: error: expected declaration before '}' token 38 | } | ^
s139162557
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:23: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 30 | if (T.at...
s509675244
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:23: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 30 | if (T.at...
s204366160
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:19: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 30 | if (P.at...
s415846978
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:12: error: no match for call to '(std::vector<std::vector<int> >) (int&)' 30 | if (P(i) == T(count)) { | ~^~~ a.cc:30:20: error: no match for call to '(std::vector<int>) (int&)' 30 | if (P(i) == T(count)) { | ~^~~~~~~ a.cc...
s959361681
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:12: error: no match for call to '(std::vector<int>) (int&)' 30 | if (T(count) == P(i)) { | ~^~~~~~~ a.cc:30:24: error: no match for call to '(std::vector<std::vector<int> >) (int&)' 30 | if (T(count) == P(i)) { | ~^~~ ...
s548883420
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> T.at(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:30:21: error: no match for call to '(std::vector<std::vector<int> >) (int&)' 30 | if (count == P(i)) { | ~^~~ a.cc:31:19: error: no match for call to '(std::vector<int>) (int&)' 31 | total += T(count); | ~^~~~~~~ a....
s007606171
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N ; vector<int> T(N); for (int i = 0; i < N; i++) { cin >> vec.T(i); } int M; cin >> M; // int型の2次元配列(M×2要素の)の宣言 vector<vector<int>> P(M, vector<int>(2)); // 入力 (2重ループを用いる) for (int i = 0; i < M; i++) ...
a.cc: In function 'int main()': a.cc:11:13: error: 'vec' was not declared in this scope 11 | cin >> vec.T(i); | ^~~ a.cc:30:21: error: no match for call to '(std::vector<std::vector<int> >) (int&)' 30 | if (count == P(i)) { | ~^~~ a.cc:31:19: error: no match f...
s733163186
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> Q(N); int T=0; for(int i=0; i<N; i++){ cin>>Q.at(i); T+=Q.at(i); } int M; cin>>M; vector<vector<int>> D(M,vector<int>(2)); for(int i=0 ;i<M; i++){ for(int j=0; j<2; j++){ cin>>D.at(i).at(j); } } ...
a.cc: In function 'int main()': a.cc:19:29: error: expected ';' before ')' token 19 | T-=Q.at(D.at(i).at(0)-1)); | ^ | ; a.cc:21:30: error: expected ';' before ')' token 21 | T+=Q.at(D.at(i).at(0)-1)); | ...
s896928640
p03845
Java
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> T(N); for (int i = 0; i < N; i++) {cin >> T.at(i);} for (int i = 0; i < M; i++) { vector<int> t(N); for (int j = 0; j < N; j++) {t.at(j) = T.at(j);} int P, X, Y = 0; cin >> P >> X; t.at(P - 1) =...
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: not a statement cin >> N >> M; ^ Main.java:6: error: not a statement vector<int> T(N); ^ Main.java:7...
s172450844
p03845
C++
#include <bits/stdc++.h> #define rep(i , n) for (int i = 0; i < (int)(n); i++) const int INF = 1<<29; using namespace std; using ll = long long; ll l , a[500001]; int main(){ int n , m , a[111] , b , c , sum = 0; cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]; sum += a[i]; } cin >> m; while(m--...
a.cc: In function 'int main()': a.cc:12:18: error: 'i' was not declared in this scope 12 | sum += a[i]; | ^ a.cc: At global scope: a.cc:14:9: error: 'cin' does not name a type 14 | cin >> m; | ^~~ a.cc:15:9: error: expected unqualified-id before 'while' 15 |...
s808977734
p03845
C++
#include <iostream> using namespace std; int main() { int n,m,r; cin>>n; int t[n],p[m],x[m]; for(int i=0;i<n;i++){ cin>>t[i]; } for(int j=0;j<p.length();j++){ cin>>p[j]>>x[j]; } for(int a=0;a<m;a++){ for(int b=0;b<t.length();b++){ if(b==a){ continue; } r+=t[a]; } cout<<r+t[a]<<endl; ...
a.cc: In function 'int main()': a.cc:12:25: error: request for member 'length' in 'p', which is of non-class type 'int [m]' 12 | for(int j=0;j<p.length();j++){ | ^~~~~~ a.cc:16:33: error: request for member 'length' in 't', which is of non-class type 'int [n]' 16 | ...
s844502385
p03845
C++
#include <iostream> using namespace std; int main() { int n,m,r; cin>>n; int t[n],p[m],x[m]; for(int i=0;i<n;i++){ cin>>t[i]; } for(int j=0;j<m;j++){ cin>>p[j]>>x[j]; } for(int a=0;a<j;a++){ for(int b=0;b<i;b++){ if(b==a){ continue; } r+=t[a]; } cout<<r+t[a]<<endl; } }
a.cc: In function 'int main()': a.cc:15:23: error: 'j' was not declared in this scope 15 | for(int a=0;a<j;a++){ | ^ a.cc:16:31: error: 'i' was not declared in this scope 16 | for(int b=0;b<i;b++){ | ^
s790339205
p03845
C++
#include <iostream> using namespace std; int main (){ int total = 0; int N, M; int arrT, arrP, arrX; cin >> N >> M; for (int i = 0; i < N; i ++){ cin >> arrT[i]; } for (int i = 0; i < M; i ++){ cin >> arrP[i] >> arrX[i]; for (int j = 0; j < N; j ++){ if (j == arrP[i]){ total +=...
a.cc: In function 'int main()': a.cc:10:16: error: invalid types 'int[int]' for array subscript 10 | cin >> arrT[i]; | ^ a.cc:13:16: error: invalid types 'int[int]' for array subscript 13 | cin >> arrP[i] >> arrX[i]; | ^ a.cc:13:27: error: invalid types 'int[int]'...
s673925532
p03845
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int[] t = new int[n]; for(int i=0; i<n; i++){ a[i] = scn.nextInt(); } int sum = 0; for(int i=0; i<n; i++){ sum += a[i]; ...
Main.java:9: error: cannot find symbol a[i] = scn.nextInt(); ^ symbol: variable a location: class Main Main.java:13: error: cannot find symbol sum += a[i]; ^ symbol: variable a location: class Main Main.java:24: error: cannot find symbol dif = a[p[i]]-x[i]; ...
s238518604
p03845
C
#include <iostream> #include <array> using namespace std; int main(){ int N, M, k, val, sum = 0, ans; array<int, 100> p; cin >> N; for(int i = 0; i < N; i++){ cin >> p[i]; sum += p[i]; } cin >> M; for(int i = 0; i < M; i++){ cin >> k >> val; cout << sum + ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s718017414
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int n ; cin >> n; vector < pair <int , int> > a(n); int sum = 0 ; for ( int i=0 ; i<n ; i++){ int t ; cin >> t; a.at(i) = make_pair ( i, t); sum += t; } int m ; cin >> m; for ( int i=0 ; i<m ; i++) { int p,b,c,t , ans; ...
a.cc: In function 'int main()': a.cc:21:22: error: expected ';' before 'cout' 21 | ans = sum - t + b | ^ | ; 22 | cout << ans << endl; | ~~~~
s846713537
p03845
C++
#include "bits/stdc++.h" using namespace std; int main() { int N; vector<int>T(N); int sum = 0; for (int i = 0; i < N; ++i) { cin >> T[i]; sum + = T[i]; } int M; cin >> M; for (int i = 0; i < M; ++i) { int p, x; cin >> p >> x; cout << sum - T[p - 1] + x << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:23: error: expected primary-expression before '=' token 10 | sum + = T[i]; | ^
s604902292
p03845
C++
v#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> t(n); for (int i = 0; i < n; i++) cin >> t.at(i); int m; cin >> m; int p, x, ans, temp; for (int i = 0; i < m; i++) { cin >> p >> x; temp = t.at(p-1); t.at(p-1) = x; ans =...
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:8:3: error: 'vector' was n...
s746565840
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N ; cin >> N ; vector <int> a(N); int sum = 0 ; for ( int i=0 ; i<N ; i++){ cin >> a.at(i) ; sum += a.at(i) ; } int M ; cin >> M ; vector <int> d(N,sum) for ( int i=0 ; i<M ; i++){ int b,c; cin >> b >> c ; d.at(i) = ...
a.cc: In function 'int main()': a.cc:16:3: error: expected ',' or ';' before 'for' 16 | for ( int i=0 ; i<M ; i++){ | ^~~ a.cc:16:19: error: 'i' was not declared in this scope 16 | for ( int i=0 ; i<M ; i++){ | ^
s381705110
p03845
C++
#include <bits/stdc++.h> #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++) #define pi 3.14159265359 #define all(i) i.begin(),i.end() using namespace std; const long long INF=1e9+7; const string alp="abcdefghijklmnopqrstuvwxyz"; //26 const string ALP="ABCDEFG...
a.cc: In function 'int main()': a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | ans+=T[i]; | ^~~ | abs
s706078409
p03845
C++
#include<isotream> using namespace std; int main(){ int n; int arr[n]; for(int i = 0; i < n; ++i){ cin >> arr[i]; } int m; while(m--){ int x, y; cin >> x >> y; int ans = 0; for(int i = 0; i < n; ++i){ if((i + 1) == x) ans += y; else ans += arr[i]; } cout << ans << end...
a.cc:1:9: fatal error: isotream: No such file or directory 1 | #include<isotream> | ^~~~~~~~~~ compilation terminated.
s138183591
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n; cout<<endl; vector<int>t(n); for(int i=0;i<n;i++){ cin>>t.at(i); } cin>>m; vector<int>p(m); for(int i=0;i<m;i++){ cout<<i; cin>>p.at(i); cout>>endl; } for(int i=0;i...
a.cc: In function 'int main()': a.cc:17:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 17 | cout>>endl; | ~~~~^~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,...
s225829596
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n; cout<<endl; vector<int>t(n); for(int i=0;i<n;i++){ cin>>t.at(i); } cin>>m; vector<int>p(m); for(int i=0;i<m;i++){ cout>>i; cin<<p.at(i); cout>>endl; } for(int i=0;i...
a.cc: In function 'int main()': a.cc:15:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 15 | cout>>i; | ~~~~^~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:1...
s747862483
p03845
Java
public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int[] T = new int[N]; int M = scan.nextInt(); int[] P = new int[M]; int[] X = new int[M]; for(int i = 0; i < N; i++) { T[i] = scan.nextInt(); } for(int i = 0; i < M;...
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s730944122
p03845
C++
s
a.cc:1:1: error: 's' does not name a type 1 | s | ^
s570331149
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> T(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> T[i]; sum += T[i]; } for (int i = 0; i < M; i++) { int P, X; cin >> P >> X; P--; cout << sum - T[P] + X << endl; } }
a.cc: In function 'int main()': a.cc:17:23: error: 'M' was not declared in this scope 17 | for (int i = 0; i < M; i++) { | ^
s781296031
p03845
C++
#include <iostream> using namespace std; 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; in...
a.cc:6:7: error: 'h' was not declared in this scope 6 | int t[h]; | ^ a.cc: In function 'int main()': a.cc:15:16: error: 't' was not declared in this scope 15 | cin >> t[i]; | ^ a.cc:25:13: error: 't' was not declared in this scope 25 | c = t[p]; | ...
s905977683
p03845
Java
import java.util.Scanner; public class Main { private static final long x = (long) Math.pow(10, 18); public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t[] = new int[n]; int px[][] = new int[m][2]; int sum = 0; for (int i = 0; i < n; i++) { t[i] ...
Main.java:11: error: cannot find symbol int px[][] = new int[m][2]; ^ symbol: variable m location: class Main 1 error
s091683171
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N; long T[N],Sum=0; for(int i=1;i<=N;i++){ cin >> T[i]; Sum += T[i]; Tp[i]=0; } cin >> M; long Tp[N]; for(int j=0;j<M;j++){ int p,X; cin >> p; cin >> X; Tp[p]=X; } for(int i=1;i<N;i++){ res = Su...
a.cc: In function 'int main()': a.cc:11:5: error: 'Tp' was not declared in this scope; did you mean 'T'? 11 | Tp[i]=0; | ^~ | T a.cc:22:5: error: 'res' was not declared in this scope 22 | res = Sum -T[i] + Tp[i]; | ^~~
s862725777
p03845
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n;//問題数 int t[]={}; for(int i=0;i<n;i++){ cin>>t[i];//問題を解くのにかかる時間 } int m; cin>>m;//ドリンクの種類 int p,x; for(i=0;i<m;i++){ int ans=0; cin>>p>>x; for(int j=0;j<n;j++){ ans+=t[j]; } cout<<ans; } return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'i' was not declared in this scope 11 | for(i=0;i<m;i++){ | ^
s792500248
p03845
C++
#include<map> using namespace std; int main(){ int n; cin >> n; int sum = 0; int T[n]; for(int i=0;i<n;i++){ cin >> T[i]; sum += T[i]; } int m; cin >> m; for(int i=0;i<m;i++){ int p,x; cin >> p >> x; p--; cout << sum - T[p] + x << endl...
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<map> +++ |+#include <iostream> 2 | using namespace std...
s590330124
p03845
C++
#include <bits\stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> probs; vector<int> temp; for(int i{}; i<n; i++){ int b; cin >> b; probs.push_back(b); } temp=probs; int m; cin >> m; for(int i{}; i<m; i++){ probs = temp; int p,x; cin ...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s076455769
p03845
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) int main(){ ll N, M; cin >> N; VL T(N); ll sum = 0; rep(i,0,N){ cin >> T[i]; sum += T[i]; } cin >> M; VL P(M), X(M); ...
a.cc: In function 'int main()': a.cc:8:5: error: 'VL' was not declared in this scope 8 | VL T(N); ll sum = 0; | ^~ a.cc:10:16: error: 'T' was not declared in this scope 10 | cin >> T[i]; | ^ a.cc:13:20: error: expected ';' before 'P' 13 | cin >> M; VL P(M),...
s733415889
p03845
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; int main(){ vector<int> time; int a,b,c,d; cin>>a; for(int i=0;i<a;i++){ cin>>b; time.push_back(b); } cin>>a; d=accumulate(time.begin(),time.end()); for(int i=0;i<a;i++){ cin>>b>>c; cout<<d-time[b]+c<<endl; ...
a.cc: In function 'int main()': a.cc:15:15: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)' 15 | d=accumulate(time.begin(),time.end()); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/numeric:62, ...
s192929374
p03845
C++
n=int(input()) T = list(map(int, input().split())) sum=0 for i in range(n): sum+=T[i] m=int(input()) for i in range(m): P,X = map(int,input().split()) print(sum-T[P-1]+X)
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s930569704
p03845
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; int arr[n]; int sum = 0; for(int i=0;i<n;i++){ cin>>arr[i]; sum+=arr[i]; } int m; cin>>m; int p[m],x[m]; for (int i=0;i<m;i++){ cin>>p[i]>>x[i]; } for(int i=0;i<m;i++){ int a...
a.cc: In function 'int main()': a.cc:19:19: error: 't' was not declared in this scope 19 | int a=sum-t[p[i]-1]+x[i]; | ^
s524382201
p03845
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> t(n),p(m),x(m); for (int i=0;i<n;++i) cin >> t[i]; for (int j=0;j<m;++j) cin >> p[j] >> x[j]; for (int i=0;i<n;++i){ for (int j=0;j<m;++j){ if (!t[i]==x[j]){ swap(t[i],x[j]); sum+=t[i...
a.cc: In function 'int main()': a.cc:15:9: error: 'sum' was not declared in this scope 15 | sum+=t[i]; | ^~~ a.cc:15:19: error: expected '}' at end of input 15 | sum+=t[i]; | ^ a.cc:13:23: note: to match this '{' 13 | if (!t[i]==x[j]){ | ...
s841914092
p03845
C
#include<stdio.h> #include<string.h> int main(){ int N = 0; //問題番号 int M = 0; //ドリンクの番号 scanf("%d",&N); int T[N]; //N番目の問題を解くのにかかる時間 for(int i=0; i<N; i++){ scanf("%d",T[i]); } scanf("%d",&M); int P; //ドリンクの効果が効く、Xに対応する問題 int X; //ドリンクを飲んだ場合に、N番目の問題を解くのにかかる時間 int result[M]; // for(int j=0; i<M; j++...
main.c: In function 'main': main.c:22:22: error: 'i' undeclared (first use in this function) 22 | for(int j=0; i<M; j++){ | ^ main.c:22:22: note: each undeclared identifier is reported only once for each function it appears in main.c:23:24: error: assignment to expression with arra...
s071103064
p03845
C++
#include<bits/stdc++.h> using namespace std; int n,arr[101],array[101],sum,p,x,m,bil; int main(){ cin>>n; for(int i = 1;i <= n;i++){ cin>>bil; sum = sum + bil; arr[i] = bil; } cin>>m; for(int i = 1;i <= m;i++){ cin>>p>>x; sum = sum + x - arr[p]; array[i] = sum; sum = sum - x + arr[p]; } for(int i...
a.cc: In function 'int main()': a.cc:17:17: error: reference to 'array' is ambiguous 17 | array[i] = sum; | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-l...
s961119885
p03845
C++
#include<bits/stdc++.h> using namespace std; int n,arr[101],array[101],sum,p,x,m,bil; int main(){ cin>>n; for(int i = 1;i <= n;i++){ cin>>bil; sum = sum + bil; arr[i] = bil; } cin>>m; for(int i = 1;i <= m;i++){ cin>>p>>x; sum = sum + x - arr[p]; array[i] = sum; sum = sum - x + arr[p]; } for(int i...
a.cc: In function 'int main()': a.cc:17:17: error: reference to 'array' is ambiguous 17 | array[i] = sum; | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-l...
s269708020
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>> n; vector<int>t[n]; int sum = 0; for(int i = 0;i < n;i++){ cin>>t[i]; sum += t[i]; } int m; cin >> m; vector<int>p[m]; vector<int>x[m]; for(int i = 0;i < m;i++){ cin >> p[i] >>x[i]; cout << sum -t[p[i]]+x[i] <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 14 | cin>>t[i]; | ~~~^~~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In ...
s992256719
p03845
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>> n; vector<int>t[n]; int sum = 0; for(int i = 0;i < n;i++){ cin>>t[i]; sum += t[i]; } int m; cin >> m; vector<int>p[m]; vector<int>x[m]; for(int i = 0;i < m;i++){ cin >> p[i] >>x[i]; cout << sum -t[p[i]]+x[i] <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 14 | cin>>t[i]; | ~~~^~~~~~ | | | | | std::vector<int> | std::istream {ak...
s588476862
p03845
C++
#include<iostream> using namespace std; int main() { int n,a[100],m,sum,p,x; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; sum+=a[i]; } cin>>m; for(i=0;i<m;i++) { cin>>p>>x; sum=sum-a[p-1]+x; cout<<sum; } return 0; }
a.cc: In function 'int main()': a.cc:13:7: error: 'i' was not declared in this scope 13 | for(i=0;i<m;i++) | ^
s651148977
p03845
C++
#include<iostream> using namespace std; int main() { int n,a[100],m,sum,p,x; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; sum+=t[i]; } cin>>m; for(i=0;i<m;i++) { cin>>p>>x; sum=sum-a[p-1]+x; cout<<sum; }
a.cc: In function 'int main()': a.cc:10:10: error: 't' was not declared in this scope 10 | sum+=t[i]; | ^ a.cc:13:7: error: 'i' was not declared in this scope 13 | for(i=0;i<m;i++) | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:4:1: note: to match...
s719054735
p03845
C++
#include <bits/stdc++.h> 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],X[M] for(int i=0;i<M;i++)cin >> P[i] >> X[i]; int total =0; for(int i=0;i<N;i++)total += T[i]; for(int i=0;i<M;i++){ cout <<...
a.cc: In function 'int main()': a.cc:11:5: error: expected initializer before 'for' 11 | for(int i=0;i<M;i++)cin >> P[i] >> X[i]; | ^~~ a.cc:11:17: error: 'i' was not declared in this scope 11 | for(int i=0;i<M;i++)cin >> P[i] >> X[i]; | ^ a.cc:15:34: error: 'X' was not dec...
s222325102
p03845
C++
#include <iostream> using namespace std; int main() { long long int n,m,t[10^6],p[110],x[10^6],i,s; cin>>n; for(i=1;i<=n;i++) { cin>>t[i]; } cin>>m; for(i=1;i<=m;i++) { cin>>p[i]>>x[i]; } for(i=1;i<=m;i++) { s=0; t[p[i]]=x[i]; for(i=1;i<=n;i++) ...
a.cc: In function 'int main()': a.cc:7:26: warning: result of '10^6' is 12; did you mean '1e6'? [-Wxor-used-as-pow] 7 | long long int n,m,t[10^6],p[110],x[10^6],i,s; | ^ | --- | 1e a.cc:7:24: note: you can silence this warni...
s233063814
p03845
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} //配列vにn個の要素を入力する int main(){ int n,m; cin >> n; vector<int> t(n); rep(t,n); cin >> m; vector<int> p(m),x(m); for(int i=0;i<m;i++){cin >> p.at(i) >> x.at(i);} for(i...
a.cc: In function 'int main()': a.cc:20:6: error: expected '}' at end of input 20 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^