#include #include #include #include #include #include #include using namespace std; int c[1001]; int calive[1001]; int cs[1001]; int s[1001]; int se[1001]; int n, m, T; typedef struct { int c; int s; }cws; bool compare(cws a, cws b){ if(a.s>b.s) return true; else if(a.sb.c; } } int find_largest_empty_shell(int ci, int D){ int si=-1; int max=-1; for (int i=0; i max && se[i]==0 && s[i]>=c[ci] && s[i]<=(c[ci]+D)){ max=s[i]; si=i; } } return si; } int main(){ FILE *in = fopen("crabs.in", "r"); int K; fscanf(in, "%d\n", &K); vector lc; for(int k=0;ks[cs[i]]){ se[cs[i]]=0; cs[i]=-1; lc.push_back(i); } //cout< cwsl; cwsl.clear(); for(int i=0; i>hello; return 0; }