submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s274050448 | p01227 | Java | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class Main{
static final InputStream in=System.in;
static final PrintWr... | Main.java:15: error: cannot find symbol
int t=ir.nextInt();
^
symbol: variable ir
location: class Main
Main.java:17: error: cannot find symbol
int n=ir.nextInt();
^
symbol: variable ir
location: class Main
Main.java:18: error: cannot find symbol
int k=ir.nextInt();
^
... |
s514362620 | p01227 | Java | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class CountryRoad{
static final InputReader ir;
static final PrintWrite... | Main.java:9: error: class CountryRoad is public, should be declared in a file named CountryRoad.java
public class CountryRoad{
^
Main.java:32: error: cannot assign a value to static final variable ir
ir = new InputReader(System.in);
^
Main.java:33: error: cannot assign a value to static final variable out
... |
s873022677 | p01227 | Java | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class CountryRoad{
static InputReader ir;
static PrintWriter out;
... | Main.java:9: error: class CountryRoad is public, should be declared in a file named CountryRoad.java
public class CountryRoad{
^
1 error
|
s615244760 | p01227 | C | #include<stdio.h>
#include<stdlib.h>
int comp(const void* a, const void* b);
int main() {
int t;
int* x;
int n, k;
int i, j;
int* ans;
int* bou;
scanf_s("%d", &t);
ans = (int*)malloc(t * sizeof(int));
for (i = 0; i < t; i++) {
ans[i] = 0;
scanf_s("%d%d", &n, &k);
x = (int*)malloc(n * sizeof(int));
bo... | main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
13 | scanf_s("%d", &t);
| ^~~~~~~
| scanf
|
s798275189 | p01227 | C | n,k,i,y;d[' '];c(int*z){i=*1[&z]-*z;}main(x){for(scanf("%*d");~scanf("%d%d%d",&n,&k,&y);printf("%u\n",s)){for(i=--n;i;y=x)scanf("%d",&x),d[--i]=x-y;qsort(d,n,4,c);for(s=0;n>=k;s+=d[--n]);}} | main.c:1:1: warning: data definition has no type or storage class
1 | n,k,i,y;d[' '];c(int*z){i=*1[&z]-*z;}main(x){for(scanf("%*d");~scanf("%d%d%d",&n,&k,&y);printf("%u\n",s)){for(i=--n;i;y=x)scanf("%d",&x),d[--i]=x-y;qsort(d,n,4,c);for(s=0;n>=k;s+=d[--n]);}}
| ^
main.c:1:1: error: type defaults to 'int' in... |
s254123155 | p01227 | C | int d1,d2;
int i,j,t,l;
int sam,sa[100000];
scanf("%d",&g);
for(l=0;l<g;l++){
sam=0;
scanf("%d %d",&n,&k);
for(j=0;j<n;j++){
scanf("%d",&d2);
if(j==0)d1=d2;
else{
sa[j-1]=d2-d1;
sam+=d2-d1;
d1=d2;
}
}
for(i=0;i<n;i++){
for(j=1;j+i<n;j++){
if(sa[j]>sa[... | main.c:4:9: error: expected declaration specifiers or '...' before string constant
4 | scanf("%d",&g);
| ^~~~
main.c:4:14: error: expected declaration specifiers or '...' before '&' token
4 | scanf("%d",&g);
| ^
main.c:5:3: error: expected identifier or '(' before 'for'
... |
s795582234 | p01227 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int x[1000000];
int distance[1000000];
int main() {
int all_length;
cin >> n >> k;
for (int i=0; i<n; ++i) {
cin >> x[i];
}
if (n==1) {
cout << 0;
}
else {
all_length = x[n-1] - x[0];
for (int i=0; i<n-1; ++i) {
distance... | a.cc: In function 'int main()':
a.cc:10:10: error: 'n' was not declared in this scope
10 | cin >> n >> k;
| ^
a.cc:10:15: error: 'k' was not declared in this scope
10 | cin >> n >> k;
| ^
a.cc:20:7: error: reference to 'distance' is ambiguous
20 | distance[i] = x[i+... |
s726054232 | p01227 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
int T, N, K, X[100000 + 10], A[100000 + 10];
using namespace std;
int main()
{
cin >> T;
for (int t = 0; t < T; ++t)
{
cin >> N;
cin >> K;
for (int i = 0; i < N; ++i)
cin >> X[i];
int end;
for (in... | a.cc: In function 'int main()':
a.cc:22:22: error: 'i' was not declared in this scope
22 | sort(A[0], A[i + 1]);
| ^
a.cc:26:33: error: 'n' was not declared in this scope
26 | for (int i = 0; i < n - k; i++)
| ^
a.cc:26:37: error... |
s503894520 | p01227 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=0;i<t;i++){
int n,k;
cin >> n >> k;
vector<int> a(n)
for(int j=0;j<n;j++){
cin >> a.at(j);
}
sort(a.bigin(),a.end());
int c=n-k-1
for(int k=0;k<c;k++){
sum+=a.at(k)
cout << sum << endl;
... | a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
11 | for(int j=0;j<n;j++){
| ^~~
a.cc:11:17: error: 'j' was not declared in this scope
11 | for(int j=0;j<n;j++){
| ^
a.cc:14:12: error: 'class std::vector<int>' has no member named 'bigin'; ... |
s290011673 | p01227 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=0;i<t;i++){
int n,k;
cin >> n >> k;
vector<int> a(n)
for(int j=0;j<n;j++){
cin >> a.at(j);
}
sort(a.begin(),a.end());
int c=n-k-1
for(int k=0;k<c;k++){
sum+=a.at(k);
cout << sum << endl;... | a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
11 | for(int j=0;j<n;j++){
| ^~~
a.cc:11:17: error: 'j' was not declared in this scope
11 | for(int j=0;j<n;j++){
| ^
a.cc:16:7: error: expected ',' or ';' before 'for'
16 | for(int ... |
s711887677 | p01227 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=0;i<t;i++){
int n,k;
cin >> n >> k;
vector<int> a(n);
for(int j=0;j<n;j++){
cin >> a.at(j);
}
sort(a.begin(),a.end());
int c=n-k-1
for(int k=0;k<c;k++){
sum+=a.at(k);
cout << sum << endl... | a.cc: In function 'int main()':
a.cc:16:7: error: expected ',' or ';' before 'for'
16 | for(int k=0;k<c;k++){
| ^~~
a.cc:16:26: error: expected ';' before ')' token
16 | for(int k=0;k<c;k++){
| ^
| ;
|
s434178182 | p01227 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=0;i<t;i++){
int n,k;
cin >> n >> k;
vector<int> a(n);
for(int j=0;j<n;j++){
cin >> a.at(j);
}
sort(a.begin(),a.end());
int c=n-k-1;
for(int k=0;k<c;k++){
sum+=a.at(k);
cout << sum << end... | a.cc: In function 'int main()':
a.cc:17:9: error: 'sum' was not declared in this scope
17 | sum+=a.at(k);
| ^~~
|
s071476533 | p01227 | C++ | #include<bits/stdc++.h>
int t, n, k;
int x[100010];
int d[100010];
int main(){
cin >> t;
while(t){
t--;
cin >> n >> k;
for(int i=0;i<n;i++){
cin << x[i];
}
int ans = x[n-1] - x[n];
for(int i=1;i<n;i++){
d[i-1] = x[i] - x[i-1];
}
sort(d,d+n-1);
if(n>=k){
ans = 0;
}else{
for(int i=0... | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> t;
| ^~~
| 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:... |
s583993778 | p01227 | C++ | #include<bits/stdc++.h>
int t, n, k;
int x[100010];
int d[100010];
int main(){
cin >> t;
while(t){
t--;
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> x[i];
}
int ans = x[n-1] - x[n];
for(int i=1;i<n;i++){
d[i-1] = x[i] - x[i-1];
}
sort(d,d+n-1);
if(n>=k){
ans = 0;
}else{
for(int i=... | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> t;
| ^~~
| 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:... |
s235150336 | p01227 | C++ | #include <iostream>
#include <algorithm>
int t, n, k;
int x[100010];
int d[100010];
int main(){
cin >> t;
while(t){
t--;
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> x[i];
}
int ans = x[n-1] - x[n];
for(int i=1;i<n;i++){
d[i-1] = x[i] - x[i-1];
}
sort(d,d+n-1);
if(n>=k){
ans = 0;
}else{... | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> t;
| ^~~
| 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 ... |
s405863620 | p01227 | C++ | #include <iostream>
#include <algorithm>
int t, n, k;
int x[100010];
int d[100010];
int main(){
cin >> t;
while(t){
t--;
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> x[i];
}
int ans = x[n-1] - x[n];
for(int i=1;i<n;i++){
d[i-1] = x[i] - x[i-1];
}
sort(d,d+n-1);
if(n>=k){
ans = 0;
}else{... | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> t;
| ^~~
| 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 ... |
s640765717 | p01227 | C++ | #include <iostream>
#include <vector>
using namespace std;
int t, N, K, num;
const int max1 = (10e+5) + 1;
vector<int> h(max1), range(max1);
int ans;
int main() {
cin >> t ;
for(int p = 0; p < t; p++) {
cin >> N >> K;
for(int i = 0; i < max1; i++) {
h.at(i) = 0;
}
for(int i = 0; i < N; i++)... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(range.begin(),range.end());
| ^~~~
| short
a.cc:25:9: error: 'reverse' was not declared in this scope
25 | reverse(range.begin(),range.end());
| ^~... |
s316906228 | p01227 | C++ | #include <iostream>
#include <vector>
using namespace std;
int t, N, K, num;
const int max1 = (10e+5) + 1;
vector<int> h(max1), range(max1);
int ans;
int main() {
cin >> t ;
for(int p = 0; p < t; p++) {
cin >> N >> K;
for(int i = 0; i < max1; i++) {
h.at(i) = 0;
}
for(int i = 0; i < N; i++)... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(range.begin(),range.end());
| ^~~~
| short
a.cc:25:9: error: 'reverse' was not declared in this scope
25 | reverse(range.begin(),range.end());
| ^~... |
s438526998 | p01227 | C++ | #include <iostream>
#include <vector>
using namespace std;
int t, N, K, num;
const int max1 = (10e+5) + 1;
vector<int> h(max1), range(max1);
int ans;
int main() {
cin >> t ;
for(int p = 0; p < t; p++) {
cin >> N >> K;
for(int i = 0; i < max1; i++) {
h.at(i) = 0;
}
for(int i = 0; i < N; i++)... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(range.begin(),range.end());
| ^~~~
| short
a.cc:25:9: error: 'reverse' was not declared in this scope
25 | reverse(range.begin(),range.end());
| ^~... |
s238896103 | p01227 | C++ | #include <iostream>
#include <vector>
using namespace std;
int t, N, K, num;
const int max1 = (10e+5) + 1;
vector<int> h(max1), range(max1);
int ans;
int main() {
cin >> t ;
for(int p = 0; p < t; p++) {
cin >> N >> K;
for(int i = 0; i < max1; i++) {
h.at(i) = 0;
}
for(int i = 0; i < N; i++)... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(range.begin(),range.end());
| ^~~~
| short
a.cc:25:5: error: 'reverse' was not declared in this scope
25 | reverse(range.begin(),range.end());
| ^~~~~~~
|
s877938352 | p01227 | C++ | #include <iostream>
#include <vector>
using namespace std;
int t, N, K, num;
const int max1 = (10e+5) + 1;
vector<int> h(max1), range(max1);
int ans;
int main() {
cin >> t ;
for(int p = 0; p < t; p++) {
cin >> N >> K;
for(int i = 0; i < max1; i++) {
h.at(i) = 0;
range.at(i) = 0;
}
for... | a.cc: In function 'int main()':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(range.begin(),range.end());
| ^~~~
| short
a.cc:26:5: error: 'reverse' was not declared in this scope
26 | reverse(range.begin(),range.end());
| ^~~~~~~
|
s480925505 | p01227 | C++ | #include<iostream>
#include<vector>
using std::cout;
using std::cin;
using std::vector;
using std::sort;
#define INF 999999999;
long long int T, N, K;
vector<long long int> X, dis;
long long int ans;
int main(void){
cin.tie(0);
std::ios::sync_with_stdio(false);
cin >> T;
for(int i = 0; i < T; i++){
cin >> N... | a.cc:7:12: error: 'sort' has not been declared in 'std'
7 | using std::sort;
| ^~~~
a.cc: In function 'int main()':
a.cc:33:17: error: 'sort' was not declared in this scope; did you mean 'short'?
33 | sort(dis.begin(), dis.end(), [](int a, int b){return a > b;});
| ... |
s090246147 | p01227 | C++ | /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
| |
s168728067 | p01227 | C++ | #include <algorithm>
#include <iostream>
#include <string>
#include <utility>
using namespace std;
int kusa;
int ki;
int ushi;
int uma;
long int yagi[100010];
long int shika[100010];
int kaba;
int i;
int j;
int kame;
int main(){
cin>>kusa;
for(int ki;ki<kusa;ki++){
cin>>ushi;
cin>>uma;
uma=uma-1;
for(int ... | a.cc: In function 'int main()':
a.cc:48:4: error: expected '}' at end of input
48 | }
| ^
a.cc:18:11: note: to match this '{'
18 | int main(){
| ^
|
s737861020 | p01227 | C++ | #include <algorithm>
#include <iostream>
#include <string>
#include <utility>
using namespace std;
int kusa;
int ki;
int ushi;
int uma;
long int yagi[100010];
long int shika[100010];
int kaba;
int i;
int j;
int kame;
int main(){
cin>>kusa;
for(int ki;ki<kusa;ki++){
cin>>ushi;
cin>>uma;
uma=uma-1;
for(int ... | a.cc: In function 'int main()':
a.cc:48:4: error: expected '}' at end of input
48 | }
| ^
a.cc:18:11: note: to match this '{'
18 | int main(){
| ^
|
s571896885 | p01227 | C++ | #include <iostream>
using namespace std;
int t, n, k;
int a[100000];
int main(){
cin >> t;
for(int i=0; i<t; i++){
cin >> n >> k;
for(int j=0; j<n; j++){
cin >> a[j];
}
int b[100000];
for(int l=0; l<n-1; l++){
b[l]=a[l+1]-a[l];
}
sort(b, b+n-1);
int sum=0;
... | a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(b, b+n-1);
| ^~~~
| short
|
s566401529 | p01227 | C++ | #include <iostream>
using namespace std;
int t, n, k;
int a[100000];
int main(){
cin >> t;
for(int i=0; i<t; i++){
cin >> n >> k;
for(int j=0; j<n; j++){
cin >> a[j];
}
int b[100000];
for(int l=0; l<n-1; l++){
b[l]=a[l+1]-a[l];
}
sort(b, b+n-1);
int sum=0;
... | a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(b, b+n-1);
| ^~~~
| short
|
s783480529 | p01227 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(){
int Ad = 0;
int Hs = 0;
int Ds = 0;
int* Hp;
int* C;
int Sc = 0;
cin >> Ad;
for (int eD = 0; eD < Ad; ++ed){
cin >> Hs;
cin >> Ds;
Hp = new int[Hs];
for (int i = 0; i < Hs; ++i... | a.cc: In function 'int main()':
a.cc:16:33: error: 'ed' was not declared in this scope; did you mean 'eD'?
16 | for (int eD = 0; eD < Ad; ++ed){
| ^~
| eD
a.cc:33:27: error: 'Hn' was not declared in this scope; did you mean 'Hp'?
33 |... |
s975680110 | p01227 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(){
int Ad = 0;
int Hs = 0;
int Ds = 0;
int* Hp;
int* C;
int Sc = 0;
cin >> Ad;
for (int eD = 0; eD < Ad; ++eD){
cin >> Hs;
cin >> Ds;
Hp = new int[Hs];
for (int i = 0; i < Hs; ++i... | a.cc: In function 'int main()':
a.cc:33:27: error: 'Hn' was not declared in this scope; did you mean 'Hp'?
33 | Sc = Hp[Hs - 1] - Hn[0];
| ^~
| Hp
|
s800723275 | p01227 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <string>
using namespace std;
int main(){
int t;
cin >> t;
for(int i = 0; i < t; i++){
int n, k;
cin >> n >> k;
if(n <= k){
cout << 0 << endl;
for(int j = 0; j < n; j++){
cin >> x[j];
}
}el... | a.cc: In function 'int main()':
a.cc:21:40: error: 'x' was not declared in this scope
21 | cin >> x[j];
| ^
|
s924015205 | p01227 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <string>
using namespace std;
int main(){
int t;
cin >> t;
for(int i = 0; i < t; i++){
int n, k;
cin >> n >> k;
if(n <= k){
cout << 0 << endl;
for(int j = 0; j < n; j++){
cin >> x[j];
}
}el... | a.cc: In function 'int main()':
a.cc:21:40: error: 'x' was not declared in this scope
21 | cin >> x[j];
| ^
|
s020895211 | p01227 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n, k, a[1000000];
vector<int>vec;
int main() {
while (true) {
vec.clear();
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
for (int i = 0; i < n - 1; i++) {
vec.push_back(a[i + 1] - a[i]);
}... | a.cc: In function 'int main()':
a.cc:21:45: error: 'b' was not declared in this scope
21 | if (cnt >= k)sum += b[i];
| ^
|
s292862921 | p01227 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int q, n, m, a[100000], b[99999];
int main() {
cin >> q;
for(int i = 0; i < q; i++) {
cin >> n >> m;
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 1; i < n; i++) b[i - 1] = a[i] - a[i - 1];
sort(b, b + n - 1)
int ret = a[n - 1] - a[0];
fo... | a.cc: In function 'int main()':
a.cc:11:35: error: expected ';' before 'int'
11 | sort(b, b + n - 1)
| ^
| ;
12 | int ret = a[n - 1] - a[0];
| ~~~
a.cc:13:67: error... |
s684036948 | p01227 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(void){
int datas;
cin>>datas;
for(int i = 0; i < datas; i++)
{
int n;
int k;
cin >> n;
cin >> k;
int houses[n]???
if(n < k){
k = n;
}
for(int j = 0; j < n;j+... | a.cc: In function 'int main()':
a.cc:13:22: error: expected initializer before '?' token
13 | int houses[n]???
| ^
a.cc:18:20: error: 'houses' was not declared in this scope
18 | cin >> houses[j];
| ^~~~~~
a.cc:20:14: error: 'houses' was not ... |
s917760177 | p01227 | C++ |
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int T,N,K,X[1000000+10],A[1000000+10];
int main(){
cin>>T;
for(int t=0;t<T;++t){
int sum=0;
cin>>N>>K;
for(int i=0;i<N;++i){cin>>X[i];}
for(int i=0;i<N-1;++i){A[i]=X[i+1]-X[i];}
sort(A,A+N-1);
... | a.cc:28:5: error: redefinition of 'int T'
28 | int T,N,K,X[1000000+10],A[1000000+10];
| ^
a.cc:6:5: note: 'int T' previously declared here
6 | int T,N,K,X[1000000+10],A[1000000+10];
| ^
a.cc:28:7: error: redefinition of 'int N'
28 | int T,N,K,X[1000000+10],A[1000000+10];
| ^
a.... |
s066285304 | p01227 | C++ | #include <iostream>
using namespace std;
int T,N,K,X[100000+10],A[100000+10];
int tot=0;
int cut=0;
int main(){
cin >> T;
for(int t=0; t<T; ++t){
cin >> N >> K;
for(int i=0; i<N; ++i) cin >> X[i];
for(int i=0; i+1<N; ++i){
A[i]=X[i+1]-X[i];
tot+=A[i];
}
sort(A,A+N-2); //????????????????????????
rev... | a.cc: In function 'int main()':
a.cc:16:17: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(A,A+N-2); //????????????????????????
| ^~~~
| short
a.cc:17:17: error: 'reverse' was not declared in this scope
17 | ... |
s114585213 | p01227 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<string>
#include<utility>
#include<queue>
using namespace std;
struct team{int m;
int t;
int p;
int j;
};
int A[100000];
vector<int>... | a.cc: In function 'int main()':
a.cc:46:23: error: no matching function for call to 'std::priority_queue<std::vector<std::pair<int, int> > >::push(__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type&)'
46 | Q.push(sum[i]);
| ~~~~~~^~... |
s148994900 | p01227 | C++ | #include <iostream>
using namespace std;
int T=0, N=0, K=0, X[100000]={0}, A[100000]={0}, ans1=0;
int main(){
cin >> T;
for (int t=0; t<T; t++){
cin >> N >> K;
for (int i=0; i<N; i++) cin >> X[i];
for (int i=0; i<N-1; i++) A[i] = X[i+1] - X[i];
sort (A,A+N+1);
reverse (A,A+N+1);
for (int i=0; i<K-1; i++) ... | a.cc: In function 'int main()':
a.cc:10:17: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort (A,A+N+1);
| ^~~~
| short
a.cc:11:17: error: 'reverse' was not declared in this scope
11 | reverse (A,A+N+1);
... |
s724123654 | p01227 | C++ | //
//AOJ 2104 Country Road
//date:20170417
//640009E
//Yang Bo
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int main()
{
int t = 0; //??????????????????????????°
int n = 0, k = 0; //n:??¶????????°, k:?????????????????°
cin >> t; //???????????????????... | a.cc: In function 'int main()':
a.cc:49:21: error: 'i' was not declared in this scope
49 | ans = ans - b[i]; //????????????????????????????????????????????????
| ^
|
s014689624 | p01227 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int main()
{
int t = 0; //??????????????????????????°
int n = 0, k = 0; //n:??¶????????°, k:?????????????????°
cin >> t; //??????????????????????????°?????\???
do {
cin >> n >> k; //??¶????????°n??¨??... | a.cc: In function 'int main()':
a.cc:36:21: error: 'i' was not declared in this scope
36 | ans = ans - b[i]; //????????????????????????????????????????????????
| ^
|
s928542832 | p01227 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0;i<t;++i){
int n,k;
vector<int> x;
vector<int> distance;
int temp;
int total=0;
cin>>n>>k;
for(int j=0;j<n;++j){
cin>>temp;
x.push_back(temp);
}
... | a.cc: In function 'int main()':
a.cc:33:35: error: 'class std::vector<int>' has no member named 'length'
33 | for(int j=0;j<k-1 && distance.length();++j)
| ^~~~~~
|
s630795337 | p01227 | C++ | using namespace std;
int main(){
int t;
cin>>t;
for(int i=0;i<t;i++){
int n,k;
int sum=0;
cin>>n>>k;
vector<int> x(n);
vector<int> dis;
int n_k;
n_k = n-k;
for(int i=0;i<n;++i)
cin>>x[i];
for(int i=0;i<n-1;++i)
dis.push_back(x[i+1]-x[i]);
sort(dis.begin(),dis.end());
for(int i=0;i<... | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin>>t;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:16:9: error: 'vector'... |
s614465465 | p01227 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t, n, k;
vector<int> x;
vector<int> inter;
int min_len;
cin >> t;
for(int i = 0; i < t; i++) {
min_len = 0;
cin >> n >> k;
for(int j = 0; j < n; j++) {
int X;
cin >> X;
x.push_ba... | a.cc: In function 'int main()':
a.cc:28:51: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater'
28 | sort(inter.begin(), inter.end(), greater<inter>());
| ^
a.cc:28:51: note: expected a type, g... |
s178931935 | p01227 | C++ | include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t, n, k;
vector<int> x;
vector<int> inter;
int min_len;
cin >> t;
for(int i = 0; i < t; i++) {
min_len = 0;
cin >> n >> k;
for(int j = 0; j < n; j++) {
int X;
cin >> X;
x.push_bac... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s240520470 | p01227 | C++ | include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t, n, k;
vector<int> x;
vector<int> inter;
int min_len;
cin >> t;
for(int i = 0; i < t; i++) {
min_len = 0;
cin >> n >> k;
for(int j = 0; j < n; j++) {
int X;
cin >> X;
x.push_bac... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s856770787 | p01227 | C++ | #include<iostream>
using namespace std;
int main(){
int t,n,k,ans;
int x[100000],d[100000];
cin >> t;
while(t--){
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> x[i];
if(i)d[i-1] = x[i] - x[i-1];
}
if(n<=k)cout << 0 << endl;
else{
ans = x[n-1]-x[0];
sort(d,d+n-1);
... | a.cc: In function 'int main()':
a.cc:18:7: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(d,d+n-1);
| ^~~~
| short
|
s410025688 | p01227 | C++ | #include <iostream>
#include <algorithm>
int main() {
int t;
for ( int i=0; i<t; i++ ) {
// 入力
int n, k;
std::cin >> n >> k ;
int x[100000];
for ( int j=0; j<n; j++ ) {
std::cin >> x[j];
}
// 演算
int a[100000];
for ( int j=0; j<n-1; j++ ) {
a[j] = x[j+1] - x[j];
}
sort( a, a... | a.cc: In function 'int main()':
a.cc:24:17: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
24 | sort( a, a+n-1 );
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/... |
s272185965 | p01227 | C++ | #include <iostream>
#include <algorithm>
int main() {
int t;
for ( int i=0; i<t; i++ ) {
// 入力
int n, k;
std::cin >> n >> k ;
int x[100000];
for ( int j=0; j<n; j++ ) {
std::cin >> x[j];
}
// 演算
int a[100000];
for ( int j=0; j<n-1; j++ ) {
a[j] = x[j+1] - x[j];
}
std::sort(... | a.cc: In function 'int main()':
a.cc:27:28: error: initializer in range-based 'for' loop
27 | for ( int j=0: j<k-1; j++ ) {
| ^
a.cc:27:37: error: expected ')' before ';' token
27 | for ( int j=0: j<k-1; j++ ) {
| ~ ... |
s970330436 | p01227 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int T,N,K,X[100000+10], A[100000+10];
int main(){
cin >> T;
for (int t=0; t<T; ++t){
int Sum;
cin >> N;
cin >> K;
for (int i=0; i<N; ++i)
cin >> X[i];
for (int i=0; i+1<N; ++i) A[i] = X[i+1]-X[i];
sort(A,A+N-1);
for (int i=0; i<(N-1-(K-1... | a.cc: In function 'int main()':
a.cc:19:10: error: expected ';' before '}' token
19 | Sum = 0
| ^
| ;
20 | }
| ~
|
s872843269 | p01228 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
long Gcd(long m, long n)
{
long temp;
while (m % n != 0)
{
temp = n;
n = m % n;
m = temp;
}
return n;
}
long Lcm(long m, long n)
{
long g=Gcd(m,n);
return m * n / g;
}
const char *str="... | a.cc: In function 'int main()':
a.cc:56:25: error: 'len' was not declared in this scope
56 | len = Lcm(len,mm[j].size());
| ^~~
a.cc:58:25: error: 'len' was not declared in this scope
58 | cout << len << endl;
| ^~... |
s960295228 | p01228 | C++ | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
#include<iostream>
#include<cstdlib>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define fir first
#define sec second
#define pb push_back
#define mp make_pair
typedef long long ll;
const int N = ... | a.cc: In function 'void solve(int, std::vector<std::pair<int, long long int> >*, ll*)':
a.cc:80:3: error: 'assert' was not declared in this scope
80 | assert(ansnum>0);
| ^~~~~~
a.cc:7:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
6 | #inclu... |
s570291473 | p01228 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
typedef unsigned short us;
int N;
int M;
us toHex(string s){
us num=0;
for(int j=0;j<=1;j++){
if(s[j]>='0'&&s[j]<='9'){
num+=s[j]-'0';
}
else{
... | a.cc:78:1: error: expected declaration before '}' token
78 | }
| ^
a.cc: In function 'std::vector<short unsigned int> dePos(std::vector<short unsigned int>)':
a.cc:75:5: warning: control reaches end of non-void function [-Wreturn-type]
75 | }
| ^
|
s584413791 | p01228 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
typedef unsigned short us;
int N;
int M;
us toHex(string s){
us num=0;
for(int j=0;j<=1;j++){
if(s[j]>='0'&&s[j]<='9')num+=s[j]-'0';
else num+=s[j]-'A'+10;
if(j==0)num... | a.cc:74:1: error: expected declaration before '}' token
74 | }
| ^
a.cc: In function 'std::vector<short unsigned int> dePos(std::vector<short unsigned int>)':
a.cc:71:5: warning: control reaches end of non-void function [-Wreturn-type]
71 | }
| ^
|
s110691354 | p01228 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
typedef unsigned short us;
int N;
int M;
us toHex(string s){
us num=0;
for(int j=0;j<=1;j++){
if(s[j]>='0'&&s[j]<='9')num+=s[j]-'0';
else num+=s[j]-'A'+10;
if(j==0)num... | a.cc:74:1: error: expected declaration before '}' token
74 | }
| ^
a.cc: In function 'std::vector<short unsigned int> dePos(std::vector<short unsigned int>)':
a.cc:71:5: warning: control reaches end of non-void function [-Wreturn-type]
71 | }
| ^
|
s773414818 | p01228 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
typedef unsigned short us;
int N;
int M;
us toHex(string s){
    us num=0;
    for(int j=0;j<=1;j++){
        if(s[j]>='0'&&s[j]<='9')num+=s[j]-'0'... | a.cc:27:2: error: stray '#' in program
27 |     us num=0;
| ^
a.cc:27:9: error: stray '#' in program
27 |     us num=0;
| ^
a.cc:28:2: error: stray '#' in program
28 |     for(int j=0;j<=1;j++){
| ^
a.cc:28:9: error: stray '#' in program
28 |   ... |
s912117110 | p01228 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
typedef unsigned short us;
int N;
int M;
int toInt(char ch){
    if(ch>='0'&&ch<='9')return ch-'0';
    return ch-'A'+10;
}
int toChar(int num){
    if(n... | a.cc:31:2: error: stray '#' in program
31 |     if(ch>='0'&&ch<='9')return ch-'0';
| ^
a.cc:31:9: error: stray '#' in program
31 |     if(ch>='0'&&ch<='9')return ch-'0';
| ^
a.cc:32:2: error: stray '#' in program
32 |     return ch-'A'+10;
| ^
a.cc:32:9... |
s536188580 | p01229 | C++ | #include <cstdio>#include <iostream>#include <vector>#include <list>#include <cmath>#include <fstream>#include <algorithm>#include <string>#include <queue>#include <set>#include <map>#include <complex>#include <iterator>#include <cstdlib>#include <cstring>#include <sstream>
using namespace std;
#define EPS (1e-10)#defi... | a.cc:1:18: warning: extra tokens at end of #include directive
1 | #include <cstdio>#include <iostream>#include <vector>#include <list>#include <cmath>#include <fstream>#include <algorithm>#include <string>#include <queue>#include <set>#include <map>#include <complex>#include <iterator>#include <cstdlib>#include <cs... |
s250749049 | p01230 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,... | a.cc: In function 'Matrix operator*(const Matrix&, const Matrix&)':
a.cc:93:32: error: call of overloaded 'fma(const __gnu_cxx::__alloc_traits<std::allocator<Cyclic<2> >, Cyclic<2> >::value_type&, const __gnu_cxx::__alloc_traits<std::allocator<Cyclic<2> >, Cyclic<2> >::value_type&, __gnu_cxx::__alloc_traits<std::alloca... |
s464829135 | p01230 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,... | a.cc: In function 'Matrix operator*(const Matrix&, const Matrix&)':
a.cc:93:32: error: call of overloaded 'fma(const __gnu_cxx::__alloc_traits<std::allocator<Cyclic<2> >, Cyclic<2> >::value_type&, const __gnu_cxx::__alloc_traits<std::allocator<Cyclic<2> >, Cyclic<2> >::value_type&, __gnu_cxx::__alloc_traits<std::alloca... |
s926485686 | p01230 | C++ | class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(... | a.cc:7:20: error: 'bitset' was not declared in this scope
7 | using mat = vector<bitset<50>>;
| ^~~~~~
a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
5 | #include <algorithm>
+++ |+#include <bitset>
6 | using n... |
s508397062 | p01230 | C++ | #include <vector>
#include <set>
using namespace std;
int main(){
int N, M, Z;
while(cin >> N >> M >> Z && N>0){
pair<int, int> edges[2 * M];
for(int i = 0; i < M; ++i){
int s, d;
cin >> s >> d;
edges[2*i] = make_pair(s-1, d-1);
edges[2*i+1] = mak... | a.cc: In function 'int main()':
a.cc:7:11: error: 'cin' was not declared in this scope
7 | while(cin >> N >> M >> Z && N>0){
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <set>
+++ |+#include <iostr... |
s558397503 | p01230 | C++ | #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef __int64 ll;
typedef vector<ll> vec;
typedef vector<vec> m... | a.cc:16:9: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | typedef __int64 ll;
| ^~~~~~~
| __int64_t
a.cc:17:16: error: 'll' was not declared in this scope
17 | typedef vector<ll> vec;
| ^~
a.cc:17:18: error: template argument 1 is invalid
... |
s820715692 | p01230 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int,int> P;
mat mul(mat &A,mat &B){
mat C(A.size(),vec(B[0].size()));
for(int i=0;i<A.size();i++)
for(int k=0;k<B.size();k++)
for(int j=0;j<B[0].size();j++)
C[i][... | a.cc: In function 'int main()':
a.cc:53:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 's'
53 | if(G[i].s==n && A[0][i])fg=true;
| ^
|
s991119985 | p01232 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<set>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
const int N = 255;
int order[N];
bool isleft[N];
void op(string &in,int &p,int cur,boo... | a.cc: In function 'void test()':
a.cc:67:3: error: 'reverse' was not declared in this scope
67 | reverse(ALL(in));
| ^~~~~~~
a.cc: In function 'void reverse(std::string&)':
a.cc:10:29: error: invalid initialization of non-const reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from... |
s532704150 | p01233 | C | #include <iostream>
#include <cassert>
#include <complex>
#include <vector>
using namespace std;
//#pragma comment(linker, "/STACK:400000000")
#define EPS 1e-9
#define P complex<double>
#define L vector<P>
#define pb push_back
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define y1 Y1
int N,... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s612956191 | p01233 | C | #include <iostream>
#include <cassert>
#include <complex>
#include <cstdlib>
#include <vector>
using namespace std;
#define EPS 1e-9
#define P complex<double>
#define L vector<P>
#define pb push_back
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define y1 Y1
int N,x1,y1,x2,y2,X,Y;
double cro... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s261797125 | p01233 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld= long double;
ld eps=1e-9;
/* 幾何の基本 */
#include <complex>
typedef complex<ld> Point;
// 外積
ld cross(const Point& a, const Point& b) {
return imag(conj(a) * b);
}
// 直線の定義
class Li... | a.cc: In function 'int main()':
a.cc:117:31: error: invalid initialization of reference of type 'std::vector<std::pair<long long int, long long int> >&' from expression of type 'std::vector<std::pair<int, int> >'
117 | int ans=solve(bases,goal);
| ^~~~~
a.cc:78:54: ... |
s703408431 | p01233 | C++ | /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
| |
s228256905 | p01235 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
#include "../geometry.h"
P input(){
double x, y;
cin >> x >> y;
return {x, y};
}
struct S{
int cur, prev;
double cost;
bool operator < (const S& s) const {
if(cost != s.cost) return cost > s.c... | a.cc:6:10: fatal error: ../geometry.h: No such file or directory
6 | #include "../geometry.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s006475600 | p01235 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
#include "../geometry.h"
P input(){
double x, y;
cin >> x >> y;
return {x, y};
}
namespace std{
bool operator < (const P& a, const P& b) {
return a.real() != b.real() ? a.real() < b.real() : a.imag() ... | a.cc:6:10: fatal error: ../geometry.h: No such file or directory
6 | #include "../geometry.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s148783295 | p01235 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
#include "../geometry.h"
P input(){
double x, y;
cin >> x >> y;
return {x, y};
}
const double INF = DBL_MAX;
vector<double> dijkstra(const Graph& G, int s){
typedef pair<double, int> P;
priority_queue<P, ... | a.cc:6:10: fatal error: ../geometry.h: No such file or directory
6 | #include "../geometry.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s465305987 | p01239 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int n; double sx[16], sy[16], tx[16], ty[16], dp[1 << 14][14][2];
double dst(double ax, double ay, double bx, double by) {
return sqrtl((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
}
int main() {
int d = 0;
while (true) {
cin >> n; if (n == 0)break; long d... | a.cc: In function 'double dst(double, double, double, double)':
a.cc:6:16: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
6 | return sqrtl((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
| ^~~~~
| strtol
|
s315638559 | p01239 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<cmath>
#include<iomanip>
using namespace std;
class disjoint_set{
public:
vector<int> v;
disjoint_set(int n){
v = vector<int>(n);
for(int i=0;i<n;++i)v[i]=i;
}
int find(int x){
if(v[x]==x)return x;
else return v[x]=find(v[x]);
}
voi... | a.cc: In function 'double pre_calc()':
a.cc:62:1: warning: no return statement in function returning non-void [-Wreturn-type]
62 | }
| ^
a.cc: In function 'double mst(int, double (*)[2])':
a.cc:84:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
84 | sort(e.begin(),e.end());
| ... |
s158120594 | p01240 | C++ | #include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <queue>
using namespace std;
using Weight = int;
using Capacity = int;
struct Edge {
int src, dst; Capacity cap;
Edge(int s, int d, Capacity c) : src(s), dst... | a.cc:40:16: error: declaration of 'struct Dinic::Edge' changes meaning of 'Edge' [-Wchanges-meaning]
40 | struct Edge { int s, d; Flow c, f; int r; };
| ^~~~
a.cc:22:24: note: used here to mean 'struct Edge'
22 | vector< vector<Edge> > g;
| ^~~~
a.... |
s077008061 | p01246 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<complex>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
typedef complex<double> P;
const double eps = 1e-10;
#define EQ(a,b) abs(a-b) < eps
#define RIGHT 1
#define LEFT -1
void op(vector... | a.cc: In function 'P get_random_point(std::vector<std::complex<double> >&)':
a.cc:111:3: error: 'assert' was not declared in this scope
111 | assert(is_in(poly,ret));
| ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
4 | #include<... |
s929635883 | p01248 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_... | a.cc: In function 'int getans(int)':
a.cc:21:54: error: no matching function for call to 'max(long long int, int)'
21 | if (r == N)ans = min(ans, max(0ll, sum - W));
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm... |
s602183396 | p01248 | C++ |
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int main() {
for(int C = 1; ; ++C) {
int N, W;
cin >> N >> W;
if(!N && !W) break;
vector<int> ws(N);
for(int i = 0; i < N; ++i) cin >> ws[i];
vector<vector<int> > s... | a.cc: In function 'int main()':
a.cc:43:12: error: 'i' was not declared in this scope
43 | dp[i] = max(0, cv[0][N-1]-W);
| ^
|
s624991955 | p01248 | C++ | include<iostream>
#include<cmath>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n ) REP(i,0,n)
using namespace std;
int main()
{
int n,w;
int Nari = 1;
while(cin >> n >> w,n|w)
{
int input[n],total[n],mincost[n],ans = (1<<28);
rep(i,n)
{
cin >> input[i];
total[... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
16... |
s525075966 | p01249 | C++ | include<iostream>
#include<algorithm>
#include<cstdio>
#include<climits>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define IINF (INT_MAX)
#define MAX 2010
using namespace std;
struct Data{
string word;
int value;
Data(string word="X",int value=IINF):word(word),value(value){}
};
int d... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g... |
s919234382 | p01251 | C | #include <iostream>
#include <cstring>
using namespace std;
const int dx[] = { 1, 0, -1, 0 };
const int dy[] = { 0, 1, 0, -1 };
bool field[201][201];
int main(){
while(true){
int W, H, N;
cin >> W >> H >> N;
if(W == 0 && H == 0 && N == 0){ break; }
memset(field, 0, sizeof(field));
for(int i = 0; i <= H * ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s168360290 | p01251 | C++ | #include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
/* constant */
const int MAX_W = 100;
const int MAX_H = 100;
const int dxs[] = {1, 0, -1, 0};
const int dys[] = {0, 1, 0, -1};
/* typedef */
/* global variables */
int w, h, n;
bool wls[MAX_H][MAX_W][4], vstd[MAX_H][MAX_W][4];
/* subrou... | a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
31 | memset(wls, 0, sizeof(wls));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<iostream>
+++ |+#include <cstring>
... |
s353739700 | p01251 | C++ |
#include<iostream>
#include<stdio>
using namespace std;
struct Person{int x,y,dir;};
enum Mapchip{BLANK,WALL,ENTRANCE,EXIT};
enum Direction{UP,RIGHT,DOWN,LEFT};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
Person me;
int v[205][205];
int move(Person me);
Person turn(Person me, int dir);
bool operator<(Person a, Pers... | a.cc:3:9: fatal error: stdio: No such file or directory
3 | #include<stdio>
| ^~~~~~~
compilation terminated.
|
s609258889 | p01254 | Java | import java.util.BitSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;
@unchecked
public class Main {
Scanner sc;
Main() {
sc = new Scanner(System.in);
}
class st implements Comparable<st> {
int cost;
int pos;
int omit;
st(int cost, int pos, int omit) {
thi... | Main.java:6: error: cannot find symbol
@unchecked
^
symbol: class unchecked
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s996981195 | p01266 | C++ | #include<iostream>
#include<cmath>
#include<complex>
#include<vector>
#include<queue>
using namespace std;
#include<iostream>
#include<cstdlib>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define fir first
#define sec second
#def... | a.cc: In function 'double kruskal(std::vector<std::complex<double> >&, std::vector<std::complex<double> >&, double)':
a.cc:90:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
90 | sort(ALL(edge));
| ^~~~
| sqrt
a.cc: In function 'double solve(int, std::vector<std::complex<doubl... |
s093948373 | p01267 | Java | import java.util.*;
public class A {
// N A B C X
// Y1 Y2 ... YN
// x' = (A テδ?x + B) mod C
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n, a, b, c, x;
while(true){
// ティツェツュテ」ツ?ソテ・ツ渉姪」ツつ?
n = in.nextInt();
a = in.nextInt();
b = in.nextInt();
c = in.ne... | Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s268906345 | p01267 | Java | import java.util.*;
public class A {
// N A B C X
// Y1 Y2 ... YN
// x' = (A テδ?x + B) mod C
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n, a, b, c, x;
while(true){
// ティツェツュテ」ツ?ソテ・ツ渉姪」ツつ?
n = in.nextInt();
a = in.nextInt();
b = in.nextInt();
c = in.ne... | Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s304836716 | p01267 | Java | import java.util.*;
class Main{
int N,A,B,C;
int[] Y;
void solve(){
Scanner sc = new Scanner(System.in);
while(true){
N = sc.nextInt();
A = sc.nextInt();
B = sc.nextInt();
C = sc.nextInt();
int X = sc.nextInt();
if(N==0 && A==0 && B==0 && C==0 && X==0) break;
Y = ... | Main.java:46: error: cannot find symbol
new A2009().solve();
^
symbol: class A2009
location: class Main
1 error
|
s006048434 | p01267 | C | main(n,a,b,c,x,i,t,y[101]){ ;for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}return 0;} | main.c:1:21: error: expected ')' before '[' token
1 | main(n,a,b,c,x,i,t,y[101]){ ;for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}return 0;}
| ^
| ... |
s812240085 | p01267 | C | a,b,c,x,y,f,t;main(n){while(1){scanf("%d%d%d%d%d",&n,&a,&b,&c,&x);if(!n)exit(0);for(f=t=0;n-->0;t=1){scanf("%d",&y);while(t||x!=y&&f<10001)t=0,f++,x=(a*x+b)%c;}f>10000&&f=-1;printf("%d\n",f);}} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,c,x,y,f,t;main(n){while(1){scanf("%d%d%d%d%d",&n,&a,&b,&c,&x);if(!n)exit(0);for(f=t=0;n-->0;t=1){scanf("%d",&y);while(t||x!=y&&f<10001)t=0,f++,x=(a*x+b)%c;}f>10000&&f=-1;printf("%d\n",f);}}
| ^
main.c:1:1: error: type defaults to 'int' ... |
s107710667 | p01267 | C | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <c... | main.c:1:10: fatal error: vector: No such file or directory
1 | #include <vector>
| ^~~~~~~~
compilation terminated.
|
s014360618 | p01267 | C++ | #include <bits/stdc++.h>
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define DECIM8 fixed<<setprecision(8)
#define SZ(a) int((a).size())
#define SORT(c) so... | a.cc: In function 'int main()':
a.cc:42:9: error: expected primary-expression before ')' token
42 | for(){
| ^
a.cc:53:3: error: expected primary-expression before '}' token
53 | }
| ^
a.cc:52:28: error: expected ')' before '}' token
52 | cout << answer << endl;
| ... |
s158880652 | p01267 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n, a, b, c, x, y, count;
while(true){
cin >> n >> a >> b >> c >> x;
if(n == 0){
break;
}
cin >> y;
count = 0;
for (int i = 0; i < n; ++i)
{
cin >> y;
for (int j = 0; j < 10000; ++j)
{
... | a.cc: In function 'int main()':
a.cc:26:17: error: expected ';' before 'if'
26 | count ++
| ^
| ;
27 | if(j == 9999){
| ~~
|
s041939173 | p01267 | C++ | #include <stdio.h>
int main()
{
int n,a,b,c,x,cou,s,i,j;
while(1){
scanf("%d %d %d %d %d",&n,&a,&b,&c,&x);
if(n==0&&a==0&&b==0&&c==0&&x==0)break;
cou=0;
for(i=0;i<n;i++){
scanf("%d",&s);
if(cou==0&&x==s)continue;
x=(a*x+b)%c;
cou++;
while(x!=s){
x=(a*x+b)%c;
if(cou>=1... | a.cc: In function 'int main()':
a.cc:20:17: error: expected primary-expression before ';' token
20 | for(j=i+;j<n;j++)scanf("%d",&s);
| ^
|
s750281732 | p01267 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n,a,b,c,x;
int k;
int count;
vector<int> y;
int s;
while(cin >> n >> a >> b >> c >> x){
if(n == 0 && a == 0 && b == 0 && c == 0 && x == 0){
break;
}
y.clear();
count = -1;
for(int i = ... | a.cc: In function 'int main()':
a.cc:23:20: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
23 | reverse(y.begin-1,y.begin-1);
| ~~~~~~~^~
| | |
| | int
| <unresolved ove... |
s615467368 | p01267 | C++ | while True:
N,A,B,C,X = map(int,raw_input().split())
if N == A == B == C == X == 0:break
sum = 0
Z = 0
Y = [int(x) for x in raw_input().split()]
if (X in Y) == True:
Y.remove(X)
while Z == 0:
if sum == 10000:
sum = -2
Z = 1
sum += 1
X = (A*X+B)%C
if X == Y... | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while True:
| ^~~~~
|
s279095867 | p01267 | C++ | #include <iostream>
#include <vector>
using namespace std;
#include <stdio.h>
int LCGs(int N, int X, int A, int B, int C, const int *Y, int size) {
int counter = 0;
for(int i = 0; i < N; i ++) {
for(; counter =< 10000; counter++) {
if(X == Y[i]) {
break;
}
X = ((A * X + B) % C);
... | a.cc: In function 'int LCGs(int, int, int, int, int, const int*, int)':
a.cc:10:20: error: expected primary-expression before '<' token
10 | for(; counter =< 10000; counter++) {
| ^
|
s314329235 | p01267 | C++ | include <iostream>
#include <vector>
using namespace std;
int LCGs(int N, int X, int A, int B, int C, const int *Y) {
int counter = 0;
for(int i = 0; i < N; i ++) {
for(; counter <= 10000; counter++) {
if(X == Y[i]) {
if(i < (N-1) && Y[i] == Y[i+1]) {
counter++;
X = ((A * X +... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s051027825 | p01267 | C++ | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
#define REP... | a.cc:44:1: error: expected unqualified-id before '[' token
44 | [cos
| ^
|
s480284636 | p01267 | C++ | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}
| ^~~~
a.cc: In func... |
s297759685 | p01267 | C++ | include <iostream>
using namespace std;
int main() {
while (true) {
int n, a, b, c, x;
cin >> n >> a >> b >> c >> x;
if ((n | a | b | c | x) == 0) {
break;
}
int* randomNums = new int [n];
for (int i = 0; i < n; i++) {
cin >> randomNums[i];
... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> n >> a >> b >> c >> x;
| ^~~
a.cc:24:13: error: 'cout' was not declared in this scope
24 | ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.