-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_Dividing_Orange.cpp
97 lines (94 loc) · 1.69 KB
/
A_Dividing_Orange.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//update code
#include<bits/stdc++.h>
using namespace std;
int arr[500],n,k;
bitset<1000>s;
int main(){
cin>>n>>k;
for(int i=1;i<=k;i++){
cin>>arr[i];
s[arr[i]]=1;
}
int l=1;
for(int i=1;i<=k;i++){
cout<<arr[i];
int j=n-1;
while(j--){
while(s[l]){
l++;
}
cout<<' '<<l++;
}
cout<<endl;
}
}
/*#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
vector<int>v(k);
for(int i=0;i<k;i++)cin>>v[i];
int arr[n][k];
for(int i=0;i<n;i++){
arr[i][0]=v[i];
}
for(int i=1;i<=n;i++){
for(int j=1;j<=k;j++){
if(v[j-1]!=i*j){
arr[i][j]=i*j;
}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<k;j++){
cout<<arr[i][j]<<' ';
}cout<<endl;
}
}*/
/*#include<bits/stdc++.h>
using namespace std;
bitset<1001>u;
int a[50],l=1,n,k;
int main(){
cin>>n>>k;
for(int i=1;i<=k;i++){
cin>>a[i];
u[a[i]]=1;
}
for(int i=1;i<=k;i++){
cout<<a[i]<<" ";
int j=n-1;
while(j--){
while(u[l]){
l++;
}
cout<<" "<<l++;
}
cout<<endl;
}
return 0;
}*/
/*#include<bits/stdc++.h>
using namespace std;
int arr[50],n,k;
bitset<1000>s;
int main(){
cin>>n>>k;
for(int i=1;i<=k;i++){
cin>>arr[i];
s[arr[i]]=1;
}
int l=1;
for(int i=1;i<=k;i++){
cout<<arr[i]<<' ';
int j=n-1;
while(j--){
while(s[l]){
l++;
}
cout<<' '<<l++;
}cout<<endl;
}
}
*/