submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s341392620
|
p04029
|
C
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
printf("%d",n*(n+1)/2;);
return 0;
}
|
main.c: In function 'main':
main.c:5:24: error: expected ')' before ';' token
5 | printf("%d",n*(n+1)/2;);
| ~ ^
| )
|
s433489636
|
p04029
|
C++
|
#include<bits/sdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
int ans;
for(int i=1; i<=N; i++)
ans+=i;
cout << ans << endl;
}
|
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory
1 | #include<bits/sdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s746487682
|
p04029
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
int A = 0;
cin >> N;
for (int i = 0, i < N, i++){
A == A + i;
}
cout << A << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '<' token
9 | for (int i = 0, i < N, i++){
| ^~
| ;
a.cc:9:21: error: expected primary-expression before '<' token
9 | for (int i = 0, i < N, i++){
| ^
a.cc:9:29: error: expected ';' before ')' token
9 | for (int i = 0, i < N, i++){
| ^
| ;
|
s985287503
|
p04029
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
int A = 0;
cin >> N;
for ( i = 0, i < N, i++){
A == A + i;
}
cout << A << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
9 | for ( i = 0, i < N, i++){
| ^
a.cc:13:1: error: expected primary-expression before '}' token
13 | }
| ^
a.cc:12:21: error: expected ')' before '}' token
12 | cout << A << endl;
| ^
| )
13 | }
| ~
a.cc:9:7: note: to match this '('
9 | for ( i = 0, i < N, i++){
| ^
a.cc:13:1: error: expected primary-expression before '}' token
13 | }
| ^
|
s004210620
|
p04029
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
int A = 0;
cin >> N;
for ( i = 0, i < N, 1++){
A == A + i;
}
cout << A << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
9 | for ( i = 0, i < N, 1++){
| ^
a.cc:9:23: error: lvalue required as increment operand
9 | for ( i = 0, i < N, 1++){
| ^
a.cc:13:1: error: expected primary-expression before '}' token
13 | }
| ^
a.cc:12:21: error: expected ')' before '}' token
12 | cout << A << endl;
| ^
| )
13 | }
| ~
a.cc:9:7: note: to match this '('
9 | for ( i = 0, i < N, 1++){
| ^
a.cc:13:1: error: expected primary-expression before '}' token
13 | }
| ^
|
s175776585
|
p04029
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum;
for (int i = 1; i <= n; i++) {
sum += i;
}
System.out.println(sum);
}
}
|
Main.java:10: error: variable sum might not have been initialized
sum += i;
^
Main.java:14: error: variable sum might not have been initialized
System.out.println(sum);
^
2 errors
|
s574279378
|
p04029
|
Java
|
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int p =0;
for(int i = 1;i<=0;i++){
p+=i;
}
System.out.println(p);
}
|
Main.java:12: error: reached end of file while parsing
}
^
1 error
|
s993875826
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int sum(int x){
int s;
s = n+sum(n-1);
return s;
}
cout << sum(n) <<endl;
|
a.cc: In function 'int main()':
a.cc:6:17: error: a function-definition is not allowed here before '{' token
6 | int sum(int x){
| ^
a.cc:11:11: error: 'sum' was not declared in this scope
11 | cout << sum(n) <<endl;
| ^~~
a.cc:11:25: error: expected '}' at end of input
11 | cout << sum(n) <<endl;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s854427103
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,t;
t =0
cin >> n;
for(int i=0;i <n ;i++){
t = t + i + 1;
}
cout << t <<endl;
}
|
a.cc: In function 'int main()':
a.cc:6:7: error: expected ';' before 'cin'
6 | t =0
| ^
| ;
7 | cin >> n;
| ~~~
|
s562047959
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,t;
cin >> n;
for(int i=0;i <n ;i++){
t = t + i + 1
}
cout << t <<endl;
}
|
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '}' token
8 | t = t + i + 1
| ^
| ;
9 | }
| ~
|
s012810779
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,t;
cin >> n;
for(int i=0;i <N ;i++){
t = t + i + 1
}
cout << t <<endl;
}
|
a.cc: In function 'int main()':
a.cc:7:18: error: 'N' was not declared in this scope
7 | for(int i=0;i <N ;i++){
| ^
a.cc:8:18: error: expected ';' before '}' token
8 | t = t + i + 1
| ^
| ;
9 | }
| ~
|
s652476240
|
p04029
|
C++
|
N = int(input())
sum = 0
for i in range(1,N+1):
sum = sum + i
print(sum)
|
a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s675515556
|
p04029
|
C++
|
#include <bits/std++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int answer=0;
for(int i=1;i<=n;i++)
{
answer+=i;
}
cout << answer << endl;
return 0;
}
|
a.cc:1:10: fatal error: bits/std++.h: No such file or directory
1 | #include <bits/std++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s843344708
|
p04029
|
Java
|
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int can= 0;
for(int i = 1; i <= n; i++) {
can += i;
}
System.out.println(can)
}
}
|
Main.java:11: error: ';' expected
System.out.println(can)
^
1 error
|
s878094095
|
p04029
|
C++
|
int main(){
int n;
cin >> n;
int ans = (1 + n) * n / 2;
cout << ans;
}
|
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> n;
| ^~~
a.cc:5:5: error: 'cout' was not declared in this scope
5 | cout << ans;
| ^~~~
|
s565964645
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)n; i++)
const int MOD = 1000000007;
// long long a;
int main(){
int a;
cin >> a;
cout << N*(N + 1)/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: 'N' was not declared in this scope
9 | cout << N*(N + 1)/2 << endl;
| ^
|
s171675535
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a:
cin >> a;
cout << (1+a)*a/2;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
6 | cin >> a;
| ^~~
a.cc:7:14: error: 'a' was not declared in this scope
7 | cout << (1+a)*a/2;
| ^
|
s694042632
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a:
cin >> a;
cout << (1+a)*a/2;
|
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
6 | cin >> a;
| ^~~
a.cc:7:14: error: 'a' was not declared in this scope
7 | cout << (1+a)*a/2;
| ^
a.cc:7:21: error: expected '}' at end of input
7 | cout << (1+a)*a/2;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s110367565
|
p04029
|
C++
|
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
cout << (n * (n + 1)) / 2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> n;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 |
a.cc:8:9: error: 'cout' was not declared in this scope
8 | cout << (n * (n + 1)) / 2 << endl;
| ^~~~
a.cc:8:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:38: error: 'endl' was not declared in this scope
8 | cout << (n * (n + 1)) / 2 << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include <vector>
+++ |+#include <ostream>
2 |
|
s715587503
|
p04029
|
C++
|
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe
int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
int n;
cin >> n;
cout << n(n+1)/2 << endl;
//////////////////////////////////////////////////////
return 0;}
|
a.cc: In function 'int main()':
a.cc:44:10: error: 'n' cannot be used as a function
44 | cout << n(n+1)/2 << endl;
| ~^~~~~
|
s122581685
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
cout<<N(N+1)/2<<endl;
}
|
a.cc: In function 'int main()':
a.cc:7:10: error: 'N' cannot be used as a function
7 | cout<<N(N+1)/2<<endl;
| ~^~~~~
|
s439285415
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
// 0 ~ nの総和を求める
int sum(int N) {
if (N == 0) {
// sum0のケースを場合分け
return 0;
}
// それ以外のケース
int s = sum(N - 1); // 1~(n-1)の総和を計算
return s + N; // nを足して返す
}
int main() {
cout << sum(N) << endl; // 6
}
|
a.cc: In function 'int main()':
a.cc:17:15: error: 'N' was not declared in this scope
17 | cout << sum(N) << endl; // 6
| ^
|
s512479350
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
// 0 ~ nの総和を求める
int sum(int n) {
if (n == 0) {
// sum0のケースを場合分け
return 0;
}
// それ以外のケース
int s = sum(n - 1); // 1~(n-1)の総和を計算
return s + n; // nを足して返す
cout << sum(n) << endl; // 6
}
|
/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
|
s583433277
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
// 0 ~ nの総和を求める
int sum(int n) {
if (n == 0) {
// sum0のケースを場合分け
return 0;
}
// それ以外のケース
int s = sum(n - 1); // 1~(n-1)の総和を計算
return s + n; // nを足して返す
}
int main() {
cout << sum(n) << endl; // 6
}
|
a.cc: In function 'int main()':
a.cc:17:15: error: 'n' was not declared in this scope; did you mean 'yn'?
17 | cout << sum(n) << endl; // 6
| ^
| yn
|
s257256405
|
p04029
|
C++
|
using System;
namespace helloVS
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int ans = n * (n + 1) * (2 * n + 1) / 6;
Console.WriteLine("{0}\n", ans);
}
}
}
|
a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:7:26: error: 'string' has not been declared
7 | static void Main(string[] args)
| ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
7 | static void Main(string[] args)
| ^~~~
a.cc:13:6: error: expected ';' after class definition
13 | }
| ^
| ;
a.cc: In static member function 'static void helloVS::Program::Main(int*)':
a.cc:9:21: error: expected primary-expression before 'int'
9 | int n = int.Parse(Console.ReadLine());
| ^~~
a.cc:11:13: error: 'Console' was not declared in this scope
11 | Console.WriteLine("{0}\n", ans);
| ^~~~~~~
|
s207345051
|
p04029
|
C++
|
#include<cstring>
#include<cstdio>
int main(){
char key[100];
char s[100];
int x = 0;
scanf("%s", key);
for(int i=0; i>strlen(key); i++){
if(key[i] == "B"){
if(x != 0){
x--;
}
else{
s[x] = key[i];
x++;
}
}
}
printf("%s", s);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(key[i] == "B"){
| ~~~~~~~^~~~~~
|
s537391516
|
p04029
|
C++
|
#include<cstdio>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int x;
for(int i = 1; i <= n; i++){
x = i++;
}
printf("%d", x);
return 0;
|
a.cc: In function 'int main()':
a.cc:16:12: error: expected '}' at end of input
16 | return 0;
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s323721083
|
p04029
|
C++
|
#include<cstdio>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int x;
for(int i = 1; i <= N; i++){
x = i++;
}
printf("%d", x);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:23: error: 'N' was not declared in this scope
11 | for(int i = 1; i <= N; i++){
| ^
|
s881201118
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int N;
cin >> N;
int x = 0;
for(int i = 1; i >= N; i++){
x = i++
}
return x;
}
|
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before '}' token
12 | x = i++
| ^
| ;
13 | }
| ~
|
s301103369
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int N;
cin >> N;
int x = 0;
for(i = 1; i >= N; i++){
x = i++
}
return x;
}
|
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
11 | for(i = 1; i >= N; i++){
| ^
|
s943469524
|
p04029
|
C++
|
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int a, b;
cin >> a >> b >> c;
//a = 5;
//b = 0;
for (int i = 1; i <= a; i++) {
b += i * 2;
}
cout << b << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:20: error: 'c' was not declared in this scope
7 | cin >> a >> b >> c;
| ^
|
s223778985
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
cout<<((1+a)*a)/2)<<endl;
}
|
a.cc: In function 'int main()':
a.cc:6:20: error: expected ';' before ')' token
6 | cout<<((1+a)*a)/2)<<endl;
| ^
| ;
|
s096434096
|
p04029
|
C++
|
#include <bits/stdc++.h>
int main(){
int a;
cin>>a;
cout<<((1+a)*a)/2)<<endl;
}
|
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin>>a;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | cout<<((1+a)*a)/2)<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s173906311
|
p04029
|
C++
|
#include <bits/stdc++.h<
int main(){
int a;
cin>>a;
cout<<((1+a)*a)/2)<<endl;
}
|
a.cc:1:25: error: missing terminating > character
1 | #include <bits/stdc++.h<
| ^
a.cc:1:10: fatal error: bits/stdc++.h<: No such file or directory
1 | #include <bits/stdc++.h<
| ^
compilation terminated.
|
s891307982
|
p04029
|
C++
|
#include<bits/t\stdc++.h>
using namespace std;
int main(void){
int n;
cin >> n;
cout << (1+n)*n/2 << endl;
}
|
a.cc:1:9: fatal error: bits/t\stdc++.h: No such file or directory
1 | #include<bits/t\stdc++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s026388883
|
p04029
|
C++
|
#include <stdio.h>int main () {int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2);}
|
a.cc:1:23: warning: extra tokens at end of #include directive
1 | #include <stdio.h>int main () {int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2);}
| ^~~~
a.cc:1:10: fatal error: stdio.h>in: No such file or directory
1 | #include <stdio.h>int main () {int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2);}
| ^~~~~~~~~~~~
compilation terminated.
|
s329835379
|
p04029
|
Java
|
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int sum=0;
for(int i=1; i<n+1; i++) {
sum += i;
}
System.out.print(sum);
}
}
|
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s680300971
|
p04029
|
C++
|
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
int n;
cin >> n;
int ans;
for(int i=1; i<=n; i++){
ans += i;
}
cout << i << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:17: error: 'i' was not declared in this scope
18 | cout << i << endl;
| ^
|
s529940946
|
p04029
|
Java
|
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
ans = 0;
for(int i = 0; i < N; i++){
ans += i;
}
System.out.println(ans);
}
}
|
Main.java:7: error: cannot find symbol
ans = 0;
^
symbol: variable ans
location: class Main
Main.java:9: error: cannot find symbol
ans += i;
^
symbol: variable ans
location: class Main
Main.java:11: error: cannot find symbol
System.out.println(ans);
^
symbol: variable ans
location: class Main
3 errors
|
s512488035
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main() {
int n,sum;
cin << n;
for(int i=0; i<n;i++) {
sum += n+1;
}
cout >> sum >>endl;
}
|
a.cc: In function 'int main()':
a.cc:5:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
5 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:5:7: note: candidate: 'operator<<(int, int)' (built-in)
5 | cin << n;
| ~~~~^~~~
a.cc:5:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:5:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
5 | cin << n;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:5:10: required from here
5 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
9 | cout >> sum >>endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:9:8: note: candidate: 'operator>>(int, int)' (built-in)
9 | cout >> sum >>endl;
| ~~~~~^~~~~~
a.cc:9:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operat
|
s607207406
|
p04029
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int N;
cin >> N;
printf(N(N+1)/2);
}
|
a.cc: In function 'int main()':
a.cc:8:11: error: 'N' cannot be used as a function
8 | printf(N(N+1)/2);
| ~^~~~~
|
s709197380
|
p04029
|
C++
|
#include <bits/stdc++.h>
#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
#include <cstring>
using namespace std;
using ll=long long;
#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define LLONG_MAXs 9223372036854775800
#define ALL(a) (a).begin(),(a).end()
#include <iostream>
#include <cmath>
using namespace std;
bool isPrimeNum( ll x ){ // 素数である場合 true を返す
if( x <= 1 ){ // 1以下である場合は素数でないことがすぐにわかる
return false;
}
// sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト
int n = (int)sqrt( (double)x );
for( int i = 2; i <= n; i++ ){
if( x % i == 0 ){ // 割り切る整数がある場合、即判定終了
return false;
}
}
return true; // 割り切る整数がない場合、素数である
}
ll myPow(ll x, ll n, ll m){
if(n == 0)
return 1;
if(n % 2 == 0)
return myPow(x * x % m, n / 2, m);
else
return x * myPow(x, n - 1, m) % m;
}
constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
constexpr ll min(ll a,ll b){
if(a>=b)return b;
if(a<b)return a;
}
constexpr ll max(ll a,ll b){
if(a>=b)return a;
if(a<b)return b;
}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
class UnionFind {
public:
//親の番号を格納する。親だった場合は-(その集合のサイズ)
vector<int> Parent;
//作るときはParentの値を全て-1にする
//こうすると全てバラバラになる
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//親をとってきたい]
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらひっくり返しちゃう。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
long long fac[510000], finv[510000], inv[510000];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < 510000; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
// 前処理
//COMinit();
string N;
cin>>N;
cout<<N*(N-1)/2<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:161:13: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
161 | cout<<N*(N-1)/2<<endl;
| ~^~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
161 | cout<<N*(N-1)/2<<endl;
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: mismatched types 'const std::complex<_Tp>' and 'int'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:161:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:161:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
161 | cout<<N*(N-1)/2<<endl;
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:161:14: note: mismatched types 'const std::valarray<_Tp>' and 'int'
161 | cout<<N*(N-1)/2<<endl;
| ^
|
s236878268
|
p04029
|
C
|
#include<stdio.h>
int main(){
int n;
scanf("%d", &n);
int ans = &n*(&n-1);
printf("%d", ans);
return 0;
}
|
main.c: In function 'main':
main.c:8:17: error: invalid operands to binary * (have 'int *' and 'int *')
8 | int ans = &n*(&n-1);
| ~~^~~~~~~
| | |
| int * int *
|
s827462270
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
|
a.cc: In function 'int main()':
a.cc:4:12: error: expected '}' at end of input
4 | int main(){
| ~^
|
s997118500
|
p04029
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum=0;
for(i=1;i>=n;i++){
sum=sum+i;
}
System.out.println(sum);
}
}
|
Main.java:9: error: cannot find symbol
for(i=1;i>=n;i++){
^
symbol: variable i
location: class Main
Main.java:9: error: cannot find symbol
for(i=1;i>=n;i++){
^
symbol: variable i
location: class Main
Main.java:9: error: cannot find symbol
for(i=1;i>=n;i++){
^
symbol: variable i
location: class Main
Main.java:10: error: cannot find symbol
sum=sum+i;
^
symbol: variable i
location: class Main
4 errors
|
s957373256
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
int c=0
for(int count=0;count<N;count++){
c++;
}
cout<<c<<endl;
}
|
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
9 | for(int count=0;count<N;count++){
| ^~~
a.cc:9:19: error: parse error in template argument list
9 | for(int count=0;count<N;count++){
| ^~~~~~~
a.cc:9:19: error: statement cannot resolve address of overloaded function
a.cc:9:32: error: no post-increment operator for type
9 | for(int count=0;count<N;count++){
| ^~
|
s227755701
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(void){
int n;
cin >> n;
for(int i=1; i<=n; i++){
int sum = 0;
sum += i;
}
cout<<sum<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:11: error: 'sum' was not declared in this scope
11 | cout<<sum<<endl;
| ^~~
|
s088333392
|
p04029
|
C++
|
#include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >> n;
cout << (n(n+1))/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: 'n' cannot be used as a function
11 | cout << (n(n+1))/2 << endl;
| ~^~~~~
|
s259325642
|
p04029
|
C++
|
#include <iostream>
class ANChildrenAndCandiesABCEdit {
public:
void solve(std::istream& in, std::ostream& out) {
int t;
in >> t;
out << t*(t+1)/2 << std::endl;
}
};
|
/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
|
s279843685
|
p04029
|
C++
|
#include<stdio.h>
int main(){
int a;
scanf("%d",&a);
printf("%d"(a+1)*a/2);
}
|
a.cc: In function 'int main()':
a.cc:5:16: error: expression cannot be used as a function
5 | printf("%d"(a+1)*a/2);
| ~~~~^~~~~
|
s985759080
|
p04029
|
C++
|
include<stdio.h>
int main(){
int a;
scanf("%d",&a);
printf("%d"(a+1)*a/2);
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<stdio.h>
| ^~~~~~~
|
s055661018
|
p04029
|
C++
|
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stdio.h>
using namespace std;
int main(){
int n;
cin>>n;
int gokei - 0;
for(int i=1; i<=n; i++){
gokei += i;
}
cout<<gokei<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:15: error: expected initializer before '-' token
10 | int gokei - 0;
| ^
a.cc:12:9: error: 'gokei' was not declared in this scope
12 | gokei += i;
| ^~~~~
a.cc:14:11: error: 'gokei' was not declared in this scope
14 | cout<<gokei<<endl;
| ^~~~~
|
s668607591
|
p04029
|
C
|
#include<stdio.h>
int fact(int n);
int main(void){
int i;
scanf("%d",&i);
printf("%d",fact(i));
return 0;
}
int fact(int n){
if (n==0){
return ;
}else{
return(n*fact(n-1));
}
|
main.c: In function 'fact':
main.c:14:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
14 | return ;
| ^~~~~~
main.c:12:5: note: declared here
12 | int fact(int n){
| ^~~~
main.c:17:1: error: expected declaration or statement at end of input
17 | }
| ^
|
s136904354
|
p04029
|
C
|
#include<stdio.h>
int main(void){
int a,i=0,res=0);
for(i<=a;i++){
res +=i;
}
printf("%d",res);
}
|
main.c: In function 'main':
main.c:3:18: error: expected ',' or ';' before ')' token
3 | int a,i=0,res=0);
| ^
main.c:4:15: error: expected ';' before ')' token
4 | for(i<=a;i++){
| ^
| ;
|
s607544510
|
p04029
|
C
|
#include <stdio.h>
int main(void) {
int n,i,sum=0;
scanf("%d",&n);
for(i=1;i<=a;i++)sum+=i;
printf("%d",sum);
return 0;
}
|
main.c: In function 'main':
main.c:6:16: error: 'a' undeclared (first use in this function)
6 | for(i=1;i<=a;i++)sum+=i;
| ^
main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in
|
s644510797
|
p04029
|
C
|
#include<stdio.h>
int main(void){
int n,t,res=0;
scanf("%d",&n);
for(t=0,t<=n,t++)res += t;
printf("%d",res);
return 0;
}
|
main.c: In function 'main':
main.c:5:19: error: expected ';' before ')' token
5 | for(t=0,t<=n,t++)res += t;
| ^
| ;
main.c:5:19: error: expected expression before ')' token
|
s269572732
|
p04029
|
C
|
#include<stdio.h>
int main(void){
int n,t,res;
scanf("%d\n",&n);
res=0;
for(t=0,t<=n,t++)res += t;
printf("%d\n",&res);
return 0;
}
|
main.c: In function 'main':
main.c:6:19: error: expected ';' before ')' token
6 | for(t=0,t<=n,t++)res += t;
| ^
| ;
main.c:6:19: error: expected expression before ')' token
|
s607253655
|
p04029
|
C
|
#include<stdio.h>
int main(void){
int n,res;
scanf("%d\n",&n);
res=0;
for(t==0,t<=n,t++){
res += t;
}
printf("%d\n",&res);
return 0;
}
|
main.c: In function 'main':
main.c:6:7: error: 't' undeclared (first use in this function)
6 | for(t==0,t<=n,t++){
| ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:20: error: expected ';' before ')' token
6 | for(t==0,t<=n,t++){
| ^
| ;
main.c:6:20: error: expected expression before ')' token
|
s428926946
|
p04029
|
C++
|
v#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int N;
int main(){
cin>>N;
out(N*(N+1)/2);
}
|
a.cc:1:2: error: stray '#' in program
1 | v#include<stdio.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include<stdio.h>
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/stdlib.h:32,
from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:
|
s677513762
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a,ans=0;
cin>>a;
for(a;a>0,a--)ans+=a;
cout<<ans<<endl;
}
|
a.cc: In function 'int main()':
a.cc:6:16: error: expected ';' before ')' token
6 | for(a;a>0,a--)ans+=a;
| ^
| ;
|
s191749657
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int N, ans;
cin >> N;
ans = N (N + 1) / 2;
cout << ans << endl;
}
|
a.cc: In function 'int main()':
a.cc:6:11: error: 'N' cannot be used as a function
6 | ans = N (N + 1) / 2;
| ~~^~~~~~~
|
s561313071
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int sum = 0;
cin >> n;
for (int i = 0; i < n; i++) {
sum += (i+1);
}
cout >> sum >> endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
12 | cout >> sum >> endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:12:8: note: candidate: 'operator>>(int, int)' (built-in)
12 | cout >> sum >> endl;
| ~~~~~^~~~~~
a.cc:12:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:12:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
12 | cout >> sum >> endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:12:11: required from here
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout >> sum >> endl;
| ^~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed:
a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostr
|
s190015247
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int ddd;
cin >> ddd ;
int aaa;
aaa=(ddd*(ddd +1))/2
cout <<aaa << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before 'cout'
8 | aaa=(ddd*(ddd +1))/2
| ^
| ;
9 | cout <<aaa << endl;
| ~~~~
|
s822880507
|
p04029
|
C++
|
#include <iostream>
int main() {
int N; cin >> N;
cout << (1+N)*N / 2 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:3:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
3 | int N; cin >> N;
| ^~~
| 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; ///< Linked to standard input
| ^~~
a.cc:4:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
4 | cout << (1+N)*N / 2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:4:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
4 | cout << (1+N)*N / 2 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s644974765
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, result = 0;
cin >> N;
while(N > 0){
result += N;
N--
}
cout << result << endl;
}
|
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before '}' token
10 | N--
| ^
| ;
11 | }
| ~
|
s747601465
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main (){
int n,sum =0;
cin>> n;
for(int i = 1;i<=n;i++)sum+=i;
cout<<i<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
11 | cout<<i<<endl;
| ^
|
s975897627
|
p04029
|
C++
|
#include <iostream>
int main()
{
int n;
cin >> n;
int sum = n * (n + 1) * 1 / 2;
cout << sum << endl;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> n;
| ^~~
| 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; ///< Linked to standard input
| ^~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << sum << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout << sum << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s617325801
|
p04029
|
C++
|
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)
#define INF 10000000
typedef long long ll;
using namespace std;
double euclid_distance(double a,double b){
return sqrt(a*a+b*b);
}
int gcd(long long int a,long long int b){
long long int r;
if(a < b){
int tmp;
tmp = a;
a = b;
b = tmp;
}
while(r != 0){
r = a % b;
a = b;
b = r;
}
return r;
}
void Integer_factorization(long long int b,long long int n){
long long int a = 2;
long long int count = 0;
long long int ans = 1;
long long int ndash = n;
if(b == 1) cout << n << endl;
else{
while(ndash >= a*a){
if(n % a == 0){
count++;
n/=a;
if(count % b == 0){
ans *= a;
}
}else{a++;count = 0;}
}
cout<< ans << endl;
}
}
void ys(){
cout << "Yes" << endl;
}
void yb(){
cout << "YES" << endl;
}
void ns(){
cout << "No" << endl;
}
void nb(){
cout << "NO" << endl;
}
//A
//B
//C
//D
void solve(void){
int n;
cin >> n;
cout << n(n+1)/2;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
solve();
}
|
a.cc: In function 'void solve()':
a.cc:83:14: error: 'n' cannot be used as a function
83 | cout << n(n+1)/2;
| ~^~~~~
|
s960124568
|
p04029
|
C++
|
#include <bits;stdc++.h>
using namespace std;
int main(){
int N,sum;
sum = 0;
cin >> N;
for(int i = 0; i < N;i++){
sum += i + 1;
}
cout << sum << endl;
}
|
a.cc:1:10: fatal error: bits;stdc++.h: No such file or directory
1 | #include <bits;stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s592019473
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N ;
cin >> N ;
cout << N(N+1)/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: 'N' cannot be used as a function
8 | cout << N(N+1)/2 << endl;
| ~^~~~~
|
s386167978
|
p04029
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
int count = new Scanner(System.in).nextInt();
int total = 0;
for (int ix = 1; ix <= count; ix++) {
total += ix;
}
System.out.println(ix);
}
}
|
Main.java:12: error: cannot find symbol
System.out.println(ix);
^
symbol: variable ix
location: class Main
1 error
|
s972330798
|
p04029
|
C++
|
#include <iostream>
#include <vector>
#include <unordered_set>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
cout << (n + (n + 1)) / 2 << end;
}
|
a.cc: In function 'int main()':
a.cc:13:35: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
13 | cout << (n + (n + 1)) / 2 << end;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 |
|
s250534465
|
p04029
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
int A,B,C,D,E,N,M,x,y,cou=0,cou2,v[1000000],w[1000000],min_i,en=0;
char S[20],W[100],s[10],X,Y;
scanf("%d",&A);
for(int i=1;i<=A;i++){
cou+=i;
}
printf("%d",i);
return 0;
}
|
main.c: In function 'main':
main.c:10:16: error: 'i' undeclared (first use in this function)
10 | printf("%d",i);
| ^
main.c:10:16: note: each undeclared identifier is reported only once for each function it appears in
|
s544771354
|
p04029
|
C++
|
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
using namespace std;
#define MAX 1000000
#define INF 2140000000
#define MOD 1000000007
int main() {
int minn = MAX, maxx = -MAX, n;
cin >> n;
vector<int> ar(n);
for (int i = 0; i < n; ++i) {
cin >> ar[i];
minn = min(minn,ar[i]);
maxx = max(maxx,ar[i]);
}
int ans = MAX;
for (int i = minn; i < maxx + 1; ++i) {
int sum = 0;
for (int i = 0; i < ar.size(); ++i) {
sum += (ar[i] - num)*(ar[i] - num);
}
ans = min(sum, ans);
}
cout << ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:47:41: error: 'num' was not declared in this scope; did you mean 'sum'?
47 | sum += (ar[i] - num)*(ar[i] - num);
| ^~~
| sum
|
s642316690
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
cout << ((N + 1) * N) / 2 << endl;
}
}
|
a.cc:9:1: error: expected declaration before '}' token
9 | }
| ^
|
s207113100
|
p04029
|
C++
|
#include <iostream>
int main(){
int n;
std::cin >> n;
std::cout << n*(n+1)/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:6:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | std::cout << n*(n+1)/2 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s880759544
|
p04029
|
C++
|
#include <iostream>
int main(){
int n;
std:cin >> n;
std:cout << n*(n+1)/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | std:cin >> n;
| ^~~
| 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; ///< Linked to standard input
| ^~~
a.cc:6:3: error: duplicate label 'std'
6 | std:cout << n*(n+1)/2 << endl;
| ^~~
a.cc:6:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | std:cout << n*(n+1)/2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | std:cout << n*(n+1)/2 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s512672222
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
long n,k;
long a[100000001];
int main()
{
cin>>n;
cout<<(n+1)*n/2;5
}
|
a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '}' token
8 | cout<<(n+1)*n/2;5
| ^
| ;
......
11 | }
| ~
|
s930162239
|
p04029
|
C++
|
#include <bits/c++.h>
using namespace std;
int main(){
int n;
cin>>n;
cout<<(n*(n+1)/2);
}
|
a.cc:1:10: fatal error: bits/c++.h: No such file or directory
1 | #include <bits/c++.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s946616591
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
cout<<n(n+1)/2;
}
|
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' cannot be used as a function
7 | cout<<n(n+1)/2;
| ~^~~~~
|
s309071342
|
p04029
|
C++
|
N = int(input())
from operator import add
from functools import reduce
ans = reduce(add, range(N)) + N
print(ans)
print()
|
a.cc:2:1: error: 'N' does not name a type
2 | N = int(input())
| ^
|
s481081663
|
p04029
|
C++
|
#include<bits.stdc++.h>
using namespace std;
int main(){int n;cin>>n;cout<<n*(n+1)/2;}
|
a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s604481126
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(void)
{
int n = 0,ans = 0;
cin << n;
for(int i = 1;i <= n;i++)
{
ans += i;
}
cout >> ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:7: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << n;
| ~~~~^~~~
a.cc:7:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:7:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << n;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:7:10: required from here
7 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
13 | cout >> ans;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:8: note: candidate: 'operator>>(int, int)' (built-in)
13 | cout >> ans;
| ~~~~~^~~~~~
a.cc:13:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_
|
s006118267
|
p04029
|
C++
|
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
double A,B, C, D,E,F;
long long int Aa[10000000] = {};
string S,Sa,Sb,Sc;
cin >> A;
if(A % 2 == 0)cout << (A + 1) * (A / 2) << endl;
else cout << A * (A / 2 + 1) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:14: error: invalid operands of types 'double' and 'int' to binary 'operator%'
11 | if(A % 2 == 0)cout << (A + 1) * (A / 2) << endl;
| ~ ^ ~
| | |
| | int
| double
|
s586524515
|
p04029
|
C++
|
#include <iostream>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()
const int MOD = 1e9 + 7;
void solve(){
}
int func(int n){
if (n == 1) return 1;
return n + func(n-1);
}
int main(){
cin >> N;
cout << func(N) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:31:12: error: 'N' was not declared in this scope
31 | cin >> N;
| ^
|
s526531058
|
p04029
|
C++
|
#include <iostrem>
#include <algorithm>
using namespace std;
int main(){
int n;
cin>>n;
cout<<n*(n+1)/2<<endl;
return 0;
}
|
a.cc:1:10: fatal error: iostrem: No such file or directory
1 | #include <iostrem>
| ^~~~~~~~~
compilation terminated.
|
s288542600
|
p04029
|
C++
|
N=input()
S=N(N+1)//2
print(S)
|
a.cc:1:1: error: 'N' does not name a type
1 | N=input()
| ^
|
s553537699
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
y=n(n+1)/2;
cout<<y<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:3: error: 'y' was not declared in this scope
7 | y=n(n+1)/2;
| ^
a.cc:7:6: error: 'n' cannot be used as a function
7 | y=n(n+1)/2;
| ~^~~~~
|
s345791348
|
p04029
|
C++
|
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
int h,w,x;
char s[1000][1000];
bool visited [1000][1000];
pair<int,int> start,goal;
queue<pair<int,pair<int,int>>> q;
vector<pair<int,int>> ino;
int main(){
int a,b,c,d;cin>>a>>b>>c>>d;
//int a[3];cin>>a[0]>>a[1]>>a[2];sort(a,a+3);
/*if(a[2]==a[1]+a[0]){
cout<<"Yes";
}else{
cout<<"No";
}*/
cout << (1+n)*n/2;
}
|
a.cc: In function 'int main()':
a.cc:25:14: error: 'n' was not declared in this scope
25 | cout << (1+n)*n/2;
| ^
|
s766355730
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int H;
cin >> H;
int Q=H
for (int i=0;i<H;i++){
Q += Q--;}
cout << Q << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i=0;i<H;i++){
| ^~~
a.cc:8:16: error: 'i' was not declared in this scope
8 | for (int i=0;i<H;i++){
| ^
|
s796004795
|
p04029
|
C++
|
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;
int main() {
string s;
int i,n;
cin >> s;
n=strlen (s);
i = 0;
while (s[i] == 'B') {
s[i] ='2';
i++;
}
int j;
for (j = i; j < n; j++) {
if (s[j] == 'B') {
int x;
x = j-1;
while (s[x] == '2') {
x--;
}
s[j] = '2'; s[x] = '2'; }
}
cout<<endl;
for (j = 0; j < n; j++) {
if (s[j] != '2')cout << s[j];
}
cout << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:11: error: 'strlen' was not declared in this scope
17 | n=strlen (s);
| ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include<map>
+++ |+#include <cstring>
11 | using namespace std;
|
s686480559
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(void) {
int n;
cin >> n;
int a=0;
for(int i = 1; i <= n i++) a += i;
cout << a << endl;
}
|
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before 'i'
10 | for(int i = 1; i <= n i++) a += i;
| ^~
| ;
|
s074672516
|
p04029
|
C++
|
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include<bits/stdc++.h>
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/detail/standard_policies.hpp>*/
#define sz(s) (int)(s.size())
#define all(s) s.begin(), s.end()
#define rep(a, b, c) for(int a = b; a <= c; ++a)
#define per(a, b, c) for(int a = b; a >= c; --a)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
//using namespace __gnu_pbds;
typedef unsigned long long ull;
typedef long long ll;
/*typedef tree<pair<int, int>,
null_type, less<pair<int, int>>,
rb_tree_tag, tree_order_statistics_node_update>
ordered_set;*/
//find_by_order() order_of_key()
const double eps = 1e-7;
const int mod = 1e9+7, MXN = 5e5+17;
const int dx[] = {0,0,1,-1}, dy[] = {1,-1,0,0};
template<typename T>inline bool updmin(T &a, const T &b) {return a > b ? a = b,1 : 0;}
template<typename T>inline bool updmax(T &a, const T &b) {return a < b ? a = b,1 : 0;}
int32_t main() { _
#ifdef DanQQQQQ
freopen(".in","r",stdin);
freopen(".out","w",stdout);
#endif
int n; cin >> n;
cout << n*(n+1)>>1;
return 0;
}
|
a.cc: In function 'int32_t main()':
a.cc:40:24: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'int')
40 | cout << n*(n+1)>>1;
| ~~~~~~~~~~~~~~~^~~
| | |
| | int
| std::basic_ostream<char>
a.cc:40:24: note: candidate: 'operator>>(int, int)' (built-in)
40 | cout << n*(n+1)>>1;
| ~~~~~~~~~~~~~~~^~~
a.cc:40:24: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:5:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:40:14: note: cannot convert 'std::cout.std::basic_ostream<char>::operator<<((n * (n + 1)))' (type 'std::basic_ostream<char>') to type 'std::byte'
40 | cout << n*(n+1)>>1;
| ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:40:19: required from here
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:40:26: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
40 | cout << n*(n+1)>>1;
| ^
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed:
a
|
s226080163
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d",((n*(n+1))/2);
return 0;
}
|
main.c: In function 'main':
main.c:6:34: error: expected ')' before ';' token
6 | printf("%d",((n*(n+1))/2);
| ~ ^
| )
main.c:7:18: error: expected ';' before '}' token
7 | return 0;
| ^
| ;
8 | }
| ~
|
s062780193
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d",((n*(n+1))/2);
return 0;
}
|
main.c: In function 'main':
main.c:5:23: error: expected ';' before '\U0000ff1b'
5 | scanf("%d",&n);
| ^~
| ;
main.c:8:1: error: expected declaration or statement at end of input
8 | }
| ^
|
s353218269
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
scanf("%d");
printf("%d",((n*(n+1))/2);
return 0;
}
|
main.c: In function 'main':
main.c:5:20: error: expected ';' before '\U0000ff1b'
5 | scanf("%d");
| ^~
| ;
main.c:8:1: error: expected declaration or statement at end of input
8 | }
| ^
|
s630274499
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int a;
cout << n*(1+n)/2 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: 'n' was not declared in this scope
9 | cout << n*(1+n)/2 << endl;
| ^
|
s841709278
|
p04029
|
C
|
#include<cstdio>
int main ()
{
int n=0,sum=0;
scanf("%d",&n);
while(1<=n<=100)
n=n+1;
sum=(n+1)*n/2;
printf("%d\n",sum);
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s959818540
|
p04029
|
C
|
#include<stdio.h>
int main()
{
int x=0,sum=0,a=0,b=0;
scanf("%d,%d,%d",&a,&x,&b);
while (x<a)
x=x+1;
b=x;
1<=b<=100
sum=(b+1)*b/2;
printf("%d\n",sum);
}
|
main.c: In function 'main':
main.c:9:23: error: expected ';' before 'sum'
9 | 1<=b<=100
| ^
| ;
10 | sum=(b+1)*b/2;
| ~~~
|
s044250718
|
p04029
|
C
|
#include<stdio.h>
int main()
{
int x=0,sum=0,a=0,b=0;
scanf("%d,%d,%d",&a,&x,&b);
while (x<a)
x=x+1;
b=x;
1<=b<=100
sum=(b+1)*b/2;
printf("sum=%d\n",sum);
}
|
main.c: In function 'main':
main.c:9:24: error: expected ';' before 'sum'
9 | 1<=b<=100
| ^
| ;
10 | sum=(b+1)*b/2;
| ~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.