submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s609452895 | p04045 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
int n, k;
vector<int> ds;
int main() {
cin>>n>>k;
ds.clear();
for (int i = 0; i < k; ++i) {
int d;
cin>>d;
ds.push_back(d);
}
set<int> dss(ds.begin(), ds.end());
for... | a.cc: In function 'int main()':
a.cc:29:14: error: 'class std::vector<int>' has no member named 'find'
29 | if (ds.find(t) != ds.end()) break;
| ^~~~
|
s724029040 | p04045 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int n, k;
vector<int> ds;
int main() {
cin>>n>>k;
ds.clear();
for (int i = 0; i < k; ++i) {
int d;
cin>>d;
ds.push_back(d);
}
set<int> dss(ds.begin(), ds.end());
for (int i = n; i ... | a.cc: In function 'int main()':
a.cc:17:3: error: 'set' was not declared in this scope
17 | set<int> dss(ds.begin(), ds.end());
| ^~~
a.cc:6:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
5 | #include <vector>
+++ |+#include <set>
6 | using n... |
s321795190 | p04045 | C++ |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int N, K;
cin >> N >> K;
bool dis[10] = { };
for (int i = 0; i < K; i++) {
int D;
cin >> D;
dis[D] = true;
}
int num[4];
int dig = 0;
while (N > 0) {
num[dig++] = N % 10;
N /= 10;
}
i... | a.cc: In function 'int main()':
a.cc:49:30: error: 'pow' was not declared in this scope
49 | ans = min * (pow(10, dig));
| ^~~
|
s793052367 | p04045 | Java | import java.util.Scanner;
public class Beginner042C {
public static int checkNumber(int num,int[] arr,int k)
{
//System.out.println("First CAll");
int flag=0,r;
while(num>0)
{
r=num%10;
for(int i=0;i<k;i++)
{
if(r==arr[i])
{
flag=1;
System.out.println(flag);
return flag;
... | Main.java:2: error: class Beginner042C is public, should be declared in a file named Beginner042C.java
public class Beginner042C {
^
1 error
|
s321838583 | p04045 | C++ | from itertools import *
if __name__=="__main__":
n,k = map(int,input().split(' '))
d = list(map(int,(input().split(' '))))
d = [i for i in range(10) if i not in d]
ans = 1e10
keta = len(str(n))
for perm in product(d,repeat=keta):
num = 0
for v in perm:
num = 10*num+v... | a.cc:1:1: error: 'from' does not name a type
1 | from itertools import *
| ^~~~
|
s073849109 | p04045 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
int main(){
int n, k;
std::cin >> n >> k;
std::vector<int> D(10)
for(int i = 0; i < k; i++) std::cin >> D[i];
for(int i = n; i <= 10 * n; i++){
std::string s = std::to_string(i);
bool ok = true;
for(... | a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
11 | for(int i = 0; i < k; i++) std::cin >> D[i];
| ^~~
a.cc:11:20: error: 'i' was not declared in this scope
11 | for(int i = 0; i < k; i++) std::cin >> D[i];
| ^
|
s427582712 | p04045 | C++ | #include<iostream>
#include<string>
#include<algorithm>
int main(){
int n, k;
std::cin >> n >> k;
std::vector<int> D(10)
for(int i = 0; i < k; i++) std::cin >> D[i];
for(int i = n; i <= 10 * n; i++){
std::string s = std::to_string(i);
bool ok = true;
for(int j = 0; j < k;... | a.cc: In function 'int main()':
a.cc:9:10: error: 'vector' is not a member of 'std'
9 | std::vector<int> D(10)
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include<algorithm>
+++ |+#include <vector>
4... |
s380008329 | p04045 | C++ | #include <iostream>
#include <vector>
#include <iostream>
#include <cstdio>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#define ll long long
#define pb push_back
#define vi vector<int>
#define ... | a.cc: In function 'int find_more(int)':
a.cc:48:9: error: 'assert' was not declared in this scope
48 | assert(false);
| ^~~~~~
a.cc:14:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
13 | #include <stack>
+++ |+#include <cassert>
... |
s960246533 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool path(vector<vector<int> > v, int a, int b)
{
bool vis[a][b];
memset(vis, false, sizeof(vis));
queue<pair<int, int> > q;
q.push(make_pair(0, 0));
int r[2] = {0, 1};
int c[2] = {1, 0};
int count = 0;
while(!q.empty())
{
... | a.cc: In function 'bool path(std::vector<std::vector<int> >, int, int)':
a.cc:35:23: error: invalid operands of types 'int' and 'double' to binary 'operator%'
35 | return (count % (10e9 + 7));
| ~~~~~ ^ ~~~~~~~~~~
| | |
| int ... |
s657476695 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int dislike(int n,int* d,int k){
int i,j,p,m=n,digit=0;
while(m!=0){
m/=10;
dight++;
}
for(i=0;i<k;i++){
p=n;
for(j=0;j<digit;j++){
for(int i2=0;i2<j;i2++){
p/=10;
}
if(p%10!=d[i])return 1;
}
}
return 0;
}
int main(... | a.cc: In function 'int dislike(int, int*, int)':
a.cc:8:5: error: 'dight' was not declared in this scope; did you mean 'digit'?
8 | dight++;
| ^~~~~
| digit
|
s512005469 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a) (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
IOS;
int n,k;
cin>>n>>k;
string d,a;
for(int i=0;i<k... | a.cc: In function 'int main()':
a.cc:18:9: error: 'npos' was not declared in this scope
18 | while(npos!=to_string(n).find_first_of(a)) ++n;
| ^~~~
|
s553707804 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
string d,a;
for(int i=0;i<k;++i){
cin>>d;
a+=d;
}
while(string::npos!=to_string(N).find_first_of(a))++N;
cout<<n;
}
| a.cc: In function 'int main()':
a.cc:11:33: error: 'N' was not declared in this scope
11 | while(string::npos!=to_string(N).find_first_of(a))++N;
| ^
|
s323710160 | p04045 | C++ | for (int j = 0; j < m; j++){
if (t == 4){
while (n/1000 == d[j] || n/100 == d[j] || n/10 == d[j] || n == d[j]){
n++;
}
}else if (t == 3){
while (n/100 == d[j] || n/10 == d[j] || n == d[j]){
n++;
}
}else if (t == 2){
while (n/10 == d[j] || n == d[j]){
n++;
}
}e... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for (int j = 0; j < m; j++){
| ^~~
a.cc:1:17: error: 'j' does not name a type
1 | for (int j = 0; j < m; j++){
| ^
a.cc:1:24: error: 'j' does not name a type
1 | for (int j = 0; j < m; j++){
| ... |
s556569876 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n ,k;
cin >> n >> k;
vector<int> d(10);
for (i=0;i<k;i++){
int x;
cin >> x;
d.at(x)++;
}
for(i=n;;i++){
string s = to_string(i);
bool b = true;
for(j=0;j<s.size();j++){
if(d.at(s.at(j)-'0')){
b = false;
... | a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
7 | for (i=0;i<k;i++){
| ^
a.cc:12:7: error: 'i' was not declared in this scope
12 | for(i=n;;i++){
| ^
a.cc:15:9: error: 'j' was not declared in this scope
15 | for(j=0;j<s.size();j++){
... |
s505429769 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:24: error: unexpected type
if(Arrays.asList(dislikeNumberInteger).contains(newJ) = false) {
^
required: variable
found: value
1 error
|
s822394828 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:23: error: ';' expected
int newJ == j;
^
Main.java:23: error: not a statement
int newJ == j;
^
2 errors
|
s336139915 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:23: error: unexpected type
if(Arrays.asList(dislikeNumberInteger).contains(j) = false) {
^
required: variable
found: value
1 error
|
s474308335 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:23: error: unexpected type
if(Arrays.asList(dislikeNumberInteger).contains(i) = false) {
^
required: variable
found: value
Main.java:25: error: incompatible types: possible lossy conversion from dou... |
s022910386 | p04045 | C++ | #include<algorithm>
#include<iostream>
int main(void)
{
int n = 0;
int k = 0;
std::cin >> n >> k;
std::vector<int> dis(k);
for(int index = 0; k > index; ++index)
{
std::cin >> dis[index];
}
int base = 1;
int upper = 10;
for(int digit = 0; 5 > digit; ++digit)
{
while(dis.end() != std... | a.cc: In function 'int main()':
a.cc:10:8: error: 'vector' is not a member of 'std'
10 | std::vector<int> dis(k);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include<iostream>
+++ |+#include <vector>
3 | ... |
s599283956 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:40: error: incompatible types: int cannot be converted to String
String answer = Narray[0] + Narray[1] + Narray[2] + Narray[3];
^
1 error
|
s633653222 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
//Listにうまく変換するため
Integer[] dislikeNumberInteger = new Integer[K];
for(int i = 0; i < K; i+... | Main.java:26: error: ')' expected
if(Arrays.asList(dislikeNumberInteger).contains(Narray[i]) {
^
1 error
|
s285696712 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
int[] dislikeNumber = new int[K];
for(int i = 0; i < K; i++) {
dislikeNumber[i] = sc... | Main.java:18: error: incompatible types: possible lossy conversion from double to int
int quotient = devidedNumber / Math.pow(10, i);
^
Main.java:24: error: incompatible types: possible lossy conversion from double to int
devidedNumber = devidedNumber % Math... |
s816721258 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
int[] dislikeNumber = new int[K];
for(int i = 0; i < K; i++) {
dislikeNumber[i] = sc... | Main.java:18: error: incompatible types: possible lossy conversion from double to int
int quotient = devidedNumber / Math.pow(10, i);
^
Main.java:24: error: variable devidedNumber is already defined in method main(String[])
int devidedNumber = devidedNumber ... |
s603133210 | p04045 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = Integer.parseI... | Main.java:17: error: illegal start of expression
dislikeList.add(Integer.parseInt(scanner.next()));)
^
1 error
|
s588005899 | p04045 | C++ | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;
class Scanner{
string[] s;
int i;
char[] cs = new char[] { ' ' };
public Scanner(){
s = new string[0];
i = 0;
}
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Collectio... |
s628460000 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
set<int> d;
for(int i=0;i<k;i++){
int dinput;
cin >> dinput;
d.insert(dinput);
}
for(int i=n;i<100000;i++){
int k=i;
set<int> nn;
while(n > 0){
nn.insert(k % 10);
k /= 10;
}
for(int j=0;... | a.cc: In function 'int main()':
a.cc:21:23: error: 'class std::set<int>' has no member named 'at'
21 | if(d.count(nn.at(j))) break;
| ^~
|
s873254673 | p04045 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <numeric>
#include <iterator>
#define SIZE 100005
#define MOD 1000000007
using namespace std;
class CIrohasObsession {
public:
int func(strin... | /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
|
s125428502 | p04045 | C++ | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author TM
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <numeric>
#include <iterator>
#define ... | a.cc: In member function 'int CIrohasObsession::func(std::string, int, std::set<std::__cxx11::basic_string<char> >)':
a.cc:34:19: error: 'INT_MAX' was not declared in this scope
34 | int ans = INT_MAX;
| ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is prob... |
s122041202 | p04045 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef ... | a.cc: In function 'bool chmax(T&, T)':
a.cc:28:5: error: expected primary-expression before '.' token
28 | ./ a return false;
| ^
a.cc:28:6: error: expected unqualified-id before '/' token
28 | ./ a return false;
| ^
a.cc:28:9: error: expected ';' before 'return'
28 | ./ a retu... |
s452557322 | p04045 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<numeric>
#include<map>
#include<set>
#include<bitset>
#include<regex>
using namespace std;
#define REP(i,m,n) for(int i = m; i < n; i++)
... | /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
|
s910796266 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
return m;
}... | a.cc: In function 'int main()':
a.cc:30:20: error: conflicting declaration 'std::vector<int> w'
30 | vector<int> v(k),w;
| ^
a.cc:26:49: note: previous declaration as 'long long int w'
26 | long long int a=0,b=0,c=0,d=0,k=0,m=0,n=0,h=0,w=0,count=0,ans=0;
| ... |
s264478466 | p04045 | Java | import java.io.*;
import java.util.*;
public class Main{
static MyReader in = new MyReader();
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args){
int N, K;
{int[] a = in.ii(); N = a[0]; K = a[1];}
int[] D = in.ii();
boolean[] no =... | Main.java:17: error: cannot find symbol
no[D[i]] = True;
^
symbol: variable True
location: class Main
1 error
|
s162320622 | p04045 | Java | #include <stdio.h>
int main(void)
{
const int N, K;
scanf("%d %d", &N, &K);
int no[10] = {0};
for(int i = 0; i < K; i++){
int d;
scanf("%d", &d);
no[d] = 1;
}
int i = N;
for(; i <= 10*N; i++){
int j = i;
while(j > 0 && !no[j%10]) j /= 10;
if(!j) break;
}
printf("%d", i);
... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:6: error: class, interface, enum, or record expected
scanf("%d %d", &N, &K);
^
Main.java:8: error: class, interface, enum, or record expected
int n... |
s948180117 | p04045 | C++ | #include<bits/stdc++.h>
#define eoi ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
int main()
{
eoi;
int a,b,q;
char m;
vector<char>v;
cin>>a>>b;
while(b--){
cin>>m;
v.push_back(m);
}
for(int z=0;z<100000;z++){
a+... | a.cc: In function 'int main()':
a.cc:28:15: error: no matching function for call to 'stoi(int&)'
28 | a=stoi(a);
| ~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/... |
s073060041 | p04045 | C++ | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int main(){
int N, K, min = 0, t=0;
bool answer = true;
cin >> N >> K;
vector<char> D(K);
for(int i = 0; i < K; i++){
cin >> D[i];
}
for(int i = N; i < 10N; i++){
answer = true;
for(int j = 0; j... | a.cc: In function 'int main()':
a.cc:13:24: error: unable to find numeric literal operator 'operator""N'
13 | for(int i = N; i < 10N; i++){
| ^~~
|
s987872574 | p04045 | C++ | #include <iostream>
#include <string>
int main()
{
int n, k;
std::cin >> n >> k;
std::string str;
char c;
for(int i = 0; i < k; i++)
{
std::cin >> c;
str += c;
}
while(std::string::npos != to_string(n).find_first_of(str))
{
n++;
}
std::cout << n <... | a.cc: In function 'int main()':
a.cc:18:32: error: 'to_string' was not declared in this scope; did you mean 'std::__cxx11::to_string'?
18 | while(std::string::npos != to_string(n).find_first_of(str))
| ^~~~~~~~~
| std::__cxx11::to_string
I... |
s694820270 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
bool D[10];
int main () {
cin >> N >> K;
ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /= 10;
}
... | a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:8:13: note: to match this '{'
8 | int main () {
| ^
|
s220627924 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
bool D[10] = {0};
int main () {
cin >> N >> K;
ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /= 10;
... | a.cc: In function 'int main()':
a.cc:26:18: error: break statement not within loop or switch
26 | if(num == 0) break;
| ^~~~~
a.cc: At global scope:
a.cc:29:3: error: 'cout' does not name a type
29 | cout << ans << endl;
| ^~~~
a.cc:30:1: error: expected declaration before '}'... |
s663972248 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
vector<bool> D(10);
int main () {
cin >> N >> K;
ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /= 10;
... | a.cc: In function 'int main()':
a.cc:26:18: error: break statement not within loop or switch
26 | if(num == 0) break;
| ^~~~~
a.cc: At global scope:
a.cc:29:3: error: 'cout' does not name a type
29 | cout << ans << endl;
| ^~~~
a.cc:30:1: error: expected declaration before '}'... |
s797454244 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
vector<bool> D(10);
int main () {
cin >> N >> K;
int ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /= ... | a.cc: In function 'int main()':
a.cc:26:18: error: break statement not within loop or switch
26 | if(num == 0) break;
| ^~~~~
a.cc: At global scope:
a.cc:29:3: error: 'cout' does not name a type
29 | cout << ans << endl;
| ^~~~
a.cc:30:1: error: expected declaration before '}'... |
s462408111 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
vector<bool> D[10];
int main () {
cin >> N >> K;
int ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /= ... | a.cc: In function 'int main()':
a.cc:15:12: error: no match for 'operator=' (operand types are 'std::vector<bool>' and 'int')
15 | D[n] = 1;
| ^
In file included from /usr/include/c++/14/vector:67,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64... |
s057261946 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N, K;
int num = 1, ans = 0;
vector<bool> D[10] = {0};
int main () {
cin >> N >> K;
int ans = N;
for (int i = 0; i < K; i++){
int n;
cin >> n;
D[n] = 1;
}
while(1){
num = ans;
while(num > 0){
if (D[num % 10]) break;
num /=... | a.cc:6:23: error: conversion from 'int' to non-scalar type 'std::vector<bool>' requested
6 | vector<bool> D[10] = {0};
| ^
a.cc: In function 'int main()':
a.cc:15:12: error: no match for 'operator=' (operand types are 'std::vector<bool>' and 'int')
15 | D[n] = 1;
| ... |
s012120582 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string n;
int k;
cin >> n>>k;
int d[k];
for(int i=0;i<k;i++){
cin >> d[i];
}
string ans;
bool ok=1;
for(ans=n;ans<"10005";ans++){
int m=n.size();
for(int i=0;i<m&&ok;i++){
for(int j=0;j<k&&ok;j++){
if(ans[i]==s[j]){
... | a.cc: In function 'int main()':
a.cc:13:28: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
13 | for(ans=n;ans<"10005";ans++){
| ~~~^~
a.cc:17:20: error: 's' was not declared in this scope
17 | if(ans[i]==s[j]){
| ^
a.cc:23:22: ... |
s664218628 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string n;
int k;
cin >> n>>k;
int d[k];
for(int i=0;i<k;i++){
cin >> d[i];
}
string ans;
bool ok=1;
for(ans=n;ans<10005;ans++){
int m=n.size();
for(int i=0;i<m&&ok;i++){
for(int j=0;j<k&&ok;j++){
if(ans[i]==s[j]){
... | a.cc: In function 'int main()':
a.cc:13:16: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
13 | for(ans=n;ans<10005;ans++){
| ~~~^~~~~~
| | |
| | int
| std::string {aka ... |
s634578250 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string n;
int k;
cin >> n>>k;
int d[k];
for(int i=0;i<k;i++){
cin >> d[i];
}
string ans;
bool ok=1;
for(ans=n;ans<10005;ans++){
int m=n.size();
for(int i=0;i<m&&ok;i++){
for(int j=0;j<k&&ok;j++){
if(ans[i]==s[j]){
... | a.cc: In function 'int main()':
a.cc:13:16: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
13 | for(ans=n;ans<10005;ans++){
| ~~~^~~~~~
| | |
| | int
| std::string {aka ... |
s011673062 | p04045 | C++ | N,K = map(int, input().split())
l = list(map(int, input().split()))
num = [i for i in range(10) if i not in l]
print(l)
while True:
N_str = str(N)
frag = 0
for i in range(len(N_str)):
if int(N_str[i]) in l:
#print("yes")
frag = 1
break
if frag == 0:
... | a.cc:11:14: error: invalid preprocessing directive #print
11 | #print("yes")
| ^~~~~
a.cc:1:1: error: 'N' does not name a type
1 | N,K = map(int, input().split())
| ^
|
s201531836 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:27:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
27 | int main()
| ^~
a.cc:27:9: note: remove parentheses to default-initialize a variable
27 | int main()
| ^~
| --
a.cc... |
s181138516 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:27:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
27 | int main()
| ^~
a.cc:27:9: note: remove parentheses to default-initialize a variable
27 | int main()
| ^~
| --
a.cc... |
s903830432 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:28:1: error: a function-definition is not allowed here before '{' token
28 | {
| ^
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:13:21: note: to match this '{'
13 | for(int i=a; ;i++){
| ^
a.cc:34... |
s537718580 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:27:15: error: a function-definition is not allowed here before '{' token
27 | int main(void){
| ^
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:13:21: note: to match this '{'
13 | for(int i=a; ;i++){
| ... |
s560957596 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:27:15: error: a function-definition is not allowed here before '{' token
27 | int main(void){
| ^
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:13:21: note: to match this '{'
13 | for(int i=a; ;i++){
| ... |
s514010027 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(u[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:27:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
27 | int main(){
| ^~
a.cc:27:9: note: remove parentheses to default-initialize a variable
27 | int main(){
| ^~
| --
a.... |
s901756508 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
void st(int a,vector<int> u){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(a[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;
... | a.cc: In function 'void st(int, std::vector<int>)':
a.cc:16:9: error: invalid types 'int[int]' for array subscript
16 | if(a[n%10]){
| ^
a.cc:27:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
27 | int main(){
| ^~
a.cc:27:9: note: remove... |
s391118848 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
void ss(int n,vector<int> a(10)){
for(int i=0;i<n;i++){
int f;
cin>>f;
a[f]=1;
}
}
int st(int a,vector<int> a(10)){
for(int i=a; ;i++){
int n=i;
while(n>0){
if(a[n%10]){
break;
}
n/=10;
}
if(n==0){
cout<<i<<endl;... | a.cc:3:28: error: expected ',' or '...' before '(' token
3 | void ss(int n,vector<int> a(10)){
| ^
a.cc:12:26: error: conflicting declaration 'std::vector<int> a'
12 | int st(int a,vector<int> a(10)){
| ~~~~~~~~~~~~^~
a.cc:12:12: note: previous declaration as '... |
s269593721 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
class CIrohasObsession {
public:
void solve(std::istream& cin, std::ostream& cout) {
int n, k;
cin >> n >> k;
vector<int> d_vec(k, 0);
for (int i = 0; i < k; ++i) {
cin >> d_vec[i];
}
while (true){
bool flag =... | /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
|
s018053370 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
vector<int>d_vec(k, 0);
for (int i = 0; i < k; ++i) {
cin >> d_vec[i];
}
int price = n;
while (true){
bool isValid = true;
int digit_cnt = floor(log10(price));
int now = pri... | a.cc: In function 'int main()':
a.cc:37:14: error: expected '}' at end of input
37 | return 0;
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s617323639 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
bool d[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
for (int i = 0; i < k; i++) {
int a
cin >> a;
d[a] = 0;
}
int ans = n;
while (1) {
int i = ans;
bool flag = 1;
wh... | a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before 'cin'
11 | cin >> a;
| ^~~
a.cc:12:11: error: 'a' was not declared in this scope
12 | d[a] = 0;
| ^
|
s299661175 | p04045 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
string n;
int k;
cin >> n >> k;
vector<char> d(k);
rep(i, k) cin >> d[i];
while(true) {
bool flag = true;
rep(i, k) {
if(!(... | a.cc: In function 'int main()':
a.cc:20:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
20 | if(!(find(n.begin(), n.end(), d[i]) == n.end())) flag = fal... |
s028807391 | p04045 | C++ | \#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define sz size()
#define pb(x) push_back(x)
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;
ll maxx(ll x,... | a.cc:1:1: error: stray '\' in program
1 | \#include<bits/stdc++.h>
| ^
a.cc:1:2: error: stray '#' in program
1 | \#include<bits/stdc++.h>
| ^
a.cc:1:3: error: 'include' does not name a type
1 | \#include<bits/stdc++.h>
| ^~~~~~~
a.cc:5:9: error: 'pair' does not name a type
5 | typed... |
s632676485 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
ArrayList<Integer> kList = new ArrayList<>();
ArrayList<Integer> okList = new ArrayList<>();
for ... | Main.java:30: error: bad operand types for binary operator '>'
while (price.indexOf(String.valueOf(i) > -1)) {
^
first type: String
second type: int
1 error
|
s965872773 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
ArrayList<Integer> kList = new ArrayList<>();
ArrayList<Integer> okList = new ArrayList<>();
for ... | Main.java:30: error: bad operand types for binary operator '>'
while (price.indexOf(String.valueOf(i) > -1)) {
^
first type: String
second type: int
1 error
|
s855610279 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] kList = new int[k];
ArrayList<Integer> okList = new ArrayList<>();
for (int i = 0; i < k; i... | Main.java:16: error: cannot find symbol
if (kList.indexOf(i) == -1) {
^
symbol: method indexOf(int)
location: variable kList of type int[]
Main.java:28: error: bad operand types for binary operator '>'
while (price.indexOf(String.valueOf(i) > -1)) {
... |
s604862967 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] list = new int[k];
String price = String.valueOf(n);
for (int i = 0; i < k; i++) {
... | Main.java:14: error: illegal start of expression
while (price.indexOf(String.valueOf(list[i])) > -1)){
^
1 error
|
s604264923 | p04045 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] list = new int[k];
String price = n.toString();
for (int i = 0; i < k; i++) {
lis... | Main.java:11: error: int cannot be dereferenced
String price = n.toString();
^
Main.java:14: error: int cannot be dereferenced
while (price.indexOf(list[i].toString() > -1)){
^
Main.java:15: error: int cannot be dereferenced
int... |
s813336300 | p04045 | Java | import java.util.ArrayList;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
//入力を受け取るためのScanner型インスタンスscanner
Scanner scanner = new Scanner(System.in);
//価格を格納する変数
int price = scanner.nextInt();
//嫌いな数字の個数を格納する変数
int numOfElements = scanner.nextInt();
//嫌いな数字を格納... | Main.java:4: error: class Test is public, should be declared in a file named Test.java
public class Test {
^
1 error
|
s130085216 | p04045 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a... | a.cc: In function 'int main()':
a.cc:81:34: error: expected ';' before '}' token
81 | tmp++
| ^
| ;
82 | }
| ~
|
s281355803 | p04045 | C++ | √#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(... | a.cc:1:1: error: extended character √ is not valid in an identifier
1 | √#include<stdio.h>
| ^
a.cc:1:2: error: stray '#' in program
1 | √#include<stdio.h>
| ^
a.cc:1:1: error: '\U0000221a' does not name a type
1 | √#include<stdio.h>
| ^
In file included from /usr/include/c++/14/iosfwd:42... |
s809909339 | p04045 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a... | a.cc:54:37: error: macro "repi" requires 3 arguments, but only 2 given
54 | repi(k,K){
| ^
a.cc:15:9: note: macro "repi" defined here
15 | #define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
| ^~~~
a.cc: In function 'int ... |
s337909294 | p04045 | C++ | // problem C of contest 042
// the link for problem : https://atcoder.jp/contests/abc042/tasks/arc058_a
#include <iostream>
using namespace std;
int d[10];
bool c(int n)
{
while(n>0){
int t = n%10;
if(d[t]==1)
{
return false;
}
n/=10;
}
return true;
}
int main()
{
int N,K;... | a.cc: In function 'int main()':
a.cc:35:13: error: 'retun' was not declared in this scope
35 | retun 0;
| ^~~~~
|
s045562593 | p04045 | C++ | #include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for(ll i = 0; i < n; i++)
using namespace std;
int dy[4] = { 1, 0, -1, 0 }, dx[4] = { 0, 1, 0, -1 };
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ll n, k;
cin >> n >> k;
vector<char> d(k);
r... | a.cc: In function 'int main()':
a.cc:31:10: error: 'hasD' was not declared in this scope
31 | if (!hasD) {
| ^~~~
a.cc: At global scope:
a.cc:36:3: error: expected unqualified-id before 'return'
36 | return 0;
| ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
37 | }
... |
s161703228 | p04045 | C++ | //////////////** SATYAM * SHIVAM * SUNDARAM **////////////
/**
* author: G.Pavan Kumar
**/
#include<bits/stdc++.h>
using namespace std;
#define eps 1e-9
#define mod 1000000007
#define uos unordered_set // operations take less time compared to set
#define ump unordered_map // operations take less time compared to map
... | a.cc: In function 'int main()':
a.cc:72:28: error: expected ')' before 'i'
72 | if(b[i]&& 6 i>=h){
| ~ ^~
| )
|
s212240300 | p04045 | C++ | //////////////** SATYAM * SHIVAM * SUNDARAM **////////////
/**
* author: G.Pavan Kumar
**/
#include<bits/stdc++.h>
using namespace std;
#define eps 1e-9
#define mod 1000000007
#define uos unordered_set // operations take less time compared to set
#define ump unordered_map // operations take less time compared to map
... | a.cc: In function 'int main()':
a.cc:72:28: error: expected ')' before 'i'
72 | if(b[i]&& 6 i>=h){
| ~ ^~
| )
|
s323752006 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
vector<int> d(k);
for(int i=0;i<k;i++){
cin >> d[i];
}
int ans;
for(int i=n;!b;i++){
int t=i;
bool b=true;
while(t!=0){
for(int j=0;j<k;j++){
if(t%10==d[j]){
b=false;
break;
... | a.cc: In function 'int main()':
a.cc:11:16: error: 'b' was not declared in this scope
11 | for(int i=n;!b;i++){
| ^
|
s120667111 | p04045 | C++ | #include<cstdio>
using namespace std;
bool d[10];
bool Check(int n){
while(n>0){
if(d[n%10]){
return false;
}
n /= 10;
}
return true;
}
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i=0; i<k; i++){
int tmp
scanf("%d", &tmp);
d[tmp] = true;
}
bool found;
while(!Check(... | a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'scanf'
19 | scanf("%d", &tmp);
| ^~~~~
a.cc:20:7: error: 'tmp' was not declared in this scope
20 | d[tmp] = true;
| ^~~
|
s887558257 | p04045 | C++ | #include<cstdio>
using namespace std;
bool d[10];
bool Check(int n){
while(n>0){
if([n%10]){
return false;
}
n /= 10;
}
return true;
}
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i=0; i<k; i++){
int tmp
scanf("%d", &tmp);
d[tmp] = true;
}
bool found;
while(!Check(n... | a.cc: In function 'bool Check(int)':
a.cc:6:10: error: expected ',' before '%' token
6 | if([n%10]){
| ^
| ,
a.cc:6:10: error: expected identifier before '%' token
a.cc: In lambda function:
a.cc:6:14: error: expected '{' before ')' token
6 | if([n%10]){
| ... |
s703082149 | p04045 | C++ | #include<cstdio>
using namespace std;
bool d[10]
bool Check(int n){
while(n>0){
if([n%10]){
return false;
}
n /= 10;
}
return true;
}
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i=0; i<k; i++){
int tmp
scanf("%d", &tmp);
d[tmp] = true;
}
bool found;
while(!Check(n)... | a.cc:4:1: error: expected initializer before 'bool'
4 | bool Check(int n){
| ^~~~
a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'scanf'
19 | scanf("%d", &tmp);
| ^~~~~
a.cc:20:5: error: 'd' was not declared in this scope
20 | d[tmp] = true;
| ^... |
s017313083 | p04045 | C++ | #include<cstdio>
using namespace std;
bool d[10];
bool Check(int n){
while(n>0){
if([d%10]){
return false;
}
n /= 10;
}
return true;
}
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i=0; i<k; i++){
int tmp
scanf("%d", &tmp);
d[tmp] = true;
}
bool found;
while(!Check(n... | a.cc: In function 'bool Check(int)':
a.cc:6:9: warning: capture of variable 'd' with non-automatic storage duration
6 | if([d%10]){
| ^
a.cc:3:6: note: 'bool d [10]' declared here
3 | bool d[10];
| ^
a.cc:6:10: error: expected ',' before '%' token
6 | if([d%10]){
| ... |
s685001826 | p04045 | C++ | #include<cstdio>
using namespace std;
bool d[10]
bool Check(int n){
while(n>0){
if([d%10]){
return false;
}
n /= 10;
}
return true;
}
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i=0; i<k; i++){
int tmp
scanf("%d", &tmp);
d[tmp] = true;
}
bool found;
while(!Check(n))... | a.cc:4:1: error: expected initializer before 'bool'
4 | bool Check(int n){
| ^~~~
a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'scanf'
19 | scanf("%d", &tmp);
| ^~~~~
a.cc:20:5: error: 'd' was not declared in this scope
20 | d[tmp] = true;
| ^... |
s240816825 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int ok[10]={0,1,2,3,4,5,6,7,8,9,0};
int digitPoor(int n)
{
assert(INT_MAX == 2147483647);
assert(n >= 0);
if (n < 10) return 1;
if (n < 100) return 2;
if (n < 1000) return 3;
if (n < 10000) return 4;
if (n < 100000) ... | a.cc:3:34: error: too many initializers for 'int [10]'
3 | int ok[10]={0,1,2,3,4,5,6,7,8,9,0};
| ^
a.cc:20:1: error: expected unqualified-id before '{' token
20 | {
| ^
|
s952424073 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
auto check(int n)
{
while(n>0)
{
int t = n%10;
if(b[t])
return true;
n/=10;
}
return false;
}
int main()
{
int n,k;
cin >>n>>k;
vector<bool>b(10);
for(int i = 0;i<k;i++)
{
int d;
cin >>d;
... | a.cc: In function 'auto check(int)':
a.cc:8:12: error: 'b' was not declared in this scope
8 | if(b[t])
| ^
|
s740916984 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long;
int main()
{
ll N, K, x;
cin >> N >> K;
set<ll> s;
for (auto i = 0; i < 10; i++)
s.insert(i);
for (auto i = 0; i < K; i++)
{
cin >> x;
s.erase(x);
}
while (true)
{
x = N;
ll d... | a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
3 | #define ll long long;
| ^~~~
a.cc:6:5: note: in expansion of macro 'll'
6 | ll N, K, x;
| ^~
a.cc:6:8: error: 'N' was not declared in this scope
6 | ll N, K, x;
... |
s356995438 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
typedef ll long long;
ll N, K, x;
cin >> N >> K;
set<ll> s;
for (auto i = 0; i < 10; i++)
s.insert(i);
for (auto i = 0; i < K; i++)
{
cin >> x;
s.erase(x);
}
while (true)
{
x = N;
... | a.cc: In function 'int main()':
a.cc:6:13: error: 'll' does not name a type
6 | typedef ll long long;
| ^~
a.cc:7:5: error: 'll' was not declared in this scope
7 | ll N, K, x;
| ^~
a.cc:8:12: error: 'N' was not declared in this scope
8 | cin >> N >> K;
| ... |
s952999835 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
#define long long ll;
int main()
{
ll N, K, x;
cin >> N >> K;
set<ll> s;
for (auto i = 0; i < 10; i++)
s.insert(i);
for (auto i = 0; i < K; i++)
{
cin >> x;
s.erase(x);
}
while (true)
{
x = N;
ll d... | a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
6 | ll N, K, x;
| ^~
a.cc:7:12: error: 'N' was not declared in this scope
7 | cin >> N >> K;
| ^
a.cc:7:17: error: 'K' was not declared in this scope
7 | cin >> N >> K;
| ... |
s070341625 | p04045 | C++ | #include <algorithm>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
//前提:解は必ず存在する
int main() {
int N, K;
cin >> N >> K;
vector<int> D;
//配列D、嫌いな数字を入れていく。
for (int i = 0; i < K; i++) {
int d;
cin >> d;
D.push_back(d);
}
int ans = N;
// ... | a.cc: In function 'int main()':
a.cc:30:13: error: overloaded function with no contextual type information
30 | count = 0;
| ^
a.cc:38:17: error: overloaded function with no contextual type information
38 | count = true;
| ^~~~
a.cc:44:15: error: invalid operand... |
s114985967 | p04045 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
using namespace std;
int main() {
int i, num;
int flag = 0;
int n, k, d;
vector<int> v;
cin >> n, k;
for (... | a.cc: In function 'int main()':
a.cc:28:60: error: expected ')' before ';' token
28 | auto result = find(v.begin(), v.end(), num % 10;
| ~ ^
| )
|
s077408298 | p04045 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
using namespace std;
int main() {
int i, num;
int flag = 0;
int n, k, d;
vector<int> v;
cin >> n, k;
for (... | a.cc: In function 'int main()':
a.cc:28:13: error: 'result' was not declared in this scope
28 | result = find(v.begin(), v.end(), num % 10
| ^~~~~~
a.cc:28:55: error: expected ')' before 'if'
28 | result = find(v.begin(), v.end(), num % 10
| ... |
s532852397 | p04045 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <sstream>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include<bits/stdc++.h>
#include<iostream>
#in... | a.cc:47:9: warning: "int" redefined
47 | #define int max3(int a,int b,int c){return max(a,max(b,c));}
| ^~~
a.cc:46:9: note: this is the location of the previous definition
46 | #define int min3(int a,int b,int c){return min(a,min(b,c));}
| ^~~
a.cc:48:9: warning: "int" redefined
48... |
s086231453 | p04045 | C++ | #include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
vector<int> d(k);
for(int i=0;i<k;i++) cin >> d[i];
for(int i=n;n<10000;i++){
int x=i;
bool flag=0;
for(int j=0;j<5;j+... | a.cc: In function 'int main()':
a.cc:23:16: error: 'b' was not declared in this scope
23 | if(b==0) break;
| ^
|
s377517806 | p04045 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repR(i, n) for(ll i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(ll i = n; i >= 0; ++i)
#define FOR(i, m, n) for(ll i = m; i < n; ++i)
#define FORR(i, m, n) for(ll i = m;i >= n;--i)
#define VSORT(v) sort... | a.cc: In function 'int main()':
a.cc:49:33: error: 'cou' was not declared in this scope; did you mean 'cos'?
49 | cou<<i<<endl;
| ^~~
| cos
|
s085718583 | p04045 | C++ | #include<stdio.h>
#include<string.h>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
int dol,n,num,ans;
int judge[10];
int Num[10000];
scanf("%d %d",&dol,&n);
memset(judge,0,sizeof(judge));
for(int i = 0 ; i < n ; i++){
scanf("%d",&num);
judge[num] = 1;
... | a.cc:45:24: error: extended character ’ is not valid in an identifier
45 | printf(’%)
| ^
a.cc: In function 'int main()':
a.cc:45:24: error: '\U00002019' was not declared in this scope
45 | printf(’%)
| ^
a.cc:45:26: error: ... |
s195455092 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, k, arr[100];
void solve() {
for(int x = n; ; ++x){
int tmp = x;
int flag = 1;
while(tmp) {
int num = tmp % 10;
for(int i = 1; i <= k; ++i){
if(num == arr[i]){
flag = 0;x
break;
}
}
tmp = tmp / 10;
if(!flag) break;
}
if(f... | a.cc: In function 'void solve()':
a.cc:15:51: error: expected ';' before 'break'
15 | flag = 0;x
| ^
| ;
16 | break;
... |
s284771157 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,K;
cin>>N>>K;
vector<int> vec(K);
for(int i=0; i<K; i++){
vec[i];
}
int ans=10000;
for(int i=0; i<10000; i++){
int t=0;
for(int k=0; k<K; k++){
if(i%10!=vec[k]){
t++;
}
if(i/10)%10!=vec[k]){
t++;
}
if(i/100)%10!=vec[k]{... | a.cc: In function 'int main()':
a.cc:8:22: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
8 ... |
s826271314 | p04045 | C | #include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define sz(c) (int)(c.size())
#define all(c) c.begin(),c.... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include "bits/stdc++.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s890670308 | p04045 | Java | package demo;
import java.util.*;
public class Main2
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int [] n=new int [10];
while(sc.hasNext())
{
Arrays.fill(n, 0);
int a=sc.nextInt();
int num=sc.nextInt();
for(int i=0;i<num;i++)
{
int temp=sc.nextInt();
n[temp]=1;
... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2
^
1 error
|
s534757661 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int X,N,D[10];
bool calc(int n){
for(int i=0;i<N;i++){//一の位の値がないときture
if(n%10==X[i])return false;
}
return true;
}
int judge(int n){
while (calc(n)) {
n/=10;
if(n==0)return n;//NG
}
return 0;//ok
}
int main()
{
int i,n;
cin>>X>>N;
for(i=... | a.cc: In function 'bool calc(int)':
a.cc:6:15: error: invalid types 'int[int]' for array subscript
6 | if(n%10==X[i])return false;
| ^
a.cc: In function 'int main()':
a.cc:22:13: error: invalid types 'int[int]' for array subscript
22 | cin>>X[i];
| ^
a.cc:24:6: err... |
s454310234 | p04045 | C++ | #include<iostream>
#include<vector>
int pow_10 (int b) {
long c = 1;
for (int i = 0; i < b; ++i) {
c = c * 10;
}
return c;
} //aのb乗
bool good_number (int N, unsigned long K, const std::vector<int> &bad_number) {
bool check = true;
for (unsigned long i = 0; i < K; ++i) {
if (N == bad_number[i]) {
... | a.cc: In function 'int main()':
a.cc:51:11: error: 'detch_up' was not declared in this scope
51 | cout << detch_up (N, K, D) << endl;
| ^~~~~~~~
|
s203595245 | p04045 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
vector<int> D(10,10);
vector<int> number;
for(int i=0;i<k;i++){
cin >>D[i];
}
for(int j=0;j<10;j++){
if(find(D.begin(),D.end(),j)==D.end())
... | a.cc: In function 'int main()':
a.cc:36:22: error: 'pow' was not declared in this scope
36 | ans+=keta[m]*pow(10,3-m);
| ^~~
|
s024193446 | p04045 | C++ | #include <bits/stdc++.h>
using namespace std;
int N,K,m;
vector<int> D(10),;
void dfs(int a){
if(a>=N){m=min(a,m); return;}
else{
for(int i=0;i<=9;i++){
bool w=true;
for(int j=0;j<K;j++){if(i==D[j])w=false;}
if(w){dfs(a*10+i);}
}
}
}
int main() {
cin >> N >> K;
for(int i=0;i<K;i++... | a.cc:4:19: error: expected unqualified-id before ';' token
4 | vector<int> D(10),;
| ^
|
s238780670 | p04045 | C++ | #include<bits/stdc++.h>
using namespace std;
int flag[10];
int Ispossible(int i){
while(i){
if(flag[i%10])return 0;
i/=10;
}
return 1;
}
int main(){
int n,k,p;
cin>>n>>k;
while(k--){
cin>>p;
flag[p]=1;
}
for(int i=n;;i++){
if(isPossible(i)){
cout<<i<<endl;
exit(0);
... | a.cc: In function 'int main()':
a.cc:22:8: error: 'isPossible' was not declared in this scope; did you mean 'Ispossible'?
22 | if(isPossible(i)){
| ^~~~~~~~~~
| Ispossible
|
s734012120 | p04045 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#define Inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
int a[100010];
int vis[100010];
bool check(int n)
{
while(n)
{
if(vis[n%10])
return false;
... | a.cc: In function 'int main()':
a.cc:41:14: error: expected '}' at end of input
41 | return 0;
| ^
a.cc:24:1: note: to match this '{'
24 | {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.