submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s058796034 | p04047 | C++ | // ----- Author Info -------
// Khaled Alam - Ninjo
// khaledalam.net@gmail.com
//--------------------------
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define sz size()... | a.cc: In function 'int main()':
a.cc:28:13: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
28 | cin > n;
| ~~~ ^ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:28... |
s770334565 | p04047 | C | include<stdio.h>
int main(void)
{
int num;
int length[100] = {};
int i, j;
int temp;
int sum=0;
scanf("%d", &num);
for (i=0;i<num*2;i++){
scanf("%d", &length[i]);
}
for(i=0;i<num*2;i++){
for(j=i+1;j<num*2;j++){
if(length[i] < length[j]){
temp = length[i];
length[i] = length[j];
le... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s187089552 | p04047 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int n =sc.nextInt();
int[] l=new int[n*2];
for(int i=0; i<l.length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l); //昇順にソート
int ans=0;
for(int j=0; j<l.length; j+=2){
ans +=Math.min(l[j],l[j+1]);... | Main.java:13: error: illegal character: '\u3000'
Arrays.sort(l); ???//??????
^
Main.java:13: error: illegal character: '\u3000'
Arrays.sort(l); ???//??????
^
Main.java:13: error: illegal character: '\u3000'
Arrays.sort(l); ???//??????
^
Main.java:17: error: illegal cha... |
s537382898 | p04047 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int n =sc.nextInt();
int[] l=new int[n*2];
for(int i=0; i<l.length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l);
int ans=0;
for(int j=0; j<l.length; j+=2){
ans +=Math.min(... | Main.java:20: error: cannot find symbol
ans +=Math.min(l[j],l[i+1]);
^
symbol: variable i
location: class Main
1 error
|
s634329812 | p04047 | C++ | #include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int N;
cin >> N;
int n = N*2;
int L[n];
for(int i=0;i<n;i++){
cin >> L[i];
}
sort(L,L+n);
int maxFood = 0;
for(int i=0;i<N;i++){
int index = i*2;
maxFood += min(L[index],L[inde... | a.cc: In function 'int main(int, const char**)':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(L,L+n);
| ^~~~
| short
|
s469265599 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int yousosu =sc.nextInt();
int l[]=new int[yousosu];
for(int i=0; i<l.length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l);
for(int j=0; j<l.length-1; j++){
int ans=0;
ans +=Math.min(l[j],l[j]+1... | Main.java:18: error: ')' or ',' expected
ans +=Math.min(l[j],l[j]+1]);
^
1 error
|
s822405645 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int nagasa =sc.nextInt();
int l[]=new int[nagasa];
for(int i=0; i<length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l);
for(int i=0; i<length-1; i++){
int ans=0;
ans +=Math.min(l[i],l[i+1]);
... | Main.java:11: error: cannot find symbol
for(int i=0; i<length; i++){
^
symbol: variable length
location: class Main
Main.java:16: error: cannot find symbol
for(int i=0; i<length-1; i++){
^
symbol: variable length
location: class Main
2 errors
|
s646019263 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int nagasa =sc.nextInt();
int l[]=new int[nagasa];
for (int =0; i<length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l);
for(int i=0; i<length-1; i++){
int ans=0;
ans +=Math.min(l[i],l[i+1]);
... | Main.java:11: error: not a statement
for (int =0; i<length; i++){
^
Main.java:11: error: ';' expected
for (int =0; i<length; i++){
^
Main.java:11: error: illegal start of expression
for (int =0; i<length; i++){
^
Main.java:11: error: not a statement
for (int =0; i<length; i++){
... |
s283557879 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int nagasa =sc.nextInt();
int l[]=new int[nagasa];
for (int =0; i<length; i++){
l[i]=sc.nextInt();
}
Arrays.sort(l);
for(int i=0; i<length-1; i++){
int ans=0;
ans +=<Math.min(l[i],l[i+1]);
... | Main.java:11: error: not a statement
for (int =0; i<length; i++){
^
Main.java:11: error: ';' expected
for (int =0; i<length; i++){
^
Main.java:11: error: illegal start of expression
for (int =0; i<length; i++){
^
Main.java:11: error: not a statement
for (int =0; i<length; i++){
... |
s704768214 | p04047 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int skw, L[200], sum = 0;
scanf("%d", &skw);
for(int i = 0;i < skw; i++)
scanf("%d", &L[i]);
sort(L[0], L[skw-1]);
for(int j = 0; j < skw; j+2)
sum = sum + min(L[j],L[j+1]);
printf("%d\n", sum);
return 0;
} | In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/inclu... |
s799914217 | p04047 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int skw, L[200], sum = 0;
scanf("%d", &skw);
for(int i = 0;i < skw; i++)
scanf("%d", &L[i]);
sort(L, skw);
for(int j = 0; j < skw; j+2)
sum = sum + min(L[j],L[j+1]);
printf("%d\n", sum);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:6: error: no matching function for call to 'sort(int [200], int&)'
12 | sort(L, skw);
| ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIt... |
s548729938 | p04047 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int skw, L[200], sum = 0;
scanf("%d", &skw); //串の本数を取得(串焼きの数はこの半分)
for(int i = 0;i < skw; i++)
scanf("%d", &L[i]); //長さを取得
sort(L, skw);
for(int j = 0; j < skw; j+2)
sum = sum + min(L[j],L[j+1]);
printf("%d\n", sum);
retu... | a.cc: In function 'int main()':
a.cc:12:6: error: no matching function for call to 'sort(int [200], int&)'
12 | sort(L, skw);
| ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIt... |
s566872602 | p04047 | C++ | #include <cstdio>
#include <cmath>
using namespace std;
void selectionSort(int L[], int N){
int minj, t;
for(int i = 0; i < N; i++){
minj = i;
for(int j = i; j < N; j++){
if(L[j] < L[minj])
minj = j;
}
t = L[i];
L[i] = L[minj];
L[minj] = t;
}
}
int main(){
int skw, L[200], sum =... | a.cc: In function 'int main()':
a.cc:32:3: error: 'rerutn' was not declared in this scope
32 | rerutn 0;
| ^~~~~~
|
s423389297 | p04047 | C++ | #include <cstdio>
#include <cmath>
using namespace std;
void selectionSort(int L[], int N){
int minj, t;
for(int i = 0; i < N; i++){
minj = i;
for(int j = i; j < N; j++){
if(L[j] < L[minj])
minj = j;
}
t = L[i];
L[i] = L[minj];
L[minj] = t;
}
}
int main(){
int skw, L[200], sum =... | a.cc: In function 'int main()':
a.cc:32:3: error: 'rerutn' was not declared in this scope
32 | rerutn 0;
| ^~~~~~
|
s769993046 | p04047 | C++ | #include <cstdio>
#include <cmath>
using namespace std;
void selectionSort(int L[], int N){
int minj, t;
for(int i = 0; i < N; i++){
minj = i;
for(int j = i; j < N; j++){
if(L[j] < L[minj])
minj = j;
}
t = L[i];
L[i] = L[minj];
L[minj] = t;
}
}
int main(){
int skw, L[200], sum =... | a.cc: In function 'int main()':
a.cc:32:3: error: 'rerutn' was not declared in this scope
32 | rerutn 0;
| ^~~~~~
|
s526217428 | p04047 | C++ | #include <cstdio>
using namespace std;
int selectionSort(int L[], int N){
int minj, t, sw = 0;
for(int i = 0; i < N; i++){
minj = i;
for(int j = i; j < N; j++){
if(A[j] < A[minj])
minj = j;
}
t = A[i];
A[i] = A[minj];
A[minj] = t;
if(i != minj)
sw++;
}
return sw;
}
int... | a.cc: In function 'int selectionSort(int*, int)':
a.cc:9:10: error: 'A' was not declared in this scope
9 | if(A[j] < A[minj])
| ^
a.cc:12:9: error: 'A' was not declared in this scope
12 | t = A[i];
| ^
a.cc: In function 'int main()':
a.cc:31:17: error: 'min' was not declare... |
s118203438 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int nagasa =sc.nextInt();
int i[]=new int[nagasa]; //要素数
for(int j=0; j<i.length; j++){
i[j]=sc.nextInt();
}
for(int a=0; a< i.length-1; a++) {
for(int b=0; b < i.length-a-1; b++) {
... | Main.java:26: error: ';' expected
int sum +=x;
^
Main.java:26: error: not a statement
int sum +=x;
^
2 errors
|
s582565278 | p04047 | Java | import java.util.*;
class Main{
void main(String[]args){
Scanner sc=new Scanner(System.in);
int nagasa =sc.nextInt();
int i[]=new int[nagasa]; //要素数
for(int j=0; j<i.length; j++){
i[j]=sc.nextInt();
}
Arrays.sort(i,Comparator.reverseOrder());
for(int n=0; n<i.length-1; n++){
int x=i[2*n+1... | Main.java:14: error: no suitable method found for sort(int[],Comparator<T#1>)
Arrays.sort(i,Comparator.reverseOrder());
^
method Arrays.<T#2>sort(T#2[],Comparator<? super T#2>) is not applicable
(inference variable T#2 has incompatible bounds
equality constraints: int
upper bounds: O... |
s773101316 | p04047 | C++ | #include <cstdio>
#include <vector>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> vec;
for(int i=0; i<2*N; ++i) {
int L;
scanf("%d", &L);
vec.push_back(L);
}
sort(vec.begin(), vec.end());
int sum = 0;
for(int i=0; i<N; ++i) {
sum += vec[i*2];
}
printf("%d\n", sum);
return 0;... | a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(vec.begin(), vec.end());
| ^~~~
| short
|
s121155576 | p04047 | C++ | #include <cstdio>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> vec;
for(int i=0; i<2*N; ++i) {
int L;
scanf("%d", &L);
vec.push_back(L);
}
sort(vec.begin(), vec.end());
int sum = 0;
for(int i=0; i<N; ++i) {
sum += vec[i*2];
}
printf("%d\n", sum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
8 | vector<int> vec;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <cstdio>
+++ |+#include <vector>
2... |
s353576285 | p04047 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N ;
vector<int> L;
for (int i = 0; i <2*N; i++) {
int m;
cin >> m;
L.push_back(m);
}
std::sort(L.begin(), L.end());
int Guzai =0;
for(int i = 0; 2*i >2*N; i++){
Guzai += i;
}
cout << Guzai << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
15 | std::sort(L.begin(), L.end());
| ^~~~
| qsort
|
s139992927 | p04047 | Java | import java.util.*;
public class Main_1 {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int n=sc.nextInt();
int kusim[]=new int[2*n];
int ans=0;
for(int i=0;i<2*n;i++){
kusim[i]=sc.nextInt();
}
int turn=kusim.length-1;
for(int j=0;j<turn;j++){
for(int k=0;k<t... | Main.java:2: error: class Main_1 is public, should be declared in a file named Main_1.java
public class Main_1 {
^
1 error
|
s001763386 | p04047 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int64;
int main()
{
int64 N, X;
cin >> N >> X;
int64 Line = (N - 1) * 3;
if(N % X == 0) {
cout << Line - (kyori - 1) * 3 << endl;
} else {
cout << Line << endl;
}
}
| a.cc: In function 'int main()':
a.cc:12:21: error: 'kyori' was not declared in this scope
12 | cout << Line - (kyori - 1) * 3 << endl;
| ^~~~~
|
s386473276 | p04047 | C | #include <stdio.h>
void Qsort(int x[], int left, int right);
void Swap(int x[], int i, int j);
int main(void)
{
int N, L[100], sum = 0;
if (scanf("%d", &N) != 1)return 0;
for (int i = 0; i < 2 * N; i++) {
if (scanf("%d", &L[i]) != 1)return 0;
}
Qsort(L, 0, 2 * N - 1);
for (int i = 0; i < N; i++) {
sum ... | main.c:66:1: error: unterminated comment
66 | /*
| ^
|
s569039486 | p04047 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Stream;
import java.util.Arrays;
public class A {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int N = Inte... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s554265959 | p04047 | C++ | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cs... | a.cc: In function 'int main()':
a.cc:34:64: error: expected initializer before '.' token
34 | auto maxIt = max_element(L.begin(), L.end()), L.erase(maxIt);
| ^
|
s036509157 | p04047 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void main(void) {
int n;
cin >> n;
n *= 2;
vector<int> vec;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
vec.push_back(x);
}
sort(vec.begin(), vec.end());
int sum = 0;
for (int i = 0; i < n; i += 2) {
sum += vec[i];
}
c... | a.cc:5:1: error: '::main' must return 'int'
5 | void main(void) {
| ^~~~
|
s978058453 | p04047 | C++ | #include <stdio.h>
int N = 0;
int L[201];
int main(){
scanf_s("%d", &N);
for (int i = 0; i < 2 * N; i++){
scanf_s("%d", &L[i]);
}
int temp;
for (int i = 0; i < 2 * N; i++){
for (int j = 0; j < 2 * N - 1; j++){
if (L[j] < L[j + 1]){
temp = L[j];
L[j] = L[j + 1];
L[j + 1] = temp;
}
}
}
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s987376016 | p04047 | C | #include <iostream>
#include <cstdio>
using namespace std;
void sort(int *array, int num){
for(int i = 0; i < num - 1; i++){
for(int j = i + 1; j < num; j++){
if(array[i] < array[j]){
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
}
int main(){
int N, result = 0;
int L[200... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s684874332 | p04047 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int kushi = sc.nextInt();
ArrayList<Integer> lengthList = new ArrayList<Integer>();
for (int i = 0, max = kushi * 2; i < max; i++) {
int n = sc.nextInt();
leng... | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:8: erro... |
s283734180 | p04047 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N; cin >> N;
vector< int > A( N * 2 );
for( int i = 0; i < N * 2; ++i )
cin >> A[ i ];
int ans = 0;
sort( A.begin(), A.end() );
for( int i = 0; i < N * 2; i += 2 )
ans += A[ i ];
cout << A[ i ] << "\n";
return... | a.cc: In function 'int main()':
a.cc:13:16: error: 'i' was not declared in this scope
13 | cout << A[ i ] << "\n";
| ^
|
s557671162 | p04047 | Java | import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String args[]){
int N = 0;
int L[] = new int[200];
int ans = 0;
Arrays.fill(L, 1000);
Scanner scan = new Scanner(System.in);
N = scan.next();
for(int i=0;i<2*N;i++){
L[i] = scan.next();
}
Arrays.sort(a);
for(int i=0;i<2*N;i=i... | Main.java:11: error: incompatible types: String cannot be converted to int
N = scan.next();
^
Main.java:13: error: incompatible types: String cannot be converted to int
L[i] = scan.next();
^
Main.java:15: error: cannot find symbol
Arrays.sort(a);
^
symbol: variable a
locat... |
s165797321 | p04047 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
public class A001 {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
Integer[] L2 = new Integer... | Main.java:5: error: class A001 is public, should be declared in a file named A001.java
public class A001 {
^
1 error
|
s523640904 | p04047 | C++ | #include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y... | a.cc:32:11: error: macro "DRII" requires 2 arguments, but only 1 given
32 | DRII(n);
| ^
a.cc:10:9: note: macro "DRII" defined here
10 | #define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
| ^~~~
a.cc: In function 'int main()':
a.cc:32:5: error: 'DRII' was not declared in this sco... |
s903398645 | p04047 | C++ | #include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
using namespace std;
#define... | a.cc:34:29: error: ISO C++ forbids declaration of 'amax' with no type [-fpermissive]
34 | template <class T, class U> amax(T& x, U y) {if (x < y) x = y;}
| ^~~~
a.cc: In function 'int amax(T&, U)':
a.cc:34:63: warning: no return statement in function returning non-void [-Wreturn-typ... |
s727402936 | p04047 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N; cin >> N;
vector<int> L;
for(int i = 0; i < 2*N; i++){
int tmp; cin >> tmp;
L.push_back(tmp);
}
int ans;
sort(L.begin(), L.end());
for(int i = 0; i < 2*N; i += 2){
ans += min(L[i], L[i... | a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(L.begin(), L.end());
| ^~~~
| short
|
s032755417 | p04047 | C++ | N=raw_input()
up=raw_input().split()
up=up.sort()
count=0
for i in range(N):
count+=int(up[i*2])
print count | a.cc:1:1: error: 'N' does not name a type
1 | N=raw_input()
| ^
|
s991078055 | p04047 | C++ | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n * 2];
for (int i = 0; i < n * 2; i++) {
cin >> a[i];
}
sort(a, a + n*2);
int cnt = 0;
for (int i = 0; i < n; i++) {
int x = a[2*i];
int y = a[2*i+1];
if (x > y) {
cnt += y;
} else {
cnt += x;
... | a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(a, a + n*2);
| ^~~~
| short
|
s296988079 | p04047 | C++ | #include<iostream>
#include<vector>
using namespace std;
#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define REP(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ... | a.cc: In function 'int main()':
a.cc:36:5: error: 'sort' was not declared in this scope; did you mean 'short'?
36 | sort(all(li));
| ^~~~
| short
|
s611821148 | p04047 | C++ | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOExcept... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.OutputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmod... |
s923736902 | p04047 | C++ | N = int(raw_input())
L = map(int,raw_input().split())
L.sort(reverse = True)
ans = 0
for i in xrange(N):
ans += min(L[2*i],L[2*i+1])
print ans | a.cc:1:1: error: 'N' does not name a type
1 | N = int(raw_input())
| ^
|
s036461967 | p04047 | C++ | import java.util.Arrays;
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int N = sc.nextInt();
int[] L = new int[2 * N];
for (int i = 0; i < 2 * N; ++i) {
L[i] = sc.nextInt();
}
Arrays.sort(L);
int ans = 0;
for (int... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s202148528 | p04048 | C++ | #include <iostream>
using namespace std;
int main(){
ull N, X;
cin >> N >> X;
cout << N + 3 * X + X / 2;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'ull' was not declared in this scope
5 | ull N, X;
| ^~~
a.cc:6:10: error: 'N' was not declared in this scope
6 | cin >> N >> X;
| ^
a.cc:6:15: error: 'X' was not declared in this scope
6 | cin >> N >> X;
| ^
|
s469387535 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m;
int a[225];
int main(){
cin>>n>>m;
cout<<(6*x);
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'x' was not declared in this scope
7 | cout<<(6*x);
| ^
|
s558333013 | p04048 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <list>
#include <cmath>
#include <queue>
using namespace std;
#define ll long long
void sor(vector<ll> &x)
{
sort(x.begin(), x.end());
}
ll gcd(ll x, ll y)
{
if (y == 0)
{
return x;
}
return gcd(y, x % y);
}
list<ll> a[5];
void bfs(int s... | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
from a.cc:1:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = double; _Nn = double; common_type_t<_Mn, _Nn> = double]':
a.cc:63:38: required from here
... |
s105287260 | p04048 | C++ | n,x = map(int, input().split())
print(3*(n-1)) | a.cc:1:1: error: 'n' does not name a type
1 | n,x = map(int, input().split())
| ^
|
s253302526 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(i,a,n) for(i=a;i<n;i++)
#define in(x) scanf("%lld",&x)
void solve()
{
ll n,x;
in(n);
in(x);
if(n==2*x)
ans=3*x;
else
ans=6*x;
printf("%lld\n",ans);
}
int main()
{
ll t;
// cin>>t;
// while(t--)
s... | a.cc: In function 'void solve()':
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans=3*x;
| ^~~
| abs
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | ans=6*x;
| ^~~
| abs
a.cc... |
s196140877 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fo(i,n) for(int i=0;i<n;i++)
int ;
ll a,b,x,n,ans;
void solve() {
ans=n;
a=x,b=n-x;
while(true){
if(a<b)
swap(a,b);
ans+=((a/b)*2)*b;
if(a%b==0){
... | a.cc:8:1: error: declaration does not declare anything [-fpermissive]
8 | int ;
| ^~~
|
s477984084 | p04048 | C++ | #include <stdio.h>
long long n, x, a, b, c, ans;
int main() {
scanf("%lld%lld", &n, &x);
ans = n;
if (x < n - x) {
a = n - x;
b = x;
}#
else {
a = x;
b = n - x;
}
while (true) {
if (a % b == 0) {
ans += (2 * a / b - 1) * b;
break;
}
else {
ans += 2 * (a / b) * b;
c = a % b;
a = b;
... | a.cc:9:10: error: stray '#' in program
9 | }#
| ^
|
s059811304 | p04048 | C++ | include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;
#define int long long
#define endl "\n"
constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007;
struct fast_io {
fast_io(){
... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type... |
s874114813 | p04048 | C++ | #include <iostream>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin>>n>>k;
int ans=3*(n-__gcd(n,k));
cout<<ans;
return 0;
}
AC | a.cc:15:1: error: 'AC' does not name a type
15 | AC
| ^~
|
s716856390 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
int gcd(int a,in b){
if(a==0)return b;
if(b==0)return a;
if(a>b)
return gcd(a-b,b);
return gcd(a,b-a);
}
int main()
{
long long int a,b;
cin>>a>>b;
long long int ans=0;
ans=3*(a-gcd(a,b));
cout<<ans<<endl;
return 0;
} | a.cc:3:15: error: 'in' has not been declared
3 | int gcd(int a,in b){
| ^~
|
s479146373 | p04048 | C++ | int gcd(int a,in b){
if(a==0)return b;
if(b==0)return a;
if(a>b)
return gcd(a-b,b);
return gcd(a,b-a);
}
int main()
{
long long int a,b;
cin>>a>>b;
long long int ans=0;
ans=3*(a-gcd(a,b));
cout<<ans<<endl;
return 0;
}
| a.cc:1:15: error: 'in' has not been declared
1 | int gcd(int a,in b){
| ^~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
12 | cin>>a>>b;
| ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
15 | cout<<ans<<endl;
| ^~~~
a... |
s563665007 | p04048 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
// cout<<"Hello World!";
ll n,x;
cin>>n>>x;
cout<<n*x+x;
}
| a.cc: In function 'int main()':
a.cc:5:4: error: 'll' was not declared in this scope
5 | ll n,x;
| ^~
a.cc:6:9: error: 'n' was not declared in this scope; did you mean 'yn'?
6 | cin>>n>>x;
| ^
| yn
a.cc:6:12: error: 'x' was not declared in this scope
6 | cin>>n>... |
s518292659 | p04048 | C++ | #include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b)... | a.cc:18:5: error: expected unqualified-id before 'return'
18 | } return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s324132687 | p04048 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll ... | a.cc: In function 'int main()':
a.cc:50:14: error: 'gcd' was not declared in this scope
50 | cout<<3*(N-gcd(N,X))<<endl;
| ^~~
|
s993701018 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
std:
ios_base::sync_with_stdio(0);
cin.tie(0);
int N,X;
cin>>N>>X;
cout<<3(N-__gcd(N,X))<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:10: error: expression cannot be used as a function
15 | cout<<3(N-__gcd(N,X))<<endl;
| ~^~~~~~~~~~~~~~
|
s846698970 | p04048 | C++ | #include <iostream>
using namespace std;
long long n, x, ans;
long long cel(long long n, long long x) {
if(n % x == 0)
return 2 * n - x;
ans = n / x * 2 * x + cel(x, n % x);
return ans ;
}
int main()
{
while(cin >> n >> x) {
ans = n + cel(n - x, x);
cout << ans << endl;
}
}
| a.cc:6:1: error: extended character is not valid in an identifier
6 | if(n % x == 0)
| ^
a.cc:6:3: error: extended character is not valid in an identifier
6 | if(n % x == 0)
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 | return 2 * n - x;
... |
s199595443 | p04048 | C++ | п | a.cc:1:1: error: '\U0000043f' does not name a type
1 | п
| ^
|
s964136884 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll gcd(ll n,ll x){
if(!(n%x)) return n*2-x;
return n/x*x*2+gcd(x,n%x);
}
int main(){
cin>>n>>x;
cout<<gcd(n-x,x)+n<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:10: error: 'n' was not declared in this scope; did you mean 'yn'?
9 | cin>>n>>x;
| ^
| yn
a.cc:9:13: error: 'x' was not declared in this scope
9 | cin>>n>>x;
| ^
|
s140376227 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
ll gcd(ll n,ll x){
if(!(n%x)) return n*2-x;
return n/x*x*2+gcd(x,n%x);
}
int main(){
cin>>n>>x;
cout<<gcd(n-x,x)+n<<endl;
return 0;
} | a.cc:3:1: error: 'll' does not name a type
3 | ll gcd(ll n,ll x){
| ^~
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
8 | cin>>n>>x;
| ^
| yn
a.cc:8:13: error: 'x' was not declared in this scope
8 | cin>>n>... |
s853519552 | p04048 | C++ | #include <iostream>
using namespace std;
long long int n, x;
int main(){
cin>>n>>x;
cout<<n+((7*x)/2)
}
| a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '}' token
8 | cout<<n+((7*x)/2)
| ^
| ;
9 | }
| ~
|
s789260691 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
int sum(a,b){
if(a==b){
return sum(a,b) + a;
}
if(a>b){
return sum(a-b,b) + 2*b;
}
if(a<b){
return sum(a,b-a) + 2*a;
}
}
int main(){
int n,x;
cin >> n >> x;
cout << sum(x,n-x)+n << endl;
}
| a.cc:4:9: error: 'a' was not declared in this scope
4 | int sum(a,b){
| ^
a.cc:4:11: error: 'b' was not declared in this scope
4 | int sum(a,b){
| ^
a.cc:4:12: error: expression list treated as compound expression in initializer [-fpermissive]
4 | int sum(a,b){
| ... |
s307292046 | p04048 | C++ | #include<stdio.h>
#include<iostream>
int main(){
long long N,X;
cin>>N>>X;
cout<<(N-X)*X*X;
} | a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin>>N>>X;
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard... |
s936347153 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=(n)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
typedef long long ll;
typedef vec... | a.cc: In function 'll sol(ll, ll)':
a.cc:21:31: error: expected ';' before 'll'
21 | if(a%b==0)return b*(2*b-1)
| ^
| ;
22 |
23 | ll t;
| ~~
|
s964429091 | p04048 | C | #include<stdio.h>
int main (){
long long N=2,X=1,sum=0,y=0;
scanf("%lld %lld",&N,&X);
if(N-X<1){
X=N-1;
}
sum=N;
if(N>=2*X){
if(N==2*X){
sum=X*3;
}else
y=X/(N-X);
sum=(y+1)*y
}
else{
}
printf("%lld\n",sum);
return 0;
} | main.c: In function 'main':
main.c:20:16: error: expected ';' before '}' token
20 | sum=(y+1)*y
| ^
| ;
21 | }
| ~
|
s121507402 | p04048 | C | #include<stdio.h>
int main (){
long long N=2,X=1,sum=0,y=0;
scanf("%lld %lld",&N,&X);
if(N-X<1){
X=N-1;
}
sum=N;
if(N>2X){
sum+=X*2;
y+=N-2*X;
sum+=(X/y+1)*y;
}
else{
y+=X/(N-X);
sum+=(y+1)*(N-X);
}
printf("%lld\n",sum);
return 0;
} | main.c: In function 'main':
main.c:15:8: error: invalid suffix "X" on integer constant
15 | if(N>2X){
| ^~
|
s300129873 | p04048 | C | #include<stdio.h>
int main (){
long long N=2,X=1,sum=0,y=0;
scanf("%lld %lld",&N,&X);
if(N-x>1){
X=N-1;
}
sum=N;
if(N/2>X){
sum+=X*2;
y+=N-2*X;
sum+=(X/y+1)*y;
}
else{
y+=X/(N-X);
sum+=(y+1)*(N-X);
}
printf("%lld\n",sum);
return 0;
} | main.c: In function 'main':
main.c:9:8: error: 'x' undeclared (first use in this function)
9 | if(N-x>1){
| ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
|
s531344144 | p04048 | C++ | #include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prn... | a.cc: In function 'int main()':
a.cc:37:35: error: 'bz' was not declared in this scope; did you mean 'b'?
37 | if(c == 0) ans -= bz;
| ^~
| b
|
s260316989 | p04048 | C++ | #include "ccc.hpp"
// http://drken1215.hatenablog.com/entry/2019/03/15/205900
// など
ll calc(ll a, ll b) {
if (a < b) swap(a, b);
if (b == 0) return -a; // 最後2 * b * (q - 1) + bとしたい
ll q = a / b;
ll ret = 2 * b * q;
ret += calc(b, a % b);
return ret;
}
int main() {
ll n, x; cin >> n >> x;
... | a.cc:1:10: fatal error: ccc.hpp: No such file or directory
1 | #include "ccc.hpp"
| ^~~~~~~~~
compilation terminated.
|
s740772027 | p04048 | C++ | #pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#ifndef rd
#define endl '\n'
//#endif
#... | a.cc: In function 'void solve()':
a.cc:66:21: error: unable to find numeric literal operator 'operator""x'
66 | cout << ((n-2x) * (n-x) + (n + 2*x));
| ^~
|
s775044601 | p04048 | C++ | #pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#ifndef rd
#define endl '\n'
//#endif
#... | a.cc: In function 'void solve()':
a.cc:66:21: error: unable to find numeric literal operator 'operator""x'
66 | cout << ((n-2x) * (n-x) + (n + 2x));
| ^~
a.cc:66:40: error: unable to find numeric literal operator 'operator""x'
66 | cout << ((n-2x) * (n-x) + (n + 2x));
... |
s116036387 | p04048 | C++ | #pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#ifndef rd
#define endl '\n'
//#endif
#... | a.cc: In function 'void solve()':
a.cc:66:20: error: unable to find numeric literal operator 'operator""x'
66 | cout << (n-2x) * (n-x) + (n + 2x);
| ^~
a.cc:66:39: error: unable to find numeric literal operator 'operator""x'
66 | cout << (n-2x) * (n-x) + (n + 2x);
| ... |
s263221544 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int lcm(int a... | a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:24:9: error: redeclaration of 'long long int d'
24 | int c,d=1;
| ^
a.cc:21:7: note: 'long long int d' previously declared here
21 | int d=a,e=b;
| ^
a.cc:36:14: error: 'f' was not declared in this scope
36 ... |
s902424019 | p04048 | Java | import java.util.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
long n = scanner.nextLong();
long x = scanner.nextLong();
long y = n - x;
long ans = n;
while (x != 0 && y != 0) {
Utils.println(x, ... | Main.java:12: error: cannot find symbol
Utils.println(x, y, ans);
^
symbol: variable Utils
location: class Main
1 error
|
s713480602 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
int para(int a,int b){
else if(a%b==0)return b*(a/b*2-1);
else return 2*b+para(b,a%b);
}
signed main(){
int n,x;cin>>n>>x;
int ret=0;
ret=n+para(max(x,n-x),min(x,n-x));
cout<<ret<<endl;
}
| a.cc: In function 'long long int para(long long int, long long int)':
a.cc:7:9: error: 'else' without a previous 'if'
7 | else if(a%b==0)return b*(a/b*2-1);
| ^~~~
|
s699317087 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
int para(int a,int b){
int ret=0;
if(a%b==0)return 2*a-b;
else return para(a/b*b,b)+para(b,a%b);
}
signed main(){
int n,x;cin>>n>>x;
int ret=0
ret=n+para(max(x,n-x),min(x,n-x));
cout<<ret<<endl;
}
| a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'ret'
16 | ret=n+para(max(x,n-x),min(x,n-x));
| ^~~
|
s444312290 | p04048 | C | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
long long getgcd(long long N,long long X);
int main(void){
long long N,X;
long long buf;
long long buf2
long long cur;
scanf("%lld %lld",&N,&X);
buf=getgcd(N,X);
buf2=N-buf;
printf("%lld\n",3*buf2);
}
long lo... | main.c: In function 'main':
main.c:11:19: error: expected ';' before 'long'
11 | long long buf2
| ^
| ;
12 | long long cur;
| ~~~~
main.c:15:5: error: 'buf2' undeclared (first use in this function); did you mean 'buf'?
15 | buf2=N... |
s511610451 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define reps(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reps(i,0,n)
#define all(x) (x).begin(),(x).end()
#define INF (1000000010)
#define MOD (1000000007)
#define PI (acos(-1))
#define int ll
int ans;
void rec(int x,int y){
if(y%x==0){
... | a.cc:11:13: error: '::main' must return 'int'
11 | #define int ll
| ^~
a.cc:23:1: note: in expansion of macro 'int'
23 | int main(){
| ^~~
|
s642038954 | p04048 | C++ | #include<iostream>
using namespace std;
int main(){
int gcd(int a,int b){
if(a%b==0) return(b);
else return(gcd(b,a%b));
}
int N,K;
cin>>N>>K;
cout<<((N%gcd(N,K))*3-3)*gcd(N,K)<<endl;
} | a.cc: In function 'int main()':
a.cc:5:23: error: a function-definition is not allowed here before '{' token
5 | int gcd(int a,int b){
| ^
a.cc:12:13: error: 'gcd' was not declared in this scope
12 | cout<<((N%gcd(N,K))*3-3)*gcd(N,K)<<endl;
| ^~~
|
s891640031 | p04048 | C++ | #include <bits/stdc++.h>
using namespace syd;
typedef long long ll;
int main(){
ll n,x;
cin >> n >> x;
ll ans = 0;
ans = 3*(n-1);
cout << ans << endl;
}
| a.cc:2:17: error: 'syd' is not a namespace-name
2 | using namespace syd;
| ^~~
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 >> x;
| ^~~
| std::cin
In file included from /usr/include/x86_64-lin... |
s920845453 | p04048 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int N, X;
cin >> N >> X;
int ans = N;
int a = max(N - X, X);
int b = min(N - X, X);
int q;
while(b)
{
q = a % b;
ans += (a - q) * 2;
a = b;
b = q;
}
ans -= a;
cout << ans << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:23:18: error: expected '}' at end of input
23 | return 0;
| ^
a.cc:7:1: note: to match this '{'
7 | {
| ^
|
s402334230 | p04048 | C | #include<stdio.h>
long gcd2(long a, long b){
long t;
if(a<b){
t = a;
a = b;
b = t;
}
r = a % b;
while(r!=0){
a = b;
b = r;
r = a % b;
}
return b;
}
int n, x;
int main(void){
scanf("%ld%ld");
printf("%ld\n", (n-*gcd2(n,x))*3);
}
| main.c: In function 'gcd2':
main.c:9:9: error: 'r' undeclared (first use in this function)
9 | r = a % b;
| ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:20:22: error: invalid type argument of unary '*' (... |
s713734130 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
long long int gcm(long long a,long long b){
long long r,tmp;
if(a<b){
tmp=a;
a=b;
b=tmp;
}
r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
return b;
}
int main(){
long long N,X,ans;
cin >> N >> X;
if(X>N/2)X=N-X;
long long g=gcm(N,X);
N/=g;X/=g;
ans=... | a.cc: In function 'int main()':
a.cc:30:16: error: expected primary-expression before '%' token
30 | if(N-X)%X>0)ans+=3*X;
| ^
|
s631613929 | p04048 | C++ | #include<algorithm>
#include<iostream>
using namespace std;
long test(long nokori, long now, long sum){
long count_node,tmp = 0;
if(nokori % now != 0){
count_node = nokori / now;
count_node = count_node * 2;
sum = sum + now * count_node;
t... | a.cc:37:2: error: expected class-name at end of input
37 | ~
| ^
|
s546431374 | p04048 | C++ | /*
, \ / ,
/ \ )\__/( / \
/ \ (_\ /_) / \
____/_____\__\@ @/___/_____\____
| |\../| |
| \VV/ |
| ------hoi------- |
|_________________________________|
| /\ / \\ \ /\ ... | a.cc: In function 'long long int rec(long long int, long long int)':
a.cc:43:41: error: expected ';' before '}' token
43 | return rec(b % a, a) + b / a * a * 2
| ^
| ;
44 | }
| ~ ... |
s122994048 | p04048 | C++ | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pf push_front
#define pbp pop_back
#define pfp pop_front
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
#define ios_base ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define open(x) freopen(x".in","r",stdin),freopen(x".out"... | a.cc: In function 'int main()':
a.cc:41:18: error: expected '}' at end of input
41 | cout << ans + n;
| ^
a.cc:38:12: note: to match this '{'
38 | int main (){
| ^
|
s398712140 | p04048 | C++ | value = input()
values = value.split()
N = int( values[0] )
X = int( values[1] )
shorter = min([X,N-X])
longer = max([X,N-X])
length = 0
while shorter>0 and longer >0 :
length = int(longer/shorter)*3*shorter
sho = longer/shorter
amari = longer%shorter
longer = shorter
sho... | a.cc:1:1: error: 'value' does not name a type
1 | value = input()
| ^~~~~
|
s378488676 | p04048 | C++ | value = input()
values = value.split()
value = input()
values = value.split()
N = int( values[0] )
X = int( values[1] )
shorter = min([X,N-X])
longer = max([X,N-X])
length = 0
while shorter>0 and longer >0 :
length = int(longer/shorter)*3*shorter
sho = longer/shorter
amari =... | a.cc:1:1: error: 'value' does not name a type
1 | value = input()
| ^~~~~
|
s786017996 | p04048 | C++ | #include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++)
#define revrep(i,n) for(int (i)=(n)-1;i>=0; i--)
ll f(ll a, ll b) {
a=min(a,b);
b = max(a,b);
if(a==b)
return a;
// r... | a.cc: In function 'long long int f(long long int, long long int)':
a.cc:15:6: error: 'bb' was not declared in this scope; did you mean 'b'?
15 | if(bb%aa!=0)
| ^~
| b
a.cc:15:9: error: 'aa' was not declared in this scope; did you mean 'a'?
15 | if(bb%aa!=0)
| ^~
| ... |
s882687807 | p04048 | C++ | n,x=map(int,input().split())
print(x+(n-x)+x+x+(n/2)*3) | a.cc:1:1: error: 'n' does not name a type
1 | n,x=map(int,input().split())
| ^
|
s408503815 | p04048 | C++ | /****Author: Barish Namazov****/
#include <bits/stdc++.h>
using namespace std;
/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define endl '\n'
const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000... | a.cc: In function 'int main()':
a.cc:67:31: error: 'x' was not declared in this scope
67 | cout << 2 * (n - 1) + 2 * x << endl;
| ^
|
s861972918 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std ;
int main()
{
long long n , x ;
cin>>n>>x ;
return cout<<3ll * (n - __gcd(n , x) , 0 ;
}
| a.cc: In function 'int main()':
a.cc:9:45: error: expected ')' before ';' token
9 | return cout<<3ll * (n - __gcd(n , x) , 0 ;
| ~ ^~
| )
a.cc:9:16: error: cannot convert 'std::basic_ostream<char>::__ostream_type' ... |
s228360699 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
#define LINE 8
#define st 1
#define YOKO 17
int main(){
long long N,X;
cin>>N>>x;
if(X==N/2){
cout<<3*X;
}else if(X>=N/2){
cout<<3/2*X+N;
}else{
cout<<(X+N)*X/(N-X)+N;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:13: error: 'x' was not declared in this scope
8 | cin>>N>>x;
| ^
|
s055189047 | p04048 | C++ | #include <iostream>
using namespace std;
using llong = long long;
llong length(llong K,llong X,llong L){
return (K==X)?(K:((K<X)?length(K,X-K,L+2*K):length(K-X,X,L+2*X)));
// if( K == X ){
// return K;
// }else if( K < X ){
// return 2*K + length( K , X - K );
// }else{
// return 2*X + length( K -... | a.cc: In function 'llong length(llong, llong, llong)':
a.cc:7:19: error: expected ')' before ':' token
7 | return (K==X)?(K:((K<X)?length(K,X-K,L+2*K):length(K-X,X,L+2*X)));
| ~ ^
| )
a.cc:7:68: error: expected ':' before ';' token
7 | return (K==X)?(K:((K<X)?le... |
s840543005 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,x;
cin>>n>>x;
long long t=x,sum=n;
x=min(t,n-t);
long long y=max(t,n-t);
while(x>=1)
{
if(y%x==0)
{
sum+=(y/x)*2*x;
sum-=x;
b... | a.cc: In function 'int main()':
a.cc:21:16: error: 'LL' was not declared in this scope
21 | LL te=x;
| ^~
a.cc:23:18: error: 'te' was not declared in this scope; did you mean 't'?
23 | y=te;
| ^~
| t
|
s054355093 | p04048 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n, x;
cin>>x>>y;
long long ans=4*x+4*(n-2*x);
cout<<-1*ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'y' was not declared in this scope
5 | cin>>x>>y;
| ^
|
s301746569 | p04048 | C++ | #include <bits/stdc++.h>
using namespace std;
lint N, X;
int main()
{
cin >> N >> X;
lint gcd = __gcd(N, X);
cout << gcd * (N / gcd - 1) * 3 << endl;
}
| a.cc:4:1: error: 'lint' does not name a type; did you mean 'uint'?
4 | lint N, X;
| ^~~~
| uint
a.cc: In function 'int main()':
a.cc:8:12: error: 'N' was not declared in this scope
8 | cin >> N >> X;
| ^
a.cc:8:17: error: 'X' was not declared in this scope
8 | cin >> N >... |
s110857030 | p04048 | C++ |
#include <stdio.h>
int main()
{
int N, X;
scanf("%d", &N);
scanf("%d", &X);
if(N % 2 == 0) {
//even
int n = N / 2;
printf("%d", 3 * n + abs(X - n) * 3);
} else {
//odd;
int n = N / 2;
printf("%d", n * 6);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:30: error: 'abs' was not declared in this scope
13 | printf("%d", 3 * n + abs(X - n) * 3);
| ^~~
|
s421847077 | p04048 | C | #include<stdio.h>
int gcd(int n, int x){
int z=1;
for(int i=1;i<x+1;i++){
if(((n%i)==0)&&((x%i)==0)) z=i;
return z;
}
int main(void){
int n, x;
scanf("%d%d", &n, &x); //三角形の辺の長さと始点の入力
int leng;
leng = 3*(n-gcd(n, x));
printf("%d\n", leng);
return 0;
}
| main.c: In function 'gcd':
main.c:16:1: error: expected declaration or statement at end of input
16 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.