比赛 2024暑期C班集训3 评测结果 WWWWWWWWWWWWWWWWWWWW
题目名称 Florr 最终得分 0
用户昵称 ┭┮﹏┭┮ 运行时间 0.058 s
代码语言 C++ 内存使用 2.47 MiB
提交时间 2024-07-03 11:36:47
显示代码纯文本
#include <bits/stdc++.h> 
using namespace std;
#define ll long long
const int N = 1e5+10;
const ll mod = 1e9+7;


ll read(){
   ll x = 0,f = 1;char c = getchar();
   for(;c < '0' || c > '9';c = getchar())if(c == '-')f = -1;
   for(;c >= '0' && c <= '9';c = getchar())x = (x<<1) + (x<<3) + c-'0';
   return x * f;
}

int n,m,k,s;
int c[N],a[N],b[N];
bool f[N],v[N];
int main(){
    freopen("Florr.in","r",stdin);
    freopen("Florr.out","w",stdout);
    n = read(),m = read(),k = read();
    for(int i = 1;i <= n;i++)c[i] = read();
    for(int i = 1;i <= m;i++)a[i] = read(),b[i] = read();
    for(int i = m;i >= 1;i--){
        if(!v[b[i]] && s < k && c[a[i]] < c[b[i]])s++,f[i] = 1,v[b[i]] = 1;
        
    }
    printf("%d\n",s);
    for(int i = 1;i <= m;i++)if(f[i])printf("%d\n",i);
    
    
    return 0;
}