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 (int i = n; i <= 1000000; ++i) {
vector<int> tds;
tds.clear();
int j =i;
while(j) {
tds.push_back(j % 10);
j /= 10;
}
int t;
for (t=0;t < tds.size(); ++t) {
if (ds.find(t) != ds.end()) break;
}
if (t>=tds.size()) {
cout<<i<<endl;
break;
}
}
return 0;
}
|
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 <= 1000000; ++i) {
vector<int> tds;
tds.clear();
int j =i;
while(j) {
tds.push_back(j % 10);
j /= 10;
}
int t;
for (t=0;t < tds.size(); ++t) {
if (ds.find(t) != ds.end()) break;
}
if (t>=tds.size()) {
cout<<i<<endl;
break;
}
}
return 0;
}
|
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 namespace std;
a.cc:17:7: error: expected primary-expression before 'int'
17 | set<int> dss(ds.begin(), ds.end());
| ^~~
a.cc:28:14: error: 'class std::vector<int>' has no member named 'find'
28 | if (ds.find(t) != ds.end()) break;
| ^~~~
|
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;
}
int min;
for (int i = 1; i < 10; i++) {
if (!dis[i]) {
min = i;
break;
}
}
int max;
for (int i = 9; i >= 0; i--) {
if (!dis[i]) {
max = i;
break;
}
}
int maxnum = 0;
for (int i = 0; i < dig; i++) {
maxnum *= 10;
maxnum += max;
}
int ans = 0;
if (maxnum < K) {
ans = min * (pow(10, dig));
} else {
bool same = true;
dig--;
for (int i = dig; i >= 0; i--) {
if (same) {
for (int j = num[i]; j < 10; j++) {
if (!dis[j]) {
ans *= 10;
ans += j;
break;
}
same = false;
}
} else {
ans *= 10;
if (dis[0]) ans += min;
else ans += 0;
}
}
}
cout << ans << endl;
}
|
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;
}
}
num=num/10;
}
//System.out.println(flag);
return flag;
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int k=sc.nextInt();
int arr[]=new int[k];
for(int i=0;i<k;i++)
arr[i]=sc.nextInt();
int num=n;
//System.out.println("HELLO");
if(checkNumber(n,arr,k)!=1)
System.out.println(n);
else
{
while(checkNumber(num,arr,k)==1)
{
num++;
}
}
if(n!=num)
{
System.out.println(num);
}
}
}
|
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
if n <= num and num < ans:
ans = num
print(ans)
|
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(int j = 0; j < k; j++){
if(std::count(s.begin(),s.end(),D[j] + '0')){
ok = false;
break;
}
}
if(ok){
std::cout << i << std::endl;
return 0;
}
}
}
|
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; j++){
if(std::count(s.begin(),s.end(),D[j] + '0')){
ok = false;
break;
}
}
if(ok){
std::cout << i << std::endl;
return 0;
}
}
}
|
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 |
a.cc:9:17: error: expected primary-expression before 'int'
9 | std::vector<int> D(10)
| ^~~
a.cc:10:20: error: 'i' was not declared in this scope
10 | for(int i = 0; i < k; i++) std::cin >> D[i];
| ^
a.cc:17:45: error: 'D' was not declared in this scope
17 | if(std::count(s.begin(),s.end(),D[j] + '0')){
| ^
|
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 sz(a) (int((a).size()))
#define mp make_pair
#define f first
#define s second
#define pii pair<int, int>
using namespace std;
const int mod = 998244353;
const int inf = (int)2e9;
const ll INF = (ll)2e18;
const int N = 100100;
int d[11];
int n, k;
vi dt;
bool present(int x) {
for (int i = 1; i <= k; i++) {
if (d[i] == x) return true;
}
return false;
}
int find_more(int x) {
for (int i = 0; i < sz(dt); i++) {
if (dt[i] > x) {
return dt[i];
}
}
assert(false);
}
vi ans;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n >> k;
for (int i = 1; i <= k; i++) {
cin >> d[i];
}
for (int i = 1; i <= 9; i++) {
if (!present(i)) {
dt.pb(i);
}
}
while (n) {
int x = n % 10;
if (present(x)) {
ans.pb(find_more(x));
} else {
ans.pb(x);
}
n /= 10;
}
for (int i = sz(ans) - 1; i >= 0; i--) {
cout << ans[i];
}
cout << "\n";
return 0;
}
|
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>
14 |
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
49 | }
| ^
|
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())
{
pair<int, int> t = q.front();
q.pop();
int curx = t.first;
int cury = t.second;
vis[curx][cury] == true;
if(curx == a-1 && cury == b-1)
count++;
for(int i = 0; i < 2; i++)
{
int nextx = curx + r[i];
int nexty = cury + c[i];
if((nextx >= 0 && nextx < a) && (nexty >= 0 && nexty < b) && !vis[nextx][nexty] && v[nextx][nexty] == 0)
{
vis[nextx][nexty] = true;
q.push(make_pair(nextx, nexty));
}
}
}
return (count % (10e9 + 7));
}
int main()
{
int a, b, c, d;
cin>>a>>b>>c>>d;
vector<vector<int> > v( a , vector<int> (b, 0));
int rs = a-c, rf = a-1, cs = 0, cf = b-d;
for(int i = rs; i <= rf; i++)
for(int j = cs; j <= cf; j++)
v[i][j] = 1;
ll res = path(v, a, b);
cout<<res<<"\n";
return 0;
}
|
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 double
|
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(){
int i,j,cnt;
int n,k;
cin>>n>>k;
int d[k];
for(i=0;i<k;i++)cin>>d[i];
for(i=0;i<100000;i++){
if(n<=i && !dislike(i,d,k)){
cout<<i;
return 0;
}
}
}
|
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;++i){
cin>>d;
a+=d;
}
while(npos!=to_string(n).find_first_of(a)) ++n;
cout<<n;
}
|
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++;
}
}else{
while (n == d[j]){
n++;
}
}
}
|
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;
}
if(b){
cout << i << endl;
break;
}
}
}
}
|
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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
for(int i = 0; i < 10; i++) {
while(true) {
//System.out.println(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10);
if(Arrays.asList(dislikeNumberInteger).contains(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10) == false) {
if(N < (int) Math.pow(10, i + 1)) {
if(Arrays.asList(dislikeNumberInteger).contains(0)) {
for(int j = 1; j < 10; j++) {
int newJ = j;
if(Arrays.asList(dislikeNumberInteger).contains(newJ) = false) {
for(int k = i; k < -1; k--) {
int newN = newN + j * (int) Math.pow(10, i);
}
}
}
}
System.out.println(N);
return;
}
break;
}
N = N + (int) Math.pow(10, 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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
for(int i = 0; i < 10; i++) {
while(true) {
//System.out.println(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10);
if(Arrays.asList(dislikeNumberInteger).contains(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10) == false) {
if(N < (int) Math.pow(10, i + 1)) {
if(Arrays.asList(dislikeNumberInteger).contains(0)) {
for(int j = 1; j < 10; j++) {
int newJ == j;
if(Arrays.asList(dislikeNumberInteger).contains(newJ) = false) {
for(int k = i; k < -1; k--) {
int newN = newN + j * (int) Math.pow(10, i);
}
}
}
}
System.out.println(N);
return;
}
break;
}
N = N + (int) Math.pow(10, 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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
for(int i = 0; i < 10; i++) {
while(true) {
//System.out.println(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10);
if(Arrays.asList(dislikeNumberInteger).contains(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10) == false) {
if(N < (int) Math.pow(10, i + 1)) {
if(Arrays.asList(dislikeNumberInteger).contains(0)) {
for(int j = 1; j < 10; j++) {
if(Arrays.asList(dislikeNumberInteger).contains(j) = false) {
for(int k = i; k < -1; k--) {
int newN = newN + j * (int) Math.pow(10, i);
}
}
}
}
System.out.println(N);
return;
}
break;
}
N = N + (int) Math.pow(10, 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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
for(int i = 0; i < 10; i++) {
while(true) {
//System.out.println(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10);
if(Arrays.asList(dislikeNumberInteger).contains(N / (int) Math.pow(10, i) - (N / (int) Math.pow(10, i + 1)) * 10) == false) {
if(N < (int) Math.pow(10, i + 1)) {
if(Arrays.asList(dislikeNumberInteger).contains(0)) {
for(int j = 1; j < 10; j++) {
if(Arrays.asList(dislikeNumberInteger).contains(i) = false) {
for(int k = i; k < -1; k--) {
int newN = newN + j * Math.pow(10, i);
}
}
}
}
System.out.println(N);
return;
}
break;
}
N = N + (int) Math.pow(10, 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 double to int
int newN = newN + j * Math.pow(10, i);
^
2 errors
|
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::find(dis.begin(), dis.end(), (n / base) % upper))
{
n += base;
}
if(upper > n)
{
break;
}
}
std::cout << n;
}
|
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 |
a.cc:10:15: error: expected primary-expression before 'int'
10 | std::vector<int> dis(k);
| ^~~
a.cc:13:17: error: 'dis' was not declared in this scope; did you mean 'div'?
13 | std::cin >> dis[index];
| ^~~
| div
a.cc:20:11: error: 'dis' was not declared in this scope; did you mean 'div'?
20 | while(dis.end() != std::find(dis.begin(), dis.end(), (n / base) % upper))
| ^~~
| div
|
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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
int[] Narray = new int[3];
int devidedNumber = N;
for(int i = 3; i > -1; i--) {
int quotient = devidedNumber / (int) Math.pow(10, i);
Narray[3 - i] = quotient;
devidedNumber = devidedNumber % (int) Math.pow(10, i);
}
second:for(int i = 3; i > -1; i--) {
first:while(true) {
if(Arrays.asList(dislikeNumberInteger).contains(Narray[i])) {
continue second;
}
if(Arrays.asList(dislikeNumberInteger).contains(Narray[i]) && Narray[i] != 9) {
Narray[i] = Narray[i] + 1;
continue first;
} else if(Narray[i] == 9) {
Narray[i] = 0;
Narray[i - 1] = Narray[i -1] + 1;
continue first;
}
}
}
String answer = Narray[0] + Narray[1] + Narray[2] + Narray[3];
System.out.println(answer);
}
}
|
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++) {
dislikeNumberInteger[i] = Integer.valueOf(scanner.nextInt());
}
int[] Narray = new int[3];
int devidedNumber = N;
for(int i = 3; i > -1; i--) {
int quotient = devidedNumber / (int) Math.pow(10, i);
Narray[3 - i] = quotient;
devidedNumber = devidedNumber % (int) Math.pow(10, i);
}
second:for(int i = 3; i > -1; i--) {
first:while(true) {
if(Arrays.asList(dislikeNumberInteger).contains(Narray[i]) {
continue second;
}
if(Arrays.asList(dislikeNumberInteger).contains(Narray[i]) && Narray[i] != 9) {
Narray[i] = Narray[i] + 1;
continue first;
} else if(Narray[i] == 9) {
Narray[i] = 0;
Narray[i - 1] = Narray[i -1] + 1;
continue first;
}
}
}
String answer = Narray[0] + Narray[1] + Narray[2] + Narray[3];
System.out.println(answer);
}
}
|
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] = scanner.nextInt();
}
int devidedNumber = N;
int answer = N;
for(int i = 3; i > -1; i--) {
int quotient = devidedNumber / Math.pow(10, i);
if(Arrays.asList(dislikeNumber).contains(quotient)) {
devidedNumber = devidedNumber + 1;
answer = answer + 1;
return;
}
devidedNumber = devidedNumber % Math.pow(10, i);
}
System.out.println(answer);
}
}
|
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.pow(10, i);
^
2 errors
|
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] = scanner.nextInt();
}
int devidedNumber = N;
int answer = N;
for(int i = 3; i > -1; i--) {
int quotient = devidedNumber / Math.pow(10, i);
if(Arrays.asList(dislikeNumber).contains(quotient)) {
devidedNumber = devidedNumber + 1;
answer = answer + 1;
return;
}
int devidedNumber = devidedNumber % Math.pow(10, i);
}
System.out.println(answer);
}
}
|
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 % Math.pow(10, i);
^
Main.java:24: error: incompatible types: possible lossy conversion from double to int
int devidedNumber = devidedNumber % Math.pow(10, i);
^
3 errors
|
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.parseInt(scanner.next());
int K = Integer.parseInt(scanner.next());
List<Integer> dislikeList = new ArrayList<>();
for (int i = 0; i < K; i++) {
dislikeList.add(Integer.parseInt(scanner.next()));)
}
scanner.close();
// n 以上の整数
for (int i = N; i < 100000; i++) {
boolean isCompleted = true;
String tmp = String.valueOf(i);
for (int j = 0; j < tmp.length(); j++) {
int d = Integer.parseInt(String.valueOf(tmp.charAt(j)));
if (dislikeList.contains(d)) {
isCompleted = false;
break;
}
}
if (isCompleted) {
System.out.println(i);
return;
}
}
}
}
|
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;
}
public string next(){
if (i < s.Length) return s[i++];
string st = Console.ReadLine();
while (st == "") st = Console.ReadLine();
s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
if (s.Length == 0) return next();
i = 0;
return s[i++];
}
public int nextInt(){
return int.Parse(next());
}
public int[] ArrayInt(int N, int add = 0){
int[] Array = new int[N];
for (int i = 0; i < N; i++){
Array[i] = nextInt() + add;
}
return Array;
}
public long nextLong(){
return long.Parse(next());
}
public long[] ArrayLong(int N, long add = 0){
long[] Array = new long[N];
for (int i = 0; i < N; i++){
Array[i] = nextLong() + add;
}
return Array;
}
public double nextDouble(){
return double.Parse(next());
}
public double[] ArrayDouble(int N, double add = 0){
double[] Array = new double[N];
for (int i = 0; i < N; i++){
Array[i] = nextDouble() + add;
}
return Array;
}
}
public class procon {
public procon(){}
Scanner cin;
public static int Main(){
new procon().calc();
return 0;
}
void calc(){
cin=new Scanner();
int N=cin.nextInt();
int K=cin.nextInt();
bool[] D=new bool[10];
for(int i=0; i<10; ++i) D[i]=true;
for(int i=0; i<K; ++i){
int d=cin.nextInt();
D[d]=false;
}
int ans=N;
while(true){
bool can=true;
int tmp=ans;
while(tmp>0){
can&=D[tmp%10];
tmp/=10;
}
if(can){
Console.WriteLine(ans);
break;
}
else{
++ans;
}
}
}
}
|
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.Collections.Generic;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Linq;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.IO;
| ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
6 | using System.Text;
| ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
7 | using System.Globalization;
| ^~~~~~
a.cc:8:7: error: expected nested-name-specifier before 'System'
8 | using System.Diagnostics;
| ^~~~~~
a.cc:11:3: error: 'string' does not name a type
11 | string[] s;
| ^~~~~~
a.cc:14:7: error: expected unqualified-id before '[' token
14 | char[] cs = new char[] { ' ' };
| ^
a.cc:16:9: error: expected ':' before 'Scanner'
16 | public Scanner(){
| ^~~~~~~~
| :
a.cc:21:9: error: expected ':' before 'string'
21 | public string next(){
| ^~~~~~~
| :
a.cc:21:10: error: 'string' does not name a type
21 | public string next(){
| ^~~~~~
a.cc:31:9: error: expected ':' before 'int'
31 | public int nextInt(){
| ^~~~
| :
a.cc:34:9: error: expected ':' before 'int'
34 | public int[] ArrayInt(int N, int add = 0){
| ^~~~
| :
a.cc:34:13: error: expected unqualified-id before '[' token
34 | public int[] ArrayInt(int N, int add = 0){
| ^
a.cc:42:9: error: expected ':' before 'long'
42 | public long nextLong(){
| ^~~~~
| :
a.cc:46:9: error: expected ':' before 'long'
46 | public long[] ArrayLong(int N, long add = 0){
| ^~~~~
| :
a.cc:46:14: error: expected unqualified-id before '[' token
46 | public long[] ArrayLong(int N, long add = 0){
| ^
a.cc:54:9: error: expected ':' before 'double'
54 | public double nextDouble(){
| ^~~~~~~
| :
a.cc:58:9: error: expected ':' before 'double'
58 | public double[] ArrayDouble(int N, double add = 0){
| ^~~~~~~
| :
a.cc:58:16: error: expected unqualified-id before '[' token
58 | public double[] ArrayDouble(int N, double add = 0){
| ^
a.cc:65:2: error: expected ';' after class definition
65 | }
| ^
| ;
a.cc: In constructor 'Scanner::Scanner()':
a.cc:17:5: error: 's' was not declared in this scope
17 | s = new string[0];
| ^
a.cc:17:13: error: 'string' does not name a type
17 | s = new string[0];
| ^~~~~~
a.cc: In member function 'int Scanner::nextInt()':
a.cc:32:12: error: expected primary-expression before 'int'
32 | return int.Parse(next());
| ^~~
a.cc:32:12: error: expected ';' before 'int'
a.cc:32:15: error: expected unqualified-id before '.' token
32 | return int.Parse(next());
| ^
a.cc: In member function 'long int Scanner::nextLong()':
a.cc:43:12: error: expected primary-expression before 'long'
43 | return long.Parse(next());
| ^~~~
a.cc:43:12: error: expected ';' before 'long'
a.cc:43:16: error: expected unqualified-id before '.' token
43 | return long.Parse(next());
| ^
a.cc: In member function 'double Scanner::nextDouble()':
a.cc:55:12: error: expected primary-expression before 'double'
55 | return double.Parse(next());
| ^~~~~~
a.cc:55:12: error: expected ';' before 'double'
a.cc:55:18: error: expected unqualified-id before '.' token
55 | return double.Parse(next());
| ^
a.cc: At global scope:
a.cc:67:1: error: expected unqualified-id before 'public'
67 | public class procon {
| ^~~~~~
|
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;j<nn.size();j++){
if(d.count(nn.at(j))) break;
if(j = nn.size()-1){
cout << k << endl;
return 0;
}
}
}
return 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(string price, int n, set<string> diff) {
if(price != ""){
int int_price = stoi(price);
if (int_price >= n) {
return int_price;
}else if (int_price == 0){
return 100000000;
}
}
int ans = 100000000;
for (const auto &item : diff) {
ans = min(ans, func(price + item, n, diff));
}
return ans;
}
void solve(std::istream &cin, std::ostream &cout) {
int n, k;
cin >> n >> k;
set<string> set_dont_use;
set<string> set_all{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
for (int i = 0; i < n; ++i) {
string tmp;
cin >> tmp;
set_dont_use.insert(tmp);
}
set<string> set_diff;
set_difference(set_all.begin(), set_all.end(), set_dont_use.begin(), set_dont_use.end(),
inserter(set_diff, set_diff.end()));
cout << func("", n, set_diff) << endl;
}
};
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
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 SIZE 100005
#define MOD 1000000007
using namespace std;
class CIrohasObsession {
public:
int func(string price, int n, set<string> diff) {
if (price != "") {
int int_price = stoi(price);
if (int_price >= n) {
return int_price;
}
}
int ans = INT_MAX;
for (const auto &item : diff) {
ans = min(ans, func(price + item, n, diff));
}
return ans;
}
void solve(std::istream &cin, std::ostream &cout) {
int n, k;
cin >> n >> k;
set<string> set_dont_use;
set<string> set_all = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
for (int i = 0; i < n; ++i) {
string tmp;
cin >> tmp;
set_dont_use.insert(tmp);
}
set<string> set_diff;
set_difference(set_all.begin(), set_all.end(), set_dont_use.begin(), set_dont_use.end(),
inserter(set_diff, set_diff.end()));
cout << func("", n, set_diff) << endl;
}
};
int main() {
CIrohasObsession solver;
std::istream &in(std::cin);
std::ostream &out(std::cout);
solver.solve(in, out);
return 0;
}
|
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 probably fixable by adding '#include <climits>'
18 | #include <iterator>
+++ |+#include <climits>
19 |
|
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 double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
./ a return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
int N, K;
vector<int> D;
bool iscontain(ll in) {
string s = to_string(in);
// cout << "s is" << s << endl;
REP(j, s.length()) {
REP(k, K) {
if(s[j] - '0' == D[k]) {
return false;
}
}
}
return true;
}
int main() {
cin >> N >> K;
D.resize(K);
REP(i, K) { cin >> D[i]; }
// N円以上
for(ll i = N; i < INF; i++) {
if(iscontain(i)) {
cout << i << endl;
return 0;
}
}
return 0;
}
|
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 return false;
| ^~~~~~~
| ;
|
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++)
#define rep(i,n) REP(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define dup(x,y) (((x)+(y)-1) / (y)) //整数型のまま切り上げ演算する
#define PI 3.14159265359
|
/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;
}
int vec_sum(vector<int> v){
int n=0;
for(int i=0;i<v.size();i++) n+=v[i];
return n;
}
///////////////////////////
int main() {
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;
string s;
bool flag=true;
cin>>n>>k;
vector<int> v(k),w;
rep(i,k) cin>>v[i];
while(flag){
int nn=n;
while(nn!=0){
w.push_back(nn%10);
nn/=10;
}
flag=false;
for(auto x:v){
for(auto y:w){
if(x==y){
flag=true;
break;
}
}
}
n++;
}
cout<<n<<endl;
}
///////////////////////////
|
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;
| ^
a.cc:36:9: error: request for member 'push_back' in 'w', which is of non-class type 'long long int'
36 | w.push_back(nn%10);
| ^~~~~~~~~
a.cc:41:18: error: 'begin' was not declared in this scope
41 | for(auto y:w){
| ^
a.cc:41:18: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note: 'std::begin'
1238 | begin(const valarray<_Tp>& __va) noexcept
| ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note: 'std::filesystem::__cxx11::begin'
608 | begin(recursive_directory_iterator __iter) noexcept
| ^~~~~
a.cc:41:18: error: 'end' was not declared in this scope
41 | for(auto y:w){
| ^
a.cc:41:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note: 'std::end'
1265 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note: 'std::filesystem::__cxx11::end'
613 | end(recursive_directory_iterator) noexcept
| ^~~
|
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 = new boolean[10];
for(int i = 0; i < K; i++){
no[D[i]] = True;
}
int i = N;
for(; i <= 10*N; i++){
int j = i;
while(j > 0 && !no[j%10]) j /= 10;
if(j == 0) break;
}
out.println(i);
}
static class MyReader extends BufferedReader{
MyReader(){
super(new InputStreamReader(System.in));
}
String s(){
try{return readLine();}catch(IOException e){return "";}
}
String[] ss(){
return s().split(" ");
}
int i(){
return Integer.parseInt(s());
}
int[] ii(){
String[] ss = ss();
int[] ii = new int[ss.length];
for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
return ii;
}
long l(){
return Long.parseLong(s());
}
long[] ll(){
String[] ss = ss();
long[] ll = new long[ss.length];
for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
return ll;
}
}
}
|
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);
return 0;
}
|
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 no[10] = {0};
^
Main.java:10: error: class, interface, enum, or record expected
for(int i = 0; i < K; i++){
^
Main.java:10: error: class, interface, enum, or record expected
for(int i = 0; i < K; i++){
^
Main.java:10: error: class, interface, enum, or record expected
for(int i = 0; i < K; i++){
^
Main.java:12: error: class, interface, enum, or record expected
scanf("%d", &d);
^
Main.java:13: error: class, interface, enum, or record expected
no[d] = 1;
^
Main.java:14: error: class, interface, enum, or record expected
}
^
Main.java:17: error: class, interface, enum, or record expected
for(; i <= 10*N; i++){
^
Main.java:17: error: class, interface, enum, or record expected
for(; i <= 10*N; i++){
^
Main.java:17: error: class, interface, enum, or record expected
for(; i <= 10*N; i++){
^
Main.java:19: error: class, interface, enum, or record expected
while(j > 0 && !no[j%10]) j /= 10;
^
Main.java:20: error: class, interface, enum, or record expected
if(!j) break;
^
Main.java:21: error: class, interface, enum, or record expected
}
^
Main.java:23: error: class, interface, enum, or record expected
return 0;
^
Main.java:24: error: class, interface, enum, or record expected
}
^
18 errors
|
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+=z;
string t=to_string(a);
for(int i=0;i<t.length();i++){
for(int s=0;s<v.size();s++){
if(t[i]==v[s]){
i=t.length();
break;
}
if(s+1==v.size()){cout<<t;return 0;}
}
}
a=stoi(a);
}
return 0;
}
|
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/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10)
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note: no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10)
| ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
4432 | stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note: no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
4432 | stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
| ~~~~~~~~~~~~~~~^~~~~
|
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 < to_string(i).size(); j++){
for(int l = 0; l < K;l++){
if(to_string(i).at(j) == D[l]){answer = false;}
}
}
if(answer == true){
min = i;
break;
}
}
cout << min << endl;
}
|
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 << std::endl;
return 0;
}
|
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
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4421:3: note: 'std::__cxx11::to_string' declared here
4421 | to_string(long double __val)
| ^~~~~~~~~
|
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;
}
if(num == 0) {
break;
ans++;
}
cout << ans << endl;
}
|
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;
}
}
if(num == 0) break;
ans++;
}
cout << ans << endl;
}
|
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 '}' token
30 | }
| ^
|
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;
}
}
if(num == 0) break;
ans++;
}
cout << ans << endl;
}
|
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 '}' token
30 | }
| ^
|
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 /= 10;
}
}
if(num == 0) break;
ans++;
}
cout << ans << endl;
}
|
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 '}' token
30 | }
| ^
|
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 /= 10;
}
}
if(num == 0) break;
ans++;
}
cout << ans << endl;
}
|
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-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:894:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
894 | operator=(const vector& __x)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:894:31: note: no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
894 | operator=(const vector& __x)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:926:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
926 | operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:926:26: note: no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
926 | operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
| ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:952:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
952 | operator=(initializer_list<bool> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:952:40: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
952 | operator=(initializer_list<bool> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:22:21: error: could not convert 'D[(num % 10)]' from 'std::vector<bool>' to 'bool'
22 | if (D[num % 10]) break;
| ~~~~~~~~~~^
| |
| std::vector<bool>
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 '}' token
30 | }
| ^
|
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 /= 10;
}
}
if(num == 0) break;
ans++;
}
cout << ans << endl;
}
|
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;
| ^
In file included from /usr/include/c++/14/vector:67,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:894:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
894 | operator=(const vector& __x)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:894:31: note: no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
894 | operator=(const vector& __x)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:926:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
926 | operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:926:26: note: no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
926 | operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
| ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:952:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
952 | operator=(initializer_list<bool> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:952:40: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
952 | operator=(initializer_list<bool> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:21:21: error: could not convert 'D[(num % 10)]' from 'std::vector<bool>' to 'bool'
21 | if (D[num % 10]) break;
| ~~~~~~~~~~^
| |
| std::vector<bool>
a.cc:25:18: error: break statement not within loop or switch
25 | if(num == 0) break;
| ^~~~~
a.cc: At global scope:
a.cc:28:3: error: 'cout' does not name a type
28 | cout << ans << endl;
| ^~~~
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
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]){
ok=0;
}
}
}
if(ok){
cout<<ans<<endl
return 0;
}
}
}
|
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: error: expected ';' before 'return'
23 | cout<<ans<<endl
| ^
| ;
24 | return 0;
| ~~~~~~
|
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]){
ok=0;
}
}
}
if(ok){
cout<<ans<<endl
return 0;
}
}
}
|
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 std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::basic_
|
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]){
ok=0;
}
}
}
if(ok){
cout<<"ana"<<endl
return 0;
}
}
}
|
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 std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
13 | for(ans=n;ans<10005;ans++){
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: mismatched types 'const std::__cxx11::basic_
|
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:
break
else:
N += 1
print(N)
|
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;
break;
}
int main()
{
int n,k;
cin>>n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
return;
}
}
|
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:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:28:1: error: a function-definition is not allowed here before '{' token
28 | {
| ^
a.cc:36:4: error: expected '}' at end of input
36 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main()
{
int n,k;
cin>>n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
return;
}
|
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:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:28:1: error: a function-definition is not allowed here before '{' token
28 | {
| ^
a.cc:35:2: error: expected '}' at end of input
35 | }
| ^
a.cc:13:21: note: to match this '{'
13 | for(int i=a; ;i++){
| ^
a.cc:35:2: error: expected '}' at end of input
35 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(void)
{
int n,k;
cin>>n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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:2: error: expected '}' at end of input
34 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(void){
int n,k;
cin>>n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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++){
| ^
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(void){
int n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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++){
| ^
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(){
int n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:27:11: error: a function-definition is not allowed here before '{' token
27 | int main(){
| ^
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++){
| ^
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(){
int n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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 parentheses to default-initialize a variable
27 | int main(){
| ^~
| --
a.cc:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:27:11: error: a function-definition is not allowed here before '{' token
27 | int main(){
| ^
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++){
| ^
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:12:29: note: to match this '{'
12 | void st(int a,vector<int> u){
| ^
|
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;
break;
}
int main(){
int n,k;
vector<int> a(10);
ss(k,a);
st(n,a);
}
|
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 'int a'
12 | int st(int a,vector<int> a(10)){
| ~~~~^
a.cc:12:27: error: expected ',' or '...' before '(' token
12 | int st(int a,vector<int> a(10)){
| ^
a.cc: In function 'int st(...)':
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 parentheses to default-initialize a variable
27 | int main(){
| ^~
| --
a.cc:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:27:11: error: a function-definition is not allowed here before '{' token
27 | int main(){
| ^
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++){
| ^
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:12:32: note: to match this '{'
12 | int st(int a,vector<int> a(10)){
| ^
a.cc:32:2: warning: no return statement in function returning non-void [-Wreturn-type]
32 | }
| ^
|
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 = true;
int price = n;
for (int i = 0; i < floor(log10(n))+1; ++i) {
int digit = price%10;
if (find(d_vec.begin(), d_vec.end(), digit) != d_vec.end()){
flag = false;
}
price /= 10;
}
if (flag){
cout << n << endl;
break;
}
n++;
}
}
};
|
/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 = price;
for (int digit = 0; digit < digit_cnt+1; ++digit) {
int tmp = now % 10;
auto iter = find(d_vec.begin(), d_vec.end(), tmp);
if (iter != d_vec.end()){
isValid = false;
break;
}
now /= 10;
}
if (isValid){
cout << price << endl;
break;
}
price++;
}
return 0;
|
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;
while (i != 0) {
if (!d[i%10]) flag = 0;
i /= 10;
}
if (flag) break;
ans++;
}
cout << ans << endl;
return 0;
}
|
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(!(find(n.begin(), n.end(), d[i]) == n.end())) flag = false;
}
if(flag) {
break;
} else {
n = to_string(stoi(n)+1);
}
}
cout << n << '\n';
return 0;
}
|
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 = false;
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:20:16: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
20 | if(!(find(n.begin(), n.end(), d[i]) == n.end())) flag = false;
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
|
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,ll y,ll z){
return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
return min(min(x,y),z);
}
ll gcd(ll x,ll y){
if(x%y==0) return y;
else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
return x*(y/gcd(x,y));
}
ll myceil(ll x,ll y){//yがいくつ集まったらx以上になるか
if(x<=y) return 1;
else if(x%y==0) return x/y;
else return x/y+1;
}
vector<ll> time10(19,1);
vector<bool> d(10,true);
bool check(ll x,ll y){
ll tmp=x;
for(int i=y-1;i>=0;i--){
if(d[tmp/time10[i]]==false) return false;
tmp%=time10[i];
}
return true;
}
//a,b x
int main(){
rep1(i,18) time10[i]=10*time10[i-1];
ll N,K; cin>>N>>K;
rep(i,K){
ll tmp; cin>>tmp;
d[tmp]=false;
}
ll i=0;
while(time10[i]<=N){
i++;
}
while(1){
if(check(N,i)){
cout<<N;
return 0;
}
N++;
}
}
|
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 | typedef pair<ll,ll> P;
| ^~~~
a.cc: In function 'll maxx(ll, ll, ll)':
a.cc:16:20: error: 'max' was not declared in this scope; did you mean 'maxx'?
16 | return max(max(x,y),z);
| ^~~
| maxx
a.cc:16:16: error: 'max' was not declared in this scope; did you mean 'maxx'?
16 | return max(max(x,y),z);
| ^~~
| maxx
a.cc: In function 'll minn(ll, ll, ll)':
a.cc:19:20: error: 'min' was not declared in this scope; did you mean 'minn'?
19 | return min(min(x,y),z);
| ^~~
| minn
a.cc:19:16: error: 'min' was not declared in this scope; did you mean 'minn'?
19 | return min(min(x,y),z);
| ^~~
| minn
a.cc: At global scope:
a.cc:34:1: error: 'vector' does not name a type
34 | vector<ll> time10(19,1);
| ^~~~~~
a.cc:35:1: error: 'vector' does not name a type
35 | vector<bool> d(10,true);
| ^~~~~~
a.cc: In function 'bool check(ll, ll)':
a.cc:40:20: error: 'd' was not declared in this scope
40 | if(d[tmp/time10[i]]==false) return false;
| ^
a.cc:40:26: error: 'time10' was not declared in this scope
40 | if(d[tmp/time10[i]]==false) return false;
| ^~~~~~
a.cc:41:22: error: 'time10' was not declared in this scope
41 | tmp%=time10[i];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:48:20: error: 'time10' was not declared in this scope
48 | rep1(i,18) time10[i]=10*time10[i-1];
| ^~~~~~
a.cc:49:17: error: 'cin' was not declared in this scope
49 | ll N,K; cin>>N>>K;
| ^~~
a.cc:52:17: error: 'd' was not declared in this scope
52 | d[tmp]=false;
| ^
a.cc:55:15: error: 'time10' was not declared in this scope
55 | while(time10[i]<=N){
| ^~~~~~
a.cc:60:25: error: 'cout' was not declared in this scope
60 | cout<<N;
| ^~~~
|
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 (int i = 0; i < k; i++) {
kList.add(sc.nextInt());
}
for (int i = 0; i < 10; i++) {
if (kList.indexOf(i) == -1) {
okList.add(i);
}
}
String price = String.valueOf(n);
int okIndex = 0;
boolean isNine = false;
for (int i = 0; i < 10; i++) {
String s = String.valueOf(i);
if (kList.indexOf(s) > -1 &&
price.indexOf(s) > -1) {
if (i == 9) {
while (price.indexOf(String.valueOf(i) > -1)) {
n += Math.pow(10, price.length() - price.indexOf(i));
price = String.valueOf(n);
}
i = -1;
} else {
if (okList.get(okIndex) < i) {
okIndex++;
}
price.replaceAll(s, String.valueOf(okList.get(okIndex)));
n = Integer.parseInt(price);
}
}
}
System.out.println(price);
}
}
|
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 (int i = 0; i < k; i++) {
kList.add(sc.nextInt());
}
for (int i = 0; i < 10; i++) {
if (kList.indexOf(i) == -1) {
okList.add(i);
}
}
String price = String.valueOf(n);
int okIndex = 0;
boolean isNine = false;
for (int i = 0; i < 10; i++) {
String s = String.valueOf(i);
if (kList.indexOf(s) > -1 &&
price.indexOf(s) > -1) {
if (i == 9) {
while (price.indexOf(String.valueOf(i) > -1)) {
n += Math.pow(10, price.length() - price.indexOf(i));
price = String.valueOf(n);
}
isNine = true;
} else {
if (okList.get(okIndex) < i) {
okIndex++;
}
price.replaceAll(s, String.valueOf(okList.get(okIndex)));
n = Integer.parseInt(price);
}
}
}
if (isNine) {
int lim = okList.get(0);
String limS = String.valueOf(lim);
for (int i = 0; i < lim; i++) {
String target = String.valueOf(i);
if (price.indexOf(target) > -1) {
price.replace(target, String.valueOf(lim));
}
}
}
System.out.println(price);
}
}
|
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++) {
kList[i] = sc.nextInt();
}
for (int i = 0; i < 10; i++) {
if (kList.indexOf(i) == -1) {
okList.add(i);
}
}
String price = String.valueOf(n);
int okIndex = 0;
boolean isNine = false;
for (int i = 0; i < 10; i++) {
if (price.indexOf(String.valueOf(i)) > -1) {
if (i == 9) {
while (price.indexOf(String.valueOf(i) > -1)) {
n += Math.pow(10, price.length() - price.indexOf(i));
price = String.valueOf(n);
}
isNine = true;
} else {
if (okList.get(okIndex) < i) {
okIndex++;
}
price.replaceAll(String.valueOf(i), okList.get(okIndex));
n = Integer.parseInt(price);
}
}
}
if (isNine) {
int lim = okList.get(0);
String limS = String.valueOf(lim);
for (int i = 0; i < lim; i++) {
String target = String.valueOf(i);
if (price.indexOf(target) > -1) {
price.replace(target, lim);
}
}
}
System.out.println(price);
}
}
|
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)) {
^
first type: String
second type: int
Main.java:38: error: incompatible types: Integer cannot be converted to String
price.replaceAll(String.valueOf(i), okList.get(okIndex));
^
Main.java:49: error: no suitable method found for replace(String,int)
price.replace(target, lim);
^
method String.replace(char,char) is not applicable
(argument mismatch; String cannot be converted to char)
method String.replace(CharSequence,CharSequence) is not applicable
(argument mismatch; int cannot be converted to CharSequence)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
|
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++) {
list[i] = sc.nextInt();
while (price.indexOf(String.valueOf(list[i])) > -1)){
int index = price.indexOf(String.valueOf(list[i]));
n += Math.pow(10, price.length() - index);
price = String.valueOf(n);
}
}
for (int i = 0; i < k; i++) {
while (price.indexOf(String.valueOf(list[i]) > -1)){
int index = price.indexOf(String.valueOf(list[i]));
n += Math.pow(10, price.length() - index);
price = String.valueOf(n);
}
}
System.out.println(price);
}
}
|
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++) {
list[i] = sc.nextInt();
while (price.indexOf(list[i].toString() > -1)){
int index = price.indexOf(list[i].toString());
n += Math.pow(10, price.length() - index);
price = n.toString();
}
}
for (int i = 0; i < k; i++) {
while (price.indexOf(list[i].toString() > -1)){
int index = price.indexOf(list[i].toString());
n += Math.pow(10, price.length() - index);
price = n.toString();
}
}
System.out.println(price);
}
}
|
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 index = price.indexOf(list[i].toString());
^
Main.java:17: error: int cannot be dereferenced
price = n.toString();
^
Main.java:22: error: int cannot be dereferenced
while (price.indexOf(list[i].toString() > -1)){
^
Main.java:23: error: int cannot be dereferenced
int index = price.indexOf(list[i].toString());
^
Main.java:25: error: int cannot be dereferenced
price = n.toString();
^
7 errors
|
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();
//嫌いな数字を格納する配列
int[] dislikeNums = new int[numOfElements];
//配列に格納
for (int i = 0; i < dislikeNums.length; i++) {
dislikeNums[i] = scanner.nextInt();
}
scanner.close(); //scannerに使用しているメモリを解放
/*支払額の候補を1円ずつ増加させて、
条件を満たしているかどうか確認する*/
boolean flag = false; //条件を満たしているかどうかを管理する変数
String stringPay; //payをString型に変換したものを格納する変数
ArrayList<Integer> payArray = new ArrayList<Integer>();// 支払予定額に使われている数字を格納するArrayList
int pay = 0; //支払予定額を格納する変数
updateLoop: //支払予定額を更新するループ
for (pay = price;; pay++) {
//flagの初期値を設定(支払予定額が条件に合致すると仮定する)
flag = false;
//payを分解して、配列payArrayに1文字ずつ格納する
stringPay = String.valueOf(pay);//payを分解する準備として、int型をString型に変換する
for (int i = 0; i < stringPay.length(); i++) {
//char型をInt型に変換することで、Integer型のArrayListに格納する
payArray.add(Character.digit(stringPay.charAt(i), 10));
}
detectLoop: //要素を照合するループ
for (Integer dislikeNum : dislikeNums) {
flag = payArray.contains(dislikeNum);
/*もし支払予定額に嫌いな数字が含まれていたならば、
照合ループを抜けて支払予定額を更新する*/
if (flag == true) {
break detectLoop;
}
}
/*flagが更新されなかったら(支払予定額が条件に合致すれば)、
ループを抜ける */
if (flag == false) {
break updateLoop;
}
payArray.clear(); //次のループに持ち越されないように、ArrayListの中身を空にする
}
System.out.println(pay);
}
}
|
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); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
string N,ans;
int K;
bool ger=true;
int main(){
cin>>N>>K;
char D[K],tmp;
rep(i,K)cin>>D[i];
rep(i,N.length()){
tmp=N[i];
rep(j,K){
if(tmp==D[j]){
if(tmp=='9')ger=false;
else tmp++;
}
}
}
if(ger){
rep(i,N.length()){
tmp = N[i];
rep(j,K){
if(tmp==D[j])tmp++;
}
ans+=tmp;
}
}
else{
// out("a");
tmp=N[0]+1;
rep(i,K){
if(tmp!=D[i]){
if(D[i]!='0'){
ans+=tmp;
break;
}
}
else{
if(tmp=='9'){
tmp='1';
rep(j,K){
if(tmp!=D[j]){
if(D[j]!='0'){
ans+=tmp;
break;
}
}
else{
if(tmp=='9'){
tmp='1';
}
else tmp++;
}
}
char tmp='0';
rep(j,K){
if(D[j]!=tmp){
ans+=tmp;
break;
}
tmp++
}
break;
}
else tmp++;
}
}
repi(i,1,N.length()){
char tmp='0';
rep(j,K){
if(D[j]!=tmp){
ans+=tmp;
break;
}
tmp++;
}
}
}
out(ans);
}
|
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); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
string N,ans;
int K;
bool ger=false;
int main(){
cin>>N>>K;
char D[K];
rep(i,K)cin>>D[i];
rep(i,N.length()){
if(ger){
char tmp = '0';
rep(j,K){
if(tmp==D[j])tmp++;
else break;
}
ans+=tmp;
}
else{
char tmp = N[i];
rep(j,K){
if(tmp==D[j]){
ger=true;
if(tmp=='9'){
tmp='1';
rep(k,K){
if(tmp!=D[k]){
if(D[k]!='0'){
ans+=tmp;
break;
}
}
else tmp++;
}
tmp='0';
rep(k,K){
if(tmp!=D[k]){
ans+=tmp;
break;
}
tmp++;
}
tmp='n';
}
else{
tmp++;
}
}
}
if(tmp!='n')ans+=tmp;
}
}
out(ans);
}
|
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,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/stdlib.h:32,
from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator n
|
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); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
string N,ans;
int K;
bool ger=false;
int main(){
cin>>N>>K;
char D[K];
rep(i,K)cin>>D[i];
rep(i,N.length()){
if(ger){
char tmp = '0';
rep(j,K){
if(tmp==D[j])tmp++;
else break;
}
ans+=tmp;
}
else{
char tmp = N[i];
rep(j,K){
if(tmp==D[j]){
ger=true;
if(tmp=='9'){
if(D[0]=='0'){
tmp='1';
repi(k,1,K){
if(tmp!=D[k]){
ans+=tmp;
break;
}
}
tmp='0';
repi(k,K){
if(tmp!=D[k]){
ans+=tmp;
break;
}
}
}
else{
tmp='1';
repi(k,1,K){
if(tmp!=D[k]){
ans+=tmp;
break;
}
}
ans+='0';
}
tmp='n';
break;
}
else{
tmp++;
}
}
}
if(tmp!='n')ans+=tmp;
}
}
out(ans);
}
|
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 main()':
a.cc:54:29: error: 'repi' was not declared in this scope
54 | repi(k,K){
| ^~~~
|
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;
cin>>N>>K;
for(int i=0;i<K;i++)
{
int t;
cin>>t;
d[t]=1;
}
while(true)
{
if(c(N))
{
cout<<N;
retun 0;
}
N++;
}
return 0;
}
|
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);
rep(i, k){
cin >> d[i];
}
while(true) {
string tmp = to_string(n);
bool hasD = false;
rep(i, k) {
if (count(tmp.begin(), tmp.end(), d[i]))
hasD = true;
n++;
break;
}
}
if (!hasD) {
cout << n << endl;
return 0;
}
}
return 0;
}
|
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
#define pb push_back
#define pf push_front
#define pof pop_front()
#define pob pop_back()
#define mp make_pair
#define ps(x) push(x) // for stack and queue
#define T top() // for stack
#define FR front()// for queue
#define BA back()// for queue
#define PP pop()// for queue and stack
#define B begin()
#define E end()
#define F first
#define S second
#define SZ size()
#define ins insert
#define MAE max_element
#define MIE min_element
#define cnt(x) count(x)
#define lb(x) lower_bound(x) // returns an it ptng to the element >=x if no such returns end
#define ub(x) upper_bound(x) // returns an it ptng to the element >x if no such returns end
#define rep(i,l,h) for(int i=l;i<h;i++)
#define ds1(i,x) for(auto i=x.begin();i!=x.end();i++)
#define ds2(i,x) for(auto i:x) // easy method to iterate through a ds
#define sq(a) (a)*(a)
#define fib(n) ceil(pow((1+sqrt(5),n)-pow((1-sqrt(5),n)/(float)(pow(2,n)*sqrt(5)
#define FIO {ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
#define dig(n) (int)(log10(n)+1)
#define ss(x,k) substr(x,k) // x is the start pos and k is the length of substr.
#define f(x) find(x)
typedef long long ll;
typedef double dob;
typedef long double ld;
typedef long l;
typedef string str;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vlli;
typedef vector<pair<int,int> > vpii;
typedef pair<int,int> pii;
typedef pair<str,int> psi;
typedef pair<ll,int> pli;
typedef ump<int,int> umpii;
int main(){
FIO
ll n,k;cin>>n>>k;
int a[k];
vb b(n,true);
rep(i,0,k){
cin>>a[i];
b[a[i]]=false;
}
int m;int h=n/(ll)(pow(10,dig(n)-1));
rep(i,1,10){
if(b[i]&& 6 i>=h){
m=i;break;
}}
str s=to_string((ll)m*(ll)pow(10,dig(n)-1));
rep(i,1,s.SZ){
if(!b[s[i]-'0']){
s[i]=m+48;
}
}
cout<<s;
return 0;
}
|
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
#define pb push_back
#define pf push_front
#define pof pop_front()
#define pob pop_back()
#define mp make_pair
#define ps(x) push(x) // for stack and queue
#define T top() // for stack
#define FR front()// for queue
#define BA back()// for queue
#define PP pop()// for queue and stack
#define B begin()
#define E end()
#define F first
#define S second
#define SZ size()
#define ins insert
#define MAE max_element
#define MIE min_element
#define cnt(x) count(x)
#define lb(x) lower_bound(x) // returns an it ptng to the element >=x if no such returns end
#define ub(x) upper_bound(x) // returns an it ptng to the element >x if no such returns end
#define rep(i,l,h) for(int i=l;i<h;i++)
#define ds1(i,x) for(auto i=x.begin();i!=x.end();i++)
#define ds2(i,x) for(auto i:x) // easy method to iterate through a ds
#define sq(a) (a)*(a)
#define fib(n) ceil(pow((1+sqrt(5),n)-pow((1-sqrt(5),n)/(float)(pow(2,n)*sqrt(5)
#define FIO {ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
#define dig(n) (int)(log10(n)+1)
#define ss(x,k) substr(x,k) // x is the start pos and k is the length of substr.
#define f(x) find(x)
typedef long long ll;
typedef double dob;
typedef long double ld;
typedef long l;
typedef string str;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vlli;
typedef vector<pair<int,int> > vpii;
typedef pair<int,int> pii;
typedef pair<str,int> psi;
typedef pair<ll,int> pli;
typedef ump<int,int> umpii;
int main(){
FIO
ll n,k;cin>>n>>k;
int a[k];
vb b(n,true);
rep(i,0,k){
cin>>a[i];
b[a[i]]=false;
}
int m;int h=n/(ll)(pow(10,dig(n)-1));
rep(i,1,10){
if(b[i]&& 6 i>=h){
m=i;break;
}}
str s=to_string((ll)m*(ll)pow(10,dig(n)-1));
rep(i,1,s.SZ){
if(!b[s[i]-'0']){
s[i]=m+48;
}
}
cout<<s;
return 0;
}
|
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;
}
}
t/=10;
}
if(b){
ans=i;
}
}
cout << ans << endl;
}
|
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(n)){
n++;
}
printf("%d", n);
}
|
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)){
n++;
}
printf("%d", 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]){
| ^
a.cc: In function 'bool Check(int)':
a.cc:6:8: error: could not convert '<lambda closure object>Check(int)::<lambda()>{n}' from 'Check(int)::<lambda()>' to 'bool'
6 | if([n%10]){
| ^~~~~~
| |
| Check(int)::<lambda()>
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;
| ^~~
|
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)){
n++;
}
printf("%d", 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;
| ^
a.cc:20:7: error: 'tmp' was not declared in this scope
20 | d[tmp] = true;
| ^~~
a.cc:23:10: error: 'Check' was not declared in this scope
23 | while(!Check(n)){
| ^~~~~
|
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)){
n++;
}
printf("%d", 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]){
| ^
| ,
a.cc:6:10: error: expected identifier before '%' token
a.cc: In lambda function:
a.cc:6:14: error: expected '{' before ')' token
6 | if([d%10]){
| ^
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;
| ^~~
|
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)){
n++;
}
printf("%d", 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;
| ^
a.cc:20:7: error: 'tmp' was not declared in this scope
20 | d[tmp] = true;
| ^~~
a.cc:23:10: error: 'Check' was not declared in this scope
23 | while(!Check(n)){
| ^~~~~
|
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) return 5;
if (n < 1000000) return 6;
if (n < 10000000) return 7;
if (n < 100000000) return 8;
if (n < 1000000000) return 9;
return 10;
}
{
int n,k,p,keta;
cin>>n>>k;
for(int i=0;i<k;i++){cin>>p;ok[p]=99:}
sort(ok,ok+10);
keta=digitPoor(
}
|
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;
b[d]= true;
}
while(check(n))
++n;
cout << n<<endl;
return 0;
}
|
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 digit = 1;
while (x > 0)
{
if (s.find(x % 10) == s.end())
{
N = (x + 1) * digit;
break;
}
digit *= 10;
x /= 10;
}
if (x == 0)
break;
}
cout << N << endl;
return 0;
}
|
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;
| ^
a.cc:6:11: error: 'K' was not declared in this scope
6 | ll N, K, x;
| ^
a.cc:6:14: error: 'x' was not declared in this scope
6 | ll N, K, x;
| ^
a.cc:3:17: error: template argument 1 is invalid
3 | #define ll long long;
| ^~~~
a.cc:8:9: note: in expansion of macro 'll'
8 | set<ll> s;
| ^~
a.cc:3:17: error: template argument 2 is invalid
3 | #define ll long long;
| ^~~~
a.cc:8:9: note: in expansion of macro 'll'
8 | set<ll> s;
| ^~
a.cc:3:17: error: template argument 3 is invalid
3 | #define ll long long;
| ^~~~
a.cc:8:9: note: in expansion of macro 'll'
8 | set<ll> s;
| ^~
a.cc:8:11: error: expected primary-expression before '>' token
8 | set<ll> s;
| ^
a.cc:8:13: error: 's' was not declared in this scope
8 | set<ll> s;
| ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
3 | #define ll long long;
| ^~~~
a.cc:20:9: note: in expansion of macro 'll'
20 | ll digit = 1;
| ^~
a.cc:20:12: error: 'digit' was not declared in this scope
20 | ll digit = 1;
| ^~~~~
|
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;
ll digit = 1;
while (x > 0)
{
if (s.find(x % 10) == s.end())
{
N = (x + 1) * digit;
break;
}
digit *= 10;
x /= 10;
}
if (x == 0)
break;
}
cout << N << endl;
return 0;
}
|
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;
| ^
a.cc:8:17: error: 'K' was not declared in this scope
8 | cin >> N >> K;
| ^
a.cc:9:11: error: template argument 2 is invalid
9 | set<ll> s;
| ^
a.cc:9:11: error: template argument 3 is invalid
a.cc:11:11: error: request for member 'insert' in 's', which is of non-class type 'int'
11 | s.insert(i);
| ^~~~~~
a.cc:14:16: error: 'x' was not declared in this scope
14 | cin >> x;
| ^
a.cc:15:11: error: request for member 'erase' in 's', which is of non-class type 'int'
15 | s.erase(x);
| ^~~~~
a.cc:20:9: error: 'x' was not declared in this scope
20 | x = N;
| ^
a.cc:21:11: error: expected ';' before 'digit'
21 | ll digit = 1;
| ^~~~~~
| ;
a.cc:25:19: error: request for member 'find' in 's', which is of non-class type 'int'
25 | if (s.find(x % 10) == s.end())
| ^~~~
a.cc:25:37: error: request for member 'end' in 's', which is of non-class type 'int'
25 | if (s.find(x % 10) == s.end())
| ^~~
a.cc:27:31: error: 'digit' was not declared in this scope
27 | N = (x + 1) * digit;
| ^~~~~
a.cc:30:13: error: 'digit' was not declared in this scope
30 | digit *= 10;
| ^~~~~
|
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 digit = 1;
while (x > 0)
{
if (s.find(x % 10) == s.end())
{
N = (x + 1) * digit;
break;
}
digit *= 10;
x /= 10;
}
if (x == 0)
break;
}
cout << N << endl;
return 0;
}
|
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;
| ^
a.cc:8:11: error: template argument 2 is invalid
8 | set<ll> s;
| ^
a.cc:8:11: error: template argument 3 is invalid
a.cc:10:11: error: request for member 'insert' in 's', which is of non-class type 'int'
10 | s.insert(i);
| ^~~~~~
a.cc:13:16: error: 'x' was not declared in this scope
13 | cin >> x;
| ^
a.cc:14:11: error: request for member 'erase' in 's', which is of non-class type 'int'
14 | s.erase(x);
| ^~~~~
a.cc:19:9: error: 'x' was not declared in this scope
19 | x = N;
| ^
a.cc:20:11: error: expected ';' before 'digit'
20 | ll digit = 1;
| ^~~~~~
| ;
a.cc:24:19: error: request for member 'find' in 's', which is of non-class type 'int'
24 | if (s.find(x % 10) == s.end())
| ^~~~
a.cc:24:37: error: request for member 'end' in 's', which is of non-class type 'int'
24 | if (s.find(x % 10) == s.end())
| ^~~
a.cc:26:31: error: 'digit' was not declared in this scope
26 | N = (x + 1) * digit;
| ^~~~~
a.cc:29:13: error: 'digit' was not declared in this scope
29 | digit *= 10;
| ^~~~~
|
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;
// 嫌いな数字が出現した際に立つフラグ
bool flag = false;
for (int ans = N; ans <= 10000; ans++) {
// ansを文字列に変換
string str = to_string(ans);
count = 0;
for (int i = 0; i < K; i++) {
// 嫌いな数字を文字に変換
char judge = '0' + D[i];
// ans中にD[i]が出現したらフラグを立てる
if (str.find(judge) != string::npos) {
count = true;
break;
}
}
// 嫌いな数字が出現してなかったら表記して終了
if (count == false) {
cout << ans << endl;
return 0;
}
}
}
|
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 operands of types '<unresolved overloaded function type>' and 'bool' to binary 'operator=='
44 | if (count == false) {
| ~~~~~~^~~~~~~~
|
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 (i=0;i<k;i++) {
cin >> d;
v.push_back(d);
}
sort(v.begin(), v.end());
for (i=n;i<n*10;i++) {
flag = 0;
num = i;
while(num != 0) {
auto result = find(v.begin(), v.end(), num % 10;
if (result == v.end()) flag = 1;
num /= 10;
}
if (flag == 0) {
cout << i << endl;
return 0;
}
}
}
|
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 (i=0;i<k;i++) {
cin >> d;
v.push_back(d);
}
sort(v.begin(), v.end());
for (i=n;i<n*10;i++) {
flag = 0;
num = i;
while(num != 0) {
result = find(v.begin(), v.end(), num % 10
if (result == v.end()) flag = 1
num /= 10;
}
if (flag == 0) {
cout << i << endl;
return 0;
}
}
}
|
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
| ~ ^
| )
29 | if (result == v.end()) flag = 1
| ~~
|
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>
#include<iterator>
#define max(a,b) ((a>b)?a:b) //finding max
#define min(a,b) ((a<b)?a:b) //finding min
#define Max(a,b,c) max(a,max(b,c)) //finding max between 3 numbers
#define Min(a,b,c) min(a,min(b,c)) //finding min between 3 numbers
#define Pi acos(-1.0) //defining Pi for mathematical uses
#define Clear(a) memset(a,0,sizeof(a)) //clearing memory of an array
#define setfalse(a) memset(a,false,sizeof(a)) //setting the array into false
#define settrue(a) memset(a,true,sizeof(a)) //setting the array into true
#define clrstr(a) memset(a,'\0',sizeof(a)) //setting string array to null
#define open freopen("input.txt","r",stdin) //opening input file
#define close freopen ("output.txt","w",stdout) //opening output file
#define Case(a) printf("Case %d: ",a) //printing case number
#define caseh(a) printf("Case #%d: ",a) //printing case number having '#'
#define getcase(a) scanf("%d",&a) //scanning case number
#define caseloop(a,b) for(a=1;a<=b;a++) //making case loop
#define EPS 1e-9 //small value for avoiding preccesion error
#define LL long long //long long short form
#define fori(i,n) for(int i=1;i<=n;++i)
#define forn(i,n) for(int i=0;i<n;++i)
#define sz(x) int(x.size())
#define error(x) cout<<#x<<" "<<x<<endl
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
//const int N=100*1000;
//const int mod=1e9+7;
#define int min3(int a,int b,int c){return min(a,min(b,c));}
#define int max3(int a,int b,int c){return max(a,max(b,c));}
#define int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
#define int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin.tie(NULL);
LL n,k,i,j;
cin>>n>>k;
string K;
for(i=0; i<k; i++)
cin>>K[i];
LL a,b,cnt;
for(;; n++)
{
a=n;
cnt=0;
while(a>0)
{
b=a%10;
a/=10;
for(i=0; i<k; i++)
{
if(b==K[i])
{
cnt++;
break;
}
}
if(cnt>0)
break;
}
if(cnt==0)
break;
}
if(cnt==0)
cout<<n<<"\n";
return 0;
}
|
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 | #define int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
| ^~~
a.cc:47:9: note: this is the location of the previous definition
47 | #define int max3(int a,int b,int c){return max(a,max(b,c));}
| ^~~
a.cc:49:9: warning: "int" redefined
49 | #define int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}
| ^~~
a.cc:48:9: note: this is the location of the previous definition
48 | #define int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
| ^~~
a.cc:49:13: error: ISO C++ forbids declaration of 'max4' with no type [-fpermissive]
49 | #define int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}
| ^~~~
a.cc:53:1: note: in expansion of macro 'int'
53 | int main()
| ^~~
a.cc:53:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
53 | int main()
| ^~~~
|
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++){
for(int l=0;l<k;l++){
if(x%10==d[l]){
flag=1;
}
}
x/=10;
if(b==0) break;
}
if(flag==0){
cout << i << endl;
break;
}
}
}
|
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(v.begin(), v.end());
#define INF 999999999
#define itn ll
#define ednl endl
using namespace std;
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}
int main(){
cin.tie(0);ios::sync_with_stdio(false);
int N,K;
cin>>N>>K;
vector<int> vec(K);
FDS(i,K){
cin>>vec[i];
}
for(int i=1;i<100000;i++){
if(i>=N){
int NN=i;
vector<int> keta(5);
FDS(t,5){
keta[t]=NN%10;
NN/=10;
}
int sum=0;
FDS(k,5){
int sub=0;
FDS(j,K){
if(keta[k]!=vec[j]){
sub++;
}
}
if(sub==K){
sum++;
}
}
if(sum==5){
cou<<i<<endl;
return 0;
}
}
}
}
|
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;
}
int cnt = 0;
int dol1 = dol;
while(dol){
Num[cnt] = dol%10;
dol /= 10;
cnt++;
}
for(int i = 0 ; i < cnt ; i++){
while(judge[Num[i]] == 1){
Num[i]++;
if(Num[i] >= 10){
Num[i + 1]++;
Num[i] = 0;
}
}
}
while(judge[Num[cnt]] == 1 && Num[cnt] != 0){
Num[cnt]++;
}
int j = 1;
for(int i = 0 ; i <= cnt ; i++ ){
ans += j*Num[i];
j *= 10;
}
printf("%d\n",ans);
if(ans - dol1 != 0){
printf(’%)
}
return 0;
}
|
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: expected primary-expression before ')' token
45 | printf(’%)
| ^
|
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(flag){
printf("%d\n", x);
return ;
}
}
}
int main() {
while(~scanf("%d %d", &n, &k)) {
for(int i = 1; i <= k; ++i) scanf("%d", arr + i);
solve();
}
return 0;
}
|
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]{
t++;
}
if(i/1000)%10!=vec[k]){
t++;
}
}
if(t==4*K){
if(ans>=i){
ans=i;
}
}
}
}
|
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 | vec[i];
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
a.cc:17:33: error: expected primary-expression before '%' token
17 | if(i/10)%10!=vec[k]){
| ^
a.cc:20:34: error: expected primary-expression before '%' token
20 | if(i/100)%10!=vec[k]{
| ^
a.cc:23:35: error: expected primary-expression before '%' token
23 | if(i/1000)%10!=vec[k]){
| ^
|
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.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T, class U>using vp = vector<pair<T, U>>;
template<class T>using vv = vector<vector<T>>; template<class T, class U>using vvp = vv<pair<T, U>>;
template<class T>vv<T> vvec(const size_t n, const size_t m, const T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; }return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; }return 0; }
constexpr int INF = 1 << 28; constexpr ll LINF = 1ll << 60;
constexpr int MAX = 1e5 + 5; constexpr int MOD = 1e9 + 7; constexpr double EPS = 1e-6;
constexpr int dy[4] = { 0,1,0,-1 }; constexpr int dx[4] = { 1,0,-1,0 };
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;
int N, K;
vi D;
int main(){
cin >> N >> K;
D.resize(K);
rep(i, K) cin >> D[i];
vector<char> forbidden;
rep(i, K) forbidden.push_back(D[i] + '0');
rep(n, N, 100000){
string s = to_string(n);
bool allowed = true;
rep(i, K) if (s.find(forbidden[i]) != string::npos) allowed = false;
if (allowed) {
write(n);
return 0;
}
}
}
|
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;
}
//System.out.println(a);
int flag=1;
int money=0;
while(flag==1)
{
money=money+a;
//System.out.println(money);
String mo=Integer.toString(money);
flag=0;
for(int i=0;i<=9;i++)
{
String o=Integer.toString(i);
if(n[i]==0)continue;
if(mo.indexOf(o)>=0)
{
flag=1;break;
}
}
}
System.out.println(money);
}
}
}
|
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=0;i<n;i++){
cin>>X[i];
}
X[i]=10;
while((n=judge(N))!=0) {
N++
}
cout<<N;
}
|
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: error: invalid types 'int[int]' for array subscript
24 | X[i]=10;
| ^
a.cc:26:10: error: expected ';' before '}' token
26 | N++
| ^
| ;
27 | }
| ~
|
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]) {
check = false;
break;
}
}
return check;
}
int pay_money (int N, unsigned long K, const std::vector<int> &bad_number) {
long money = 0;
long i = 0;
while (N > 0){
while (good_number ((N % 10), K, bad_number) == false) {
++N;
}
money = (N % 10) * pow_10 (i) + money;
N = N / 10;
++i;
}
return money;
}
using namespace std;
int main(){
long N;
unsigned long K;
cin >> N >> K;
long a;
vector <int> D;
for (unsigned long i = 0; i < K; ++i){
cin >> a;
D.push_back(a);
}
cout << detch_up (N, K, D) << endl;
//cout << pay_money(N, K, D) << endl;
return 0;
}
|
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())
number.push_back(j);
}
vector<int> keta;
for(int i=0;i<4&&n/10!=0;i++){
keta.push_back(n%10);
if(n/10!=0)
n =n/10;
else break;
if(i>0) swap(keta[i],keta[i-1]);
}
for(int m=0;m<keta.size();m++){
for(int l=0;l<number.size();l++){
if(number[l]>keta[m]){
swap(number[l],keta[m]);
break;
}
}
}
int ans=0;
for(int m=0;m<keta.size();m++){
ans+=keta[m]*pow(10,3-m);
}
cout << ans <<endl;
return 0;
}
|
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++)cin >> D[i];
m=100000;
for(int i=1;i<=9;i++){
bool q=true;
for(int j=0;j<K;j++){if(i==D[j])q=false;}
if(q){dfs(i);}
}
cout << m << endl;
}
|
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);
}
}
return 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;
n/=10;
}
return true;
}
int main()
{
int n,k;
scanf("%d %d",&n,&k);
memset(vis,0,sizeof(vis));
for(int i=0; i<k; i++)
{
scanf("%d",&a[i]);
vis[a[i]]=1;
}
for(int i=n; ; i++)
{
if(check(i))
{
printf("%d\n",i);
return 0;
}
}
return 0;
|
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.