Submission #270309

# Submission time Handle Problem Language Result Execution time Memory
270309 2020-08-17T14:06:33 Z Fasho Easter Eggs (info1cup17_eastereggs) C++14
6 / 100
2 ms 512 KB
#include <bits/stdc++.h>
#define NNN 515
#define ll long long int
#define fo(i,x,y)	for(int i=x;i<=y;i++)
#define fs(ar,n) fo(i,1,n) cin>>ar[i]
#define sp " "
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll> 
#include "grader.h"
using namespace std;
ll n,m,ar[NNN],sum,t;
 
// ll n,m,ar[NNN],sum,t;
 
// queue<int> q;
 
// vector<int> vv[NNN];
 
 
 
 
 
// static int N, X, cntQ;
// static vector < int > v[1009];
 
// int query (vector < int > h)
// {
//     cntQ ++;
//     int ap[1009];
//     if (h.empty ()) return 0;
//     for (int i=1; i<=N; i++)
//         ap[i] = 0;
//     for (auto it = h.begin (); it != h.end (); it ++)
//         ap[*it] = 1;
//     queue < int > cc;
//     cc.push (h[0]), ap[h[0]] = 2;
//     while (!cc.empty ())
//     {
//         int nod = cc.front ();
//         cc.pop ();
//         for (auto it = v[nod].begin (); it != v[nod].end (); it ++)
//             if (ap[*it] == 1)
//                 ap[*it] = 2, cc.push (*it);
//     }
//     for (int i=1; i<=N; i++)
//         if (ap[i] == 1) return -1;
//     for (auto it = h.begin (); it != h.end (); it ++)
//         if (*it == X) return 1;
//     return 0;
// }
	vector<int> bos;
bool check(int x)
{
	bos.clear();
	fo(i,1,x)
		bos.pb(ar[i]);
	return query({1});
	// ll y=query(bos);
	ll y=1;
	y=min(y,1ll);
	return y;
}
	
int bs()
{
	// int l=1,r=n;
	// fo(i,1,n)
	// {
	// 	if(check(i))
	// 		return i;
	// }
	// return 1;
	return check(1);
	// while(l<r)
	// {
	// 	if(l==r-1)
	// 	{
	// 		if(check(l))
	// 			r=l;
	// 		break;
	// 	}
	// 	int mid=(l+r)/2;
	// 	// cerr<<"[d]"<<sp;
	// 	// cerr<<l<<sp<<r<<sp<<mid<<endl;
	// 	if(check(mid))
	// 		r=mid;
	// 	else
	// 		l=mid+1;
	// }
 
	// return r;
}
 
 
int findEgg (int NN, vector < pair < int, int > > bridges)
{
	n=NN;
	// ll x=query({1});
    if (query ({1})) return 1;
	fo(i,1,n-1)
	{
		if(query({i}))
			return i;
	}
    return n;
}
 
// int main ()
// {
// // freopen ("input", "r", stdin);
// //freopen ("output", "w", stdout);
 
// scanf ("%d", &N);
// int Queries;
// vector < pair < int, int > > param;
// for (int i=1; i<N; i++)
// {
//     int x, y;
//     scanf ("%d %d", &x, &y);
//     v[x].push_back (y);
//     v[y].push_back (x);
//     param.push_back ({x, y});
// }
// scanf ("%d", &Queries);
// while (Queries --)
// {
//     scanf ("%d", &X), cntQ = 0;
//     int Y = findEgg (N, param);
//     if (X != Y)
//     {
//         printf ("WA %d instead of %d\n", Y, X);
//         return 0;
//     }
//     printf ("OK %d\n", cntQ);
// }
// return 0;
// }
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 256 KB Number of queries: 16
2 Partially correct 2 ms 256 KB Number of queries: 16
3 Partially correct 2 ms 256 KB Number of queries: 16
4 Partially correct 2 ms 256 KB Number of queries: 16
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -