submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s562843310 | p00227 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Mani {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true) {
int n = sc.nextInt();
int m = sc.nextInt();
if (n == 0) {
break;
}
int[] p = new int[n];
for(int i=0;i<n;i++) {
p[i] = sc.ne... | Main.java:4: error: class Mani is public, should be declared in a file named Mani.java
public class Mani {
^
1 error
|
s031927904 | p00227 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Mani {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true) {
int n = sc.nextInt();
int m = sc.nextInt();
if (n == 0) {
break;
}
int[] p = new int[n];
for(int i=0;i<n;i++) {
p[i] = sc.ne... | Main.java:4: error: class Mani is public, should be declared in a file named Mani.java
public class Mani {
^
1 error
|
s322324655 | p00227 | C | #include <cstdio>
#include <algorithm>
using namespace std;
int main(void)
{
int i, n, m, p;
int sum, array[1000];
while (1){
scanf("%d %d", &n, &m);
if (!n && !m){
break;
}
for (i = 0; i < n; i++){
scanf("%d", &array[i]);
}
sort(array, array + n);
reverse(array, array + n);
f... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s151691766 | p00227 | C | #include<stdio.h>
int main(void)
{
int a, b, c[1000], d, e, f, g = 1, i, j;
while (scanf_s("%d %d", &a, &b))
{
if (a == 0 && b == 0)break;
j = 0, g = 1;
for (i = 1;i <= a;i++)
{
scanf_s("%d", &d);
c[i] = d;
}
f = a;
while (g)
{
for (i = 1;i <= a;i++)
{
if (c[i] < c[i + 1])
{
... | main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | while (scanf_s("%d %d", &a, &b))
| ^~~~~~~
| scanf
|
s264702017 | p00227 | C | #include<stdio.h>
int main(void)
{
int a, b, c[1000], d, e, g, i, j;
while (scanf_s("%d %d", &a, &b))
{
if (a == 0 && b == 0)break;
j = 0, g = 1, e = 0;
for (i = 1;i <= a;i++)
{
scanf_s("%d", &c[i]);
}
for (i = 1;i <= a;i++)
{
for (g = 1;g <= a-1;g++)
{
if (c[i] < c[j])
{
e = c[... | main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | while (scanf_s("%d %d", &a, &b))
| ^~~~~~~
| scanf
|
s682651309 | p00227 | C | #include <cstdio>
#include <algorithm>
#include <functional>
#define N 1000
using namespace std;
/** Application main entry point. */
int main (
int argc,
char * argv[ ]
)
{
int i;
for ( ; ; )
{
int d[ N ];
int res = 0;
int n, m;
scanf ( "%d%d", &n, &m );
if ( !( n | m ) ) brea... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s031844098 | p00227 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[1000];
main()
{
while(cin>>n>>m,n)
{
int ans=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
ans+=a[i];
}
sort(a,a+n);
for(int i=n-m;i>=0i-=m)
{
ans-=a[i];
}
cout<<ans<<endl;
}
}
| a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:16:32: error: invalid operands of types 'int' and '__complex__ int' to binary 'operator>='
16 | for(int i=n-m;i>=0i-=m)
a.cc:16:39: error: expected ';... |
s604548241 | p00227 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m;
while(1){
cin >> n >> m;
if(n == 0 && m == 0)
break;
array<int, 1000> p;
p.fill(0);
for(int i = 0; i < n; ++i)
cin >> p[i];
sort(p.begin(), p.end(), greater<int>());
int ans = 0;
for(int i = 0; i < n; i +... | a.cc: In function 'int main()':
a.cc:13:34: error: aggregate 'std::array<int, 1000> p' has incomplete type and cannot be defined
13 | array<int, 1000> p;
| ^
a.cc:3:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#includ... |
s186013402 | p00227 | C++ | #include<cstdio>
#include<string>
#include<iostream>
using namespace std;
main(){
int m,n;
int b[1001];
while(cin >> n >> m,m || n){
int total=0;
int k=n/m;
for(int i=0;i<n;i++) cin >> b[i];
sort(b,b+n);
for(int i=1;i<=n;i++){
if(i%m) total+=b[n-i];
}
cout << total << endl;
}... | a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(b,b+n);
| ^~~~
| short
|
s051449404 | p00227 | C++ | #include<iostream>
using namespace std;
main(){
int m,n;
int b[1001];
while(cin >> n >> m,m || n){
int total=0;
int k=n/m;
for(int i=0;i<n;i++) cin >> b[i];
sort(b,b+n);
for(int i=1;i<=n;i++){
if(i%m) total+=b[n-i];
}
cout << total << endl;
}
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(b,b+n);
| ^~~~
| short
|
s364743842 | p00227 | C++ | #include<iostream>
#include<cmath>
#include<slgorithm>
using namespace std;
main(){
int m,n;
int b[1001];
while(cin >> n >> m,m || n){
int total=0;
int k=n/m;
for(int i=0;i<n;i++) cin >> b[i];
sort(b,b+n);
for(int i=1;i<=n;i++){
if(i%m) total+=b[n-i];
}
cout << total << endl;
... | a.cc:3:9: fatal error: slgorithm: No such file or directory
3 | #include<slgorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s875155465 | p00227 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
main(){
int ans=0;
int be[10002];
int x=-1,n,m;
while(1){
x=-1;
ans=0;
cin>>n>>m;
if(n==m==0)break;
for(int i=0;i<n;i++){
cin>>be[i];
ans+=be[i];
}
sort(be,be+n,greater<int > );
while(n>=m){
x+=m;
ans-=be[x];
n-=m;
}
cout<<ans<<endl;
}
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:17:28: error: expected primary-expression before ')' token
17 | sort(be,be+n,greater<int > );
| ^
|
s825833777 | p00227 | C++ | #include<vector>
#include<iostream>
using namespace std;
vector<int> l;
int n,m;
bool input(){
cin>>n>>m;
if(n==m&&n==0)return false;
l.clear(),l.resize(n);
for(int i=0;i<n;i++){
cin>>l[i];
}
return true;
}
int solve(){
sort(l.rbegin(),l.rend());
int ans = 0;
for(int i=0;i<n;i++){
if( (i+1)... | a.cc: In function 'int solve()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(l.rbegin(),l.rend());
| ^~~~
| short
|
s467252967 | p00227 | C++ | #include<vector>
#include<iostream>
using namespace std;
vector<int> l;
int n,m;
bool input(){
cin>>n>>m;
if(n==m&&n==0)return false;
l.clear(),l.resize(n);
for(int i=0;i<n;i++){
cin>>l[i];
}
return true;
}
int solve(){
sort(l.rbegin(),l.rend());
int ans = 0;
for(int i=0;i<n;i++){
if( (i+1)... | a.cc: In function 'int solve()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(l.rbegin(),l.rend());
| ^~~~
| short
|
s819830026 | p00227 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
int n, m; // n:konyu m:hukuro
std::cin >> n >> m;
while(n != 0 || m != 0){
std::vector<int> price;
price.resize(n);
for(int i = 0; i < n; ++i){
cin >> price[i]; // input
}
std::sort(price.begin(), price.end(), std::greater<int>()... | a.cc: In function 'int main()':
a.cc:12:25: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
12 | cin >> price[i]; // input
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note:... |
s158413500 | p00227 | C++ | #include <iostream>
#include <vector>
#include <iterator>
int main(){
int num, limit;
while(std::cin >> num >> limit){
std::vector<int> price;
int sum_price = 0;
//input
for(int i = 0; i < num; ++i){
int buf;
sum_price += buf;
std::sin >> buf;
price.push_back(buf);
}
//sort
std::sort(pric... | a.cc: In function 'int main()':
a.cc:16:30: error: 'sin' is not a member of 'std'; did you mean 'min'?
16 | std::sin >> buf;
| ^~~
| min
a.cc:20:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
20 | ... |
s103577902 | p00227 | C++ | #include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
int main(){
int num, limit;
while(std::cin >> num >> limit){
std::vector<int> price;
int sum_price = 0;
//input
for(int i = 0; i < num; ++i){
int buf;
sum_price += buf;
std::cin >> buf;
price.push_back(buf);
}
//... | a.cc: In function 'int main()':
a.cc:25:38: error: unable to deduce 'auto' from 'price.std::vector<int>::begin'
25 | for(auto itr = price.begin; itr != price.end(); ++itr){
| ~~~~~~^~~~~
a.cc:25:38: note: couldn't deduce template parameter 'auto'
25 | ... |
s507310577 | p00227 | C++ | #include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
int main(){
int num, limit;
while(std::cin >> num >> limit){
std::vector<int> price;
int sum_price = 0;
//input
for(int i = 0; i < num; ++i){
int buf;
sum_price += buf;
std::cin >> buf;
price.push_back(buf);
}
//... | a.cc: In function 'int main()':
a.cc:28:42: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
28 | discount += itr;
| ~~~~~~~~~^~~~~~
|
s313284869 | p00227 | C++ | #include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
int main(){
int num, limit;
while(std::cin >> num >> limit){
std::vector<int> price;
int sum_price = 0;
//input
for(int i = 0; i < num; ++i){
int buf;
sum_price += buf;
std::cin >> buf;
price.push_back(buf);
}
//... | a.cc: In function 'int main()':
a.cc:28:43: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
28 | int buf = itr;
| ^~~
| |
| ... |
s777216860 | p00227 | C++ | #include <iostream>
#define MAX_NM 1000
int n, m, all;
int p[MAX_NM];
void solve();
int main(){
while(true){
all = 0;
std::cin >> n >> m;
for(int i = 0; i < n; ++i){
std::cin >> p[i];
all += p[i];
}
solve();
std::cout << all << std::endl;
... | a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
25 | std::sort(p, p + n, std::greater<int>());
| ^~~~
| qsort
|
s630337941 | p00227 | C++ | #include <iostream>
#define MAX_NM 1000
int n, m, all;
int p[MAX_NM];
void solve();
int main(){
while(true){
all = 0;
std::cin >> n >> m;
for(int i = 0; i < n; ++i){
std::cin >> p[i];
all += p[i];
}
solve();
std::cout << all << std::endl;
... | a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
25 | std::sort(p, p + n, std::greater<int>());
| ^~~~
| qsort
|
s891676018 | p00227 | C++ | #include <iostream>
#define MAX_NM 1000
int n, m, all;
int p[MAX_NM];
void solve();
int main(){
while(true){
all = 0;
std::cin >> n >> m;
for(int i = 0; i < n; ++i){
std::cin >> p[i];
all += p[i];
}
solve();
std::cout << all << std::endl;
... | a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
25 | std::sort(p, p + n, std::greater<int>());
| ^~~~
| qsort
|
s130044405 | p00227 | C++ | #include <iostream>
#define MAX_NM 1000
int n, m, all;
int p[MAX_NM];
void solve();
int main(){
while(true){
all = 0;
std::cin >> n >> m;
for(int i = 0; i < n; ++i){
std::cin >> p[i];
all += p[i];
}
solve();
std::cout << all << std::endl;
... | a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
25 | std::sort(p, p + n, std::greater<int>());
| ^~~~
| qsort
|
s501394728 | p00227 | C++ | #include <iostream>
#include <vector>
int main(){
int n,m;
int p;
while(true){
std::cin >> n >> m;
if(n == 0 && m == 0){
break;
}
std::vector<int> price;
for(int i=0; i<n ;++i){
std::cin >> p;
price.push_back(p);
}
//sort in descending order
std::sort(price.begin(), price.end(), std::g... | a.cc: In function 'int main()':
a.cc:20:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
20 | std::sort(price.begin(), price.end(), std::greater<int>());
| ^~~~
| qsort
|
s397430225 | p00227 | C++ | #include <iostream>
#include <vector>
int main(){
int n,m;
int p;
while(true){
std::cin >> n >> m;
if(n == 0 && m == 0){
break;
}
std::vector<int> price;
for(int i=0; i<n ;++i){
std::cin >> p;
price.push_back(p);
}
//sort in descending order
std::sort(price.begin(), price.end(), std::g... | a.cc: In function 'int main()':
a.cc:20:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
20 | std::sort(price.begin(), price.end(), std::greater<int>());
| ^~~~
| qsort
|
s911625729 | p00227 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <boost/tokenizer.hpp>
#include <boost/lexical_cast.hpp>
#include <vector>
#include <list>
using namespace std;
using namespace boost;
int main(int argc, char* argv[])
{
using sprtr = char_separator<char>;
using tknzr = tokenizer... | a.cc:5:10: fatal error: boost/tokenizer.hpp: No such file or directory
5 | #include <boost/tokenizer.hpp>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s339752506 | p00227 | C++ | #include <bits/stdc++.h>
#define r(i,n) for(i=0;i<n;i++)
using namespace std;
int main(){
int a,b,i;
while(cin>>a>>b,a){
int c[a],s=0,k=0.p=0;
r(i,a){cin>>c[i];p+=c[i];}
sort(c,c+a);
for(i=a-1;i>=0;i--){
k++;
if(k==b){
s+=c[i];
k=0;
}
}
cout<<p-s<<endl;;
}... | a.cc: In function 'int main()':
a.cc:7:20: error: unable to find numeric literal operator 'operator""p'
7 | int c[a],s=0,k=0.p=0;
| ^~~
a.cc:8:22: error: 'p' was not declared in this scope
8 | r(i,a){cin>>c[i];p+=c[i];}
| ^
a.cc:17:11: error: 'p' was n... |
s205524628 | p00227 | C++ | #include "stdafx.h"
#include"iostream"
using namespace std;
int main() {
while (1) {
int n, m,p[10000],sum=0;
cin >> n >> m;
if (n == 0 && m == 0)break;
for (int i = 1; i < n+1; i++) {
cin >> p[i];
}
for (int j = 0; j < n - 1; j++) {
for (int i = 1; i < n + 1; i++) {
if (p[i] < p[i + 1]) {
... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s277271299 | p00227 | C++ | #include "stdafx.h"
#include"iostream"
using namespace std;
int main() {
while (1) {
int n, m,p[10000],sum=0;
cin >> n >> m;
if (n == 0 && m == 0)break;
for (int i = 1; i < n+1; i++) {
cin >> p[i];
}
for (int j = 0; j < n + 1; j++) {
for (int i = 1; i <= n ; i++) {
if (p[i] < p[i + 1]) {
... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s694908920 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.emplace_back(x);
}
std::sort(v.begin(), v.end(), std::greater<int>());
... | a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
18 | std::sort(v.begin(), v.end(), std::greater<int>());
| ^~~~
| qsort
|
s426509630 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.emplace_back(x);
}
std::sort(v.begin(), v.end(), std::greater<int>());
... | a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
18 | std::sort(v.begin(), v.end(), std::greater<int>());
| ^~~~
| qsort
|
s106788863 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.emplace_back(x);
}
std::sort(v.begin(), v.end(), std::greater<int>());
... | a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
18 | std::sort(v.begin(), v.end(), std::greater<int>());
| ^~~~
| qsort
|
s366860563 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.emplace_back(x);
}
std::sort(v.begin(), v.end(), std::greater<int>());
... | a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
18 | std::sort(v.begin(), v.end(), std::greater<int>());
| ^~~~
| qsort
|
s947148728 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.emplace_back(x);
}
std::sort(v.rbegin(),v.rend());
for(int y = 0;y < n;y++){
... | a.cc: In function 'int main()':
a.cc:17:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
17 | std::sort(v.rbegin(),v.rend());
| ^~~~
| qsort
|
s824383946 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.push_back(x);
}
std::sort(v.rbegin(),v.rend());
for(int y = 0;y < n;++y){
fla... | a.cc: In function 'int main()':
a.cc:17:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
17 | std::sort(v.rbegin(),v.rend());
| ^~~~
| qsort
|
s064565204 | p00227 | C++ | #include <iostream>
#include <vector>
#include <string>
int main(){
int n,m,x;
int flag = 0;
int num = 0;
std::vector<int> v;
std::cin >> n >> m;
while(std::cin >> x){
v.push_back(x);
}
sort(v.rbegin(),v.rend());
for(int y = 0;y < n;++y){
flag++;
... | a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(v.rbegin(),v.rend());
| ^~~~
| short
|
s304852856 | p00227 | C++ | #include <iostream>
#include <array>
int main(){
int n,m; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::array<u_int, n> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
int price=0; //最終出力
while(n>=m){
for(int i=0;i<m;i++){
price += ... | a.cc: In function 'int main()':
a.cc:10:36: error: the value of 'n' is not usable in a constant expression
10 | std::array<u_int, n> p; //野菜価格一覧
| ^
a.cc:6:13: note: 'int n' is not const
6 | int n,m; //問題文のn,m
| ^
a.cc:10:36: note... |
s324830722 | p00227 | C++ | #include <iostream>
#include <array>
int main(){
int n=0,m=0; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::array<u_int, n> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
int price=0; //最終出力
while(n>=m){
for(int i=0;i<m;i++){
price... | a.cc: In function 'int main()':
a.cc:10:36: error: the value of 'n' is not usable in a constant expression
10 | std::array<u_int, n> p; //野菜価格一覧
| ^
a.cc:6:13: note: 'int n' is not const
6 | int n=0,m=0; //問題文のn,m
| ^
a.cc:10:36: ... |
s510994417 | p00227 | C++ | #include <iostream>
#include <array>
int main(){
int n=0,m=0; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::array<u_int, n> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
int price=0; //最終出力
while(n>=m){
for(int i=0;i<m;i++){
price... | a.cc: In function 'int main()':
a.cc:10:36: error: the value of 'n' is not usable in a constant expression
10 | std::array<u_int, n> p; //野菜価格一覧
| ^
a.cc:6:13: note: 'int n' is not const
6 | int n=0,m=0; //問題文のn,m
| ^
a.cc:10:36: ... |
s251070255 | p00227 | C++ | #include <iostream>
#include <array>
int main(){
int n=0,m=0; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::array<int, n> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
int price=0; //最終出力
while(n>=m){
for(int i=0;i<m;i++){
price +... | a.cc: In function 'int main()':
a.cc:10:34: error: the value of 'n' is not usable in a constant expression
10 | std::array<int, n> p; //野菜価格一覧
| ^
a.cc:6:13: note: 'int n' is not const
6 | int n=0,m=0; //問題文のn,m
| ^
a.cc:10:34: note... |
s735591882 | p00227 | C++ | #include <iostream>
#include <vector>
int main(){
int n,m; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::vector<int> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
std::reverse(p.begin(), p.end()); //降順ソート
for(int i=m-1;i<n;i+=m){
std::... | a.cc: In function 'int main()':
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
14 | std::sort(p.begin(), p.end());
| ^~~~
| qsort
a.cc:15:22: error: 'reverse' is not a member of 'std'
15 | std::reverse... |
s248117297 | p00227 | C++ | #include <iostream>
#include <vector>
int main(){
int n,m; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::vector<int> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
std::sort(p.begin(), p.end());
std::reverse(p.begin(), p.end()); //降順ソート
for(int i=m-1;i<n;i+=m){
p.era... | a.cc: In function 'int main()':
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
14 | std::sort(p.begin(), p.end());
| ^~~~
| qsort
a.cc:15:22: error: 'reverse' is not a member of 'std'
15 | std::reverse... |
s760726317 | p00227 | C++ | #include <iostream>
#include <vector>
int main(){
int n,m; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::vector<int> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
sort(p.begin(), p.end());
reverse(p.begin(), p.end()); //降順ソート
for(int i=m-1;i<n;i+=m){
p.erase(std::v.... | a.cc: In function 'int main()':
a.cc:14:17: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(p.begin(), p.end());
| ^~~~
| short
a.cc:15:17: error: 'reverse' was not declared in this scope
15 | reverse(p.begin... |
s554967908 | p00227 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
int main(){
int n,m; //問題文のn,m
while(std::cin >> n >> m){
if(n==0&&m==0) break;
std::vector<int> p; //野菜価格一覧
for(int i=0;i<n;i++){
std::cin >> p[i];
}
sort(p.begin(), p.end());
reverse(p.begin(), p.end()); //降順ソート
for... | a.cc: In function 'int main()':
a.cc:20:35: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
20 | p.erase(p.bigin() +i);
| ^~~~~
| begin
|
s522258147 | p00227 | C++ | include <iostream>
#include <vector>
#include <queue>
int main(){
int n,m;
while(std::cin >> n >> m){
if(n == 0 && m == 0){
break;
}
std::priority_queue<int> que;
int vegetable;
for(int i = 0; i < n; ++i){
std::cin >> vagetable;
que.push();
}
int price = 0;
for(int i = 0; i < n; ++i){
... | 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... |
s878878027 | p00227 | C++ | #include <iostream>
#include <queue>
int main(){
int n,m;
while(std::cin >> n >> m){
if(n == 0 && m == 0){
break;
}
std::priority_queue<int> que;
int vegetable;
for(int i = 0; i < n; ++i){
std::cin >> vagetable;
que.push();
}
int price = 0;
for(int i = 0; i < n; ++i){
if((i % m) != (m ... | a.cc: In function 'int main()':
a.cc:13:37: error: 'vagetable' was not declared in this scope; did you mean 'vegetable'?
13 | std::cin >> vagetable;
| ^~~~~~~~~
| vegetable
a.cc:14:33: error: no matching funct... |
s067243149 | p00227 | C++ | #include <iostream>
#include <queue>
int main(){
int n,m;
while(std::cin >> n >> m){
if(n == 0 && m == 0){
break;
}
std::priority_queue<int> que;
int vegetable;
for(int i = 0; i < n; ++i){
std::cin >> vegetable;
que.push();
}
int price = 0;
for(int i = 0; i < n; ++i){
if((i % m) != (m ... | a.cc: In function 'int main()':
a.cc:14:33: error: no matching function for call to 'std::priority_queue<int>::push()'
14 | que.push();
| ~~~~~~~~^~
In file included from /usr/include/c++/14/queue:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_que... |
s634983733 | p00228 | Java | public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
Digital digital;
while(true){
line = br.readLine();
int num = Integer.valueOf(line);
if(num == -1){
break;
}
digital = Di... | Main.java:3: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:4: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^... |
s793843344 | p00228 | C | #include<stdio>
int main(void){
int i ,j,n,b,a;
int s[10][7]={{0,1,1,1,1,1,1},{0,0,0,0,1,1,0},{1,0,1,1,0,1,1},{1,0,0,1,1,1,1},{1,1,0,0,1,1,0},{1,1,0,1,1,0,1},{1,1,1,1,1,0,1},{0,1,0,0,1,1,1},{1,1,1,1,1,1,1},{1,1,0,1,1,1,1}};
int ans[7];
while(scanf("%d",&n),n+1){
b=0;
for(i=0;i<n;i++){
scanf("%d",&a);
for(j=0;i<7;j++){... | main.c:1:9: fatal error: stdio: No such file or directory
1 | #include<stdio>
| ^~~~~~~
compilation terminated.
|
s311852206 | p00228 | C | #include <stdio.h>
int main(){
int i,j,n;
char L[][8]={"0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1111110"}:
while (1){
scanf("%d",&n);
if (n==-1) break;
char b[]="0000000";
int p=10;
for (i=0;i<n;i++){
int a;
scanf("%d",&a);
... | main.c: In function 'main':
main.c:5:116: error: expected ',' or ';' before ':' token
5 | char L[][8]={"0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1111110"}:
| ... |
s596504848 | p00228 | C++ | b[11]={63,6,91,79,102,109,125,39,127,111,0},q=11,k,n,p,i,j;main(){for(;~scanf("%d",&n)&~n;)for(i=0;i<n&&scanf("%d",&k);i++,q=k)for(j=7;j>-1;j--?printf("%d",(p>>j)&1):puts(""))p=i?b[q]^b[k]:b[k];exit(0);} | a.cc:1:1: error: 'b' does not name a type
1 | b[11]={63,6,91,79,102,109,125,39,127,111,0},q=11,k,n,p,i,j;main(){for(;~scanf("%d",&n)&~n;)for(i=0;i<n&&scanf("%d",&k);i++,q=k)for(j=7;j>-1;j--?printf("%d",(p>>j)&1):puts(""))p=i?b[q]^b[k]:b[k];exit(0);}
| ^
a.cc:1:44: error: expected unqualified-id before ',' tok... |
s301400260 | p00228 | C++ | #include <iostream>
#include <algorithm>
#include <string>
const int V[10][7] = {
{0, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{1, 0, 1, 1, 0, 1, 1},
{1, 0, 0, 1, 1, 1, 1},
{1, 1, 0, 0, 1, 1, 0},
{1, 1, 0, 1, 1, 0, 1},
{1, 1, 1, 1, 1, 0, 1},
{0, 1, 0, 0, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 0, ... | a.cc: In function 'int main()':
a.cc:59:2: error: expected '}' at end of input
59 | }
| ^
a.cc:36:12: note: to match this '{'
36 | int main() {
| ^
|
s921968347 | p00228 | C++ | using namespace std;
string s[10] = {
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1101111",
};
int main(void){
int n;
while(cin>>n, (n!=-1)){
string now = "0000000";
for(int i=0;i<n;i++){
int x;
cin>>x;
string c... | a.cc:3:1: error: 'string' does not name a type
3 | string s[10] = {
| ^~~~~~
a.cc: In function 'int main()':
a.cc:19:9: error: 'cin' was not declared in this scope
19 | while(cin>>n, (n!=-1)){
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by ad... |
s272499169 | p00228 | C++ | // 0228.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#inc... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s157640564 | p00228 | C++ | #include <cstdio>
using namespace std;
int main(){
int n ,num;
string seg="0000000"; // a b c d e f g の順
string set[10]={ /* 各数字のビット */
"0111111", // 0
"0000110", // 1
"1011011", // 2
"1001111", // 3
"1100110", // 4
"1101101", // 5
"1111101", // 6
"0100111", // 7
"1111111", //... | a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
6 | string seg="0000000"; // a b c d e f g の順
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include <cstdio>
+++ |+#include <... |
s149114582 | p00229 | Java | import java.util.Scanner;
public class Mai {
/**
* @param args
*/
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while(true){
int coin=100;
int b = cin.nextInt();
int r = cin.nextInt();
int g = cin.nextInt();
int c = cin.nextInt();
int s = cin.nextInt();
... | Main.java:3: error: class Mai is public, should be declared in a file named Mai.java
public class Mai {
^
1 error
|
s071626570 | p00229 | C | main(b,r,g,c,s,t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+b*77+r*51+g*4-c-3*t+18*b+3*r+3*g+3*c+3*s)));exit(0);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(b,r,g,c,s,t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+b*77+r*51+g*4-c-3*t+18*b+3*r+3*g+3*c+3*s)));exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
ma... |
s352724972 | p00229 | C | main(b,r,g,c,s,t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+b*95+r*63+g*4-c-3*t+3*g+3*c+3*s)));exit(0);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(b,r,g,c,s,t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+b*95+r*63+g*4-c-3*t+3*g+3*c+3*s)));exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1:... |
s198208904 | p00229 | C | #include <stdio.h>
main(){for(int b,r,g,c,s,t;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+3*s-3*t+2*c+g*7+95*b+63*r));} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){for(int b,r,g,c,s,t;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+3*s-3*t+2*c+g*7+95*b+63*r));}
| ^~~~
|
s315198560 | p00229 | C | b,r,g,c,s,t;main(){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+3*s-3*t+2*c+g*7+95*b+63*r))} | main.c:1:1: warning: data definition has no type or storage class
1 | b,r,g,c,s,t;main(){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100+3*s-3*t+2*c+g*7+95*b+63*r))}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' ... |
s445444498 | p00229 | C++ | #include<stdio.h>
int main(void){
int b,r,g,c,s,t;
while(scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),b+r+g+c+s+t){
point=100;
point+=(b*6+r*4)*15+g*7+c*2+s*3;
point-=(b*5+r*3)*2+(t-b*5-r*3)*3;
printf("%d\n",point);
}
return 0;} | a.cc: In function 'int main()':
a.cc:6:1: error: 'point' was not declared in this scope; did you mean 'printf'?
6 | point=100;
| ^~~~~
| printf
|
s523383641 | p00229 | C++ | main(b,r,g,c,s,t){
for(;~scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t)&&t;)printf("%d\n",b*95+r*63+g*7+c*2+s*3-t*3+100);
} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(b,r,g,c,s,t){
| ^
|
s425558731 | p00229 | C++ | main(b,r,g,c,s,t){
for(;~scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t)&&t;)printf("%d\n",b*95+r*63+g*7-c+(s+c-t)*3+100);
} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(b,r,g,c,s,t){
| ^
|
s883141558 | p00229 | C++ | b,r,g,c,s;
main(t){
for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;)
printf("%d\n",100-(t-s)*3+c*2+g*7+95*b+63*r);return 0;
} | a.cc:1:1: error: 'b' does not name a type
1 | b,r,g,c,s;
| ^
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(t){
| ^
|
s504474884 | p00229 | C++ | b,r,g,c,s;main(t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100-(t-s)*3+c*2+g*7+95*b+63*r));} | a.cc:1:1: error: 'b' does not name a type
1 | b,r,g,c,s;main(t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),t;printf("%d\n",100-(t-s)*3+c*2+g*7+95*b+63*r));}
| ^
a.cc:1:15: error: expected constructor, destructor, or type conversion before '(' token
1 | b,r,g,c,s;main(t){for(;scanf("%d%d%d%d%d%d",&b,&r,&... |
s929462899 | p00230 | C | #include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
struct Node {
int bid, floor, jump;
Node(int b, int f, int j) {
bid = b; floor = f; jump = j;
}
};
int main() {
int B[2][100], i, j, n, f, b, c;
bool visited[2][100];
deque<Node*> q;
Node *node;
whi... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s180905847 | p00230 | C | char*z,a[2][204];n,m,i,c,p;main(s){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],s=*p,c<m&&!s|n+~p;)p+=p<n&&s?~s|z[2]-49?++c,2:1:-1;} | main.c:1:18: warning: data definition has no type or storage class
1 | char*z,a[2][204];n,m,i,c,p;main(s){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],s=*p,c<m&&!s|n+~p;)p+=p<n&&s?~s|z[2]-49?++c,2:1:-1;}
| ^
main.c:1:18: erro... |
s004418242 | p00230 | C | char*z,a[2][204];n,m,i,p;main(c){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],c<m&&*z&2|n+~p;)p+=p==n|z&2?-1:*z&1|z[2]&1?1:!++c+2;} | main.c:1:18: warning: data definition has no type or storage class
1 | char*z,a[2][204];n,m,i,p;main(c){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],c<m&&*z&2|n+~p;)p+=p==n|z&2?-1:*z&1|z[2]&1?1:!++c+2;}
| ^
main.c:1:18: error... |
s264782383 | p00230 | C | #include<stdio.h>
int a[2][100];
int su;
int dfs(int building,int level,int count){
int ret_a=200,ret_b=200,ret_c=200,ret_d=200;
if(count>su*2 || level>su+1) return 200;
if(a[building][level+1]==1) ret_a=dfs(building,level+1,count+1);
else if(su==level-1) return -1;
else if(a[building][level]==2) ret_b=dfs(build... | main.c:21:1: error: expected identifier or '(' before '}' token
21 | }
| ^
|
s159860218 | p00230 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#define fr first
#define sc second
#define INF (2 << 28)
using namespace std;
typedef pair<int, int> iiP;
int n, mas[2][101];
int used[2][101];
int dy[] = {0, 1, 2};
int bfs(int sy, int sx){
queue <iiP> que;
que.push(iiP(... | a.cc: In function 'int bfs(int, int)':
a.cc:21:3: error: 'memset' was not declared in this scope
21 | memset(used, 0, sizeof(used));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#include <cst... |
s504866545 | p00230 | C++ | #include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#define fr first
#define sc second
#define INF (2 << 28)
using namespace std;
typedef pair<int, int> iiP;
int n, mas[2][101];
int used[2][101];
int dy[] = {0, 1, 2};
int bfs(int sy, int sx){
queue <iiP> q... | a.cc: In function 'int main()':
a.cc:84:4: error: expected '}' at end of input
84 | }
| ^
a.cc:73:11: note: to match this '{'
73 | int main(){
| ^
|
s191103752 | p00230 | C++ | #include <queue>
#include <cstdio>
int n, a[100], b[100], d[100][2];
int main() {
while(scanf("%d", &n), n) {
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
for(int i = 0; i < n; i++) scanf("%d", &b[i]);
for(int i = 1; i < n; i++) d[i][0] = -1, d[i][1] = -1;
d[0][0] = 0, d[0][1] = 0;
queue<int> que; que.push... | a.cc: In function 'int main()':
a.cc:10:17: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
10 | queue<int> que; que.push(0); que.push(1);
| ^~~~~
| std::queue
In file included from /usr/include/c++/14/queue:66,
fr... |
s006628068 | p00230 | C++ | #include <queue>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, a[100], b[100], d[100][2];
int main() {
while(scanf("%d", &n), n) {
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
for(int i = 0; i < n; i++) scanf("%d", &b[i]);
for(int i = 1; i < n; i++) d[i][0] = -1, d[i][1] = -1;
d[0][0] = ... | a.cc: In function 'int main()':
a.cc:14:37: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
14 | int x = que.top() / 2, y = que.top() % 2; que.pop();
| ^~~
| pop
a.cc:16:36: error... |
s834390139 | p00230 | C++ | #include <queue>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, a[100], b[100], d[100][2];
int main() {
while(scanf("%d", &n), n) {
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
for(int i = 0; i < n; i++) scanf("%d", &b[i]);
for(int i = 1; i < n; i++) d[i][0] = -1, d[i][1] = -1;
d[0][0] = ... | a.cc: In function 'int main()':
a.cc:30:53: error: 'class std::queue<int>' has no member named 'push_back'
30 | que.push_back(make_pair(tx * 2));
| ^~~~~~~~~
a.cc:30:72: error: no matching function for call to '... |
s903453049 | p00230 | C++ | #include <queue>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, a[100], b[100], d[100][2];
int main() {
while(scanf("%d", &n), n) {
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
for(int i = 0; i < n; i++) scanf("%d", &b[i]);
for(int i = 1; i < n; i++) d[i][0] = -1, d[i][1] = -1;
d[0][0] = ... | a.cc: In function 'int main()':
a.cc:30:67: error: no matching function for call to 'make_pair(int)'
30 | que.push(make_pair(tx * 2));
| ~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_... |
s546898401 | p00230 | C++ | #include<iostream>
#include<cstdio>
#include<queue>
#define P pair<int,int>
using namespace std;
int n[101], m[101], l[2][100], s[2][100], k[2] = { 1,0 };
int main() {
int a;
while (cin >> a, a) {
memset(n, -1, sizeof(n));
memset(m, -1, sizeof(m));
memset(s, -1, sizeof(s));
for (int b = 0; b < a; b++)cin >> ... | a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
11 | memset(n, -1, sizeof(n));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<queue>
+++ |+#... |
s633531348 | p00230 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<map>
#include<unordered_map>
#define P pair<int,int>
using namespace std;
int main() {
int a;
while (cin >> a, a) {
int n[105], m[105]... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(s, -1, sizeof(s));
| ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
11 | #include<map>
+++ |+#i... |
s137028463 | p00230 | C++ | #include<queue>
#include<iostream>
typedef unsigned long long ull;
typedef pair<ull,ull> UL2;
typedef pair<UL2,UL2> ULUL;
typedef pair<ULUL,ULUL> ULMAX;
using namespace std;
int main(){
int n;
int r[110],l[110];
cin >> n;
for(int i=0;i<n;i++)cin >> r[i];
for(int j=0;j<n;j++)cin >> l[j];
queue<ULMAX> que;
while(true... | a.cc:4:9: error: 'pair' does not name a type
4 | typedef pair<ull,ull> UL2;
| ^~~~
a.cc:5:9: error: 'pair' does not name a type
5 | typedef pair<UL2,UL2> ULUL;
| ^~~~
a.cc:6:9: error: 'pair' does not name a type
6 | typedef pair<ULUL,ULUL> ULMAX;
| ^~~~
a.cc: In fun... |
s894513434 | p00230 | C++ | #include<iostream>
#include<cassert>
#include<ctime>
#include<climits>
#include<queue>
#include<fstream>
#include<deque>
#include<iomanip>
#include<list>
#include<stack>
#include<sstream>
#include<string>
#include<cctype>
#include<cstdio>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<c... | a.cc: In function 'int main()':
a.cc:164:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
164 | ans.run();
| ^~~
| abs
|
s812142032 | p00230 | C++ | #include<cstdio>
#include<map>
#include<queue>
#include<algorithm>
#define INF (1<<25)
using namespace std;
int buil[2][105], shortest[2][105];
int dfs(int a, int b){
if(b == 0)return shortest[a][b] = 1;
if(b < n - 1 && buil[a][b] == 1 && buil[a][b + 1] == 1)return shortest[a][b] = INF - 1;
if(buil[a][b] == 2)r... | a.cc: In function 'int dfs(int, int)':
a.cc:12:10: error: 'n' was not declared in this scope
12 | if(b < n - 1 && buil[a][b] == 1 && buil[a][b + 1] == 1)return shortest[a][b] = INF - 1;
| ^
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
17 | }
| ^
|
s629953133 | p00230 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> T;
#define INF (1 << 30)
int n, dist[2][210], window[2][210];
vector<T> edge[2][210];
bool come[2][210];
int main(){
while(cin >> n, n){
for(int j = 0;j < 2;j++)... | a.cc: In function 'int main()':
a.cc:59:12: error: 'res' was not declared in this scope
59 | if(res == INF)cout << "NA" << endl;
| ^~~
|
s529286641 | p00230 | C++ | #include <queue>
#include <tuple>
#include <cstdio>
using namespace std;
typedef tuple<int,int,int> tiii; //building, floor, depth
int M[2][101],B[2][101];
int main(){
int n,i;
for(;scanf("%d",&n),n;){
for(i=0;i<n;i++)scanf("%d",B[0]+i);
for(i=0;i<n;i++)scanf("%d",B[1]+i);
memset(M,99,sizeof(M));
queue<tiii> ... | a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
12 | memset(M,99,sizeof(M));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+#... |
s189855557 | p00230 | C++ | #include <queue>
#include <tuple>
#include <cstdio>
using namespace std;
#define SENTINEL 99999
typedef tuple<int,int,int> tiii; //building, floor, depth
int M[2][101],B[2][101],n;
int bfs(int i){
memset(M,99,sizeof(M));
queue<tiii> q;
q.push(make_tuple(i,0,0));M[i][0]=0;
for(;!q.empty();){
tiii t=q.front();... | a.cc: In function 'int bfs(int)':
a.cc:9:17: error: 'memset' was not declared in this scope
9 | memset(M,99,sizeof(M));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+... |
s705768286 | p00231 | C++ | #inlcude<cstdio>
using namespace std;
int m[100],a[100],b[100],n;
bool judge(int x){
int w=0;
for(int i=0;i<n;i++)
if(a[i]<=x&&b[i]>x)w+=m[i];
return w<=150;
}
int main(){
while(stanf("%d",&n)&&n){
for(int i=0;i<n;i++)scanf("%d%d%d",m+i,a+i,b+i);
bool res=true;
for(int i=... | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude<cstdio>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:11:11: error: 'stanf' was not declared in this scope
11 | while(stanf("%d",&n)&&n){
| ^~~~~
a.cc:12:29: error: 'scanf' ... |
s374911017 | p00231 | C++ | //I'm beginner.
//n個の区間がある。i(>=0)個目の区間は[a, b)で重さmである。
//ある点xについて、xを含むまたはxと接する区間が151以上になるならNG, ならないならOKと出力。
//考察:
//関係ない点を除く、座標圧縮をする、それだけ。
#include <iostream>
#include <set>
#include <map>
using namespace std;
int n;
int m[100], a[100], b[100];
int time[2000];
void compress() {
int i;
set<int> comp;
map<int, int> i... | a.cc:13:14: error: 'int time [2000]' redeclared as different kind of entity
13 | int time[2000];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/g... |
s723284811 | p00231 | C++ | #include<iostream>
#include<vector>
using namespace std;
class Hito{
public:
int m,a,b;
hito();
void set(int mm, int aa, int bb){
m = mm;
a = aa;
b = bb;
}
};
int main()
{
for(;;){
int n;
int m, a, b;
int finTime = 0;
int nowg = 0;
bool flg = false;
vector<Hito> data(n);
cin >> n;
if(n... | a.cc:9:9: error: ISO C++ forbids declaration of 'hito' with no type [-fpermissive]
9 | hito();
| ^~~~
|
s488150888 | p00231 | C++ | #include <iostream>
#include <vector>
using namespace std;
void solve()
{
int n;
while(cin >> n, n)
{
vector<int> weight(n + 1);
vector<int> start(n + 1);
vector<int> end(n);
vector<int> order_start(n + 1);
vector<int> order_end(n);
for(int i = 0; i < n; ++i)
{
cin >> weight[i] >> start[i] >> end[... | a.cc: In function 'void solve()':
a.cc:22:29: error: 'INT_MAX' was not declared in this scope
22 | weight[n] = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <vec... |
s663665442 | p00231 | C++ | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
int main() {
int n;
while(cin>>n, n) {
vector<pair<int,int> > v(n*2);
for(int i=0; i<n; i++) {
int mass, begin, end;
cin >> mass >> begin >> end;
// テヲツゥツ凝」ツ?クテ」ツ?凝」ツ?凝」ツつ凝ィツイツ?ィツ債キテ」ツ?ョテ・ツ「ツ療ヲツクツ崚」ツ?ョテ・ツ「ツεァ... | a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(v.begin(), v.end());
| ^~~~
| short
|
s905141495 | p00231 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
class person
{
public:
int start, end, weight;
person(int start=0, int end=0, int weight =... | a.cc:34:1: error: '::main' must return 'int'
34 | bool main(void)
| ^~~~
a.cc: In function 'int main()':
a.cc:38:17: error: reference to 'data' is ambiguous
38 | data.resize(n);
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/inclu... |
s388431621 | p00232 | Java | import java.util.Scanner;
public class P0232 {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
while(true) {
int x = sc.nextInt();
int y = sc.nextInt();
int z = sc.nextInt();
if (x+y+z==0) {
break;
}
int v[] = new int[x];
for (int i=0;i<x;i++) {
v[i] = sc.... | Main.java:2: error: class P0232 is public, should be declared in a file named P0232.java
public class P0232 {
^
1 error
|
s225291958 | p00232 | C | #include<stdio.h>
int x,y,z;
int v[4],n,e[50],a[50];
double dp[51][4901];
int min(int in1,int in2) {
return in1>in2?in2:in1;
}
int max(int in1,int in2) {
return in1<in2?in2:in1;
}
double dfs(int current,int money){
double sum=0;
int i,j;
if(current==0) for(i=0;i<51;i++) for(j=0;j<4901;j++) dp[i][j]=-1;
if(curr... | main.c: In function 'main':
main.c:35:15: error: 'true' undeclared (first use in this function)
35 | while(true){
| ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbo... |
s657655555 | p00232 | C++ | #include<iostream>
#include<algorithm>
int x, y, z;
double dp[51][5100];
int rulet[5];
std::pair<int, int>event[51];
int main(){
memset(dp, 0, sizeof(dp));
std::cin >> x >> y >> z;
for (int i = 0; i < x; i++){
std::cin >> rulet[i];
}
for (int i = 0; i < z; i++){
int n, e, a;
std::cin >> n >> e >> a;
ev... | a.cc: In function 'int main()':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cst... |
s313915476 | p00232 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <complex>
#include <queue>
#include <deque>
#include <cmath>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,a) FOR(i,0,a)
#define FORE(i,a,b) for(int i=(a);i<=(int)(b);i++)
using namespace std;
typedef c... | a.cc: In function 'int main()':
a.cc:66:2: error: expected '}' at end of input
66 | }
| ^
a.cc:22:12: note: to match this '{'
22 | int main() {
| ^
|
s729590695 | p00232 | C++ | #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
double EPS=1e-10;
int INF=1e9;
struct dat{
int x,turn,sum;
dat(){}
dat(int x,int turn,int su... | a.cc: In function 'int main()':
a.cc:29:33: error: narrowing conversion of '0.0' from 'double' to 'int' [-Wnarrowing]
29 | Q.push((dat){0,0,0.0});
| ^
|
s410969755 | p00232 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int v[4];
int e[51];
int a[51];
double dp[51][5010][2];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int vn, g, en;
while (cin >> vn >> g >> en , vn) {
for (int i = 0; i < vn; i++) {
cin >> v[i];
}
... | a.cc: In function 'int main()':
a.cc:23:17: error: 'memset' was not declared in this scope
23 | memset(e, 0, sizeof e);
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <algorithm>
+++ ... |
s064481054 | p00232 | C++ | #include <cstdio>
#include <vector>
const int kMaxTurn = 64; //1????????????1??\??????????????§, 50???????????\??????????????????.
const int kMaxSquare = 64;
int roulette[4];
typedef struct{
int type;
int value;
} BoardState;
BoardState board[51];
typedef struct{
float prob;
int money;
} BpState;
int bp(int X... | a.cc: In function 'int main()':
a.cc:66:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
66 | scanf_s("%d %d %d", &X, &Y, &Z);
| ^~~~~~~
| scanf
|
s905528892 | p00232 | C++ | #include <cstdio>
#include <map>
#define scanf scanf_s
const int kMaxSquare = 64;
int roulette[4];
typedef struct{
int type;
int value;
} BoardState;
BoardState board[kMaxSquare];
int bp(int X, int Y){
std::map<int, double> bp[kMaxSquare];
double prob = 1.0f / static_cast<double>(X);
bp[0][0] = 1.0f;
for (... | a.cc: In function 'int main()':
a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
4 | #define scanf scanf_s
| ^~~~~~~
a.cc:56:17: note: in expansion of macro 'scanf'
56 | scanf("%d %d %d", &X, &Y, &Z);
| ^~~~~
|
s403412857 | p00232 | C++ | #include <cstdio>
#include <algorithm>
//#define scanf scanf_s
const int kMaxSquare = 64;
const int kMaxMoney = 5100;
const int kMaxGainMoney = 100;
int roulette[4];
typedef struct{
int type;
int value;
} BoardState;
BoardState board[kMaxSquare];
int bp(int X, int Y){
float bp[kMaxSquare][kMaxMoney];
float pr... | a.cc: In function 'int bp(int, int)':
a.cc:28:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
28 | int pos = min(n+roulette[k], Y);
| ^~~
| std::min
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
... |
s974928430 | p00232 | C++ | #include <cstdio>
#include <algorithm>
//#define scanf scanf_s
const int kMaxSquare = 64;
const int kMaxMoney = 5100;
const int kMaxGainMoney = 100;
int roulette[4];
typedef struct{
int type;
int value;
} BoardState;
BoardState board[kMaxSquare];
int bp(int X, int Y){
float bp[kMaxSquare][kMaxMoney];
float pr... | a.cc:25:23: error: stray '\23' in program
25 | pb[n][m] = 0.0f;<U+0013>
| ^~~~~~~~
a.cc: In function 'int bp(int, int)':
a.cc:24:27: error: 'kMaxGainMOney' was not declared in this scope; did you mean 'kMaxGainMoney'?
24 | for(int m = 0; m <= Y*kMaxGainMOney; m++)
| ... |
s067792263 | p00232 | C++ | #include <cstdio>
#include <algorithm>
//#define scanf scanf_s
const int kMaxSquare = 64;
const int kMaxMoney = 5100;
const int kMaxGainMoney = 100;
int roulette[4];
typedef struct{
int type;
int value;
} BoardState;
BoardState board[kMaxSquare];
int bp(int X, int Y){
float bp[kMaxSquare][kMaxMoney];
float pr... | a.cc:25:23: error: stray '\23' in program
25 | bp[n][m] = 0.0f;<U+0013>
| ^~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.