-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaa.cpp
More file actions
59 lines (56 loc) · 833 Bytes
/
Copy pathaa.cpp
File metadata and controls
59 lines (56 loc) · 833 Bytes
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
#include<bis/stdc++.h>
using namespace std;
void schedule(int tables[],int order[],int arr[],int m,int n)
{
memset(tables,-1,sizeof(tables));
int i = 0;
while(i<m)
{
int minvalue = 100000;
int minindex = i;
int j = 0;
for(j=0;j<n;j++)
{
if(table[j]==order[i])
break;
if(arr[j]<minvalue)
{
minvalue = arr[j];
mindex = j;
}
}
}
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n,m;
cin>>n;
cin>>m;
int order[m];
int tables[n];
int i = 0;
while(i<m)
{
cin>>order[i];
i++;
}
int arr[m];
memset(arr,100000,sizeof(arr));
for(int i=0;i<m;i++)
{
for(int j = i+1;j<m;j++)
{
if(order[i]==order[j])
{
arr[i]==j;
break;
}
}
}
void schedule(tables,order,arr,m,n);
}
}