Submission #212331

# Submission time Handle Problem Language Result Execution time Memory
212331 2020-03-22T17:23:00 Z DEDA Chameleon's Love (JOI20_chameleon) C++14
0 / 100
5 ms 384 KB
/*
 _____ ____ _____   ___   ___   ___   ___ 
|_   _/ __ \_   _| |__ \ / _ \ |__ \ / _ \
  | || |  | || |      ) | | | |   ) | | | |
  | || |  | || |     / /| | | |  / /| | | |
 _| || |__| || |_   / /_| |_| | / /_| |_| |
|_____\____/_____| |____|\___/ |____|\___/ 
*/
#include <bits/stdc++.h>
#include <fstream>
#include "chameleon.h"
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define per(i, a, b) for (int i = (a); i > (b); i--)
#define a(x) (x.begin(), x.end())
#define ar(x) (x.rbegin(), x.rend())
#define pb push_back
#define Pb() pop_back()
#define ll long long int
#define ull unsigned long long int
#define pii pair<int, int>
#define pll pair<ll, ll>
#define sc scanf
#define scin(x) sc("%d", &(x))
#define scln(x) sc("%lld", &(x))
#define pf prllf
#define ms(a, b) memset(a, b, sizeof(a))
#define mp make_pair
#define db double
#define EPS 10E-10
#define ff first
#define ss second
#define sqr(x) (x) * (x)
#define vi vector<int>
#define vl vector<ll>
#define vii vector<vector<int>>
#define vll vector<vector<ll>>
#define DBG pf("HI\n")
#define MOD 1000000007
#define CIN                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define RUN_CASE(t, T) for (__typeof(t) t = 1; t <= T; t++)
#define CASE(t) prllf("Case %d: ", t)
#define CASEL(t) prllf("Case %d:\n", t)
#define intlimit 2147483647
#define longlimit 9223372036854775807
#define infinity (1 << 28)
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a) * (b) / gcd(a, b))
#define PI 2 * acos(0.0)
// pair<int,int>ert(x==y); gives run time when false
using namespace std;
// Query Answer
void Solve(int N)
{
    int n = 2 * N;
    vii v(n + 1, vi(2));
    vector<set<int>> v1(n + 1);
    rep(i, 1, n + 1)
    {
        vi jm;
        rep(j, 1, n + 1)
        {
            vi temp = {i, j};
            int g = Query(temp);
            if (g == 1)
            {
                jm.pb(j);
            }
        }
        // rep(j, 0, 3)
        // {
        //     v[i][j] = jm[j];
        //     v1[i].insert(jm[j]);
        // }
        if(Query({i,jm[0],jm[1]}) == 1){
            v[i][0] = jm[0];
            v[i][1] = jm[1];
            v1[i].insert(jm[0]);
            v1[i].insert(jm[1]);
            continue;
        }
        if(Query({i,jm[0],jm[2]}) == 1){
            v[i][0] = jm[0];
            v[i][1] = jm[2];
            v1[i].insert(jm[0]);
            v1[i].insert(jm[2]);
            continue;
        }
        if(Query({i,jm[2],jm[1]}) == 1){
            v[i][0] = jm[2];
            v[i][1] = jm[1];
            v1[i].insert(jm[2]);
            v1[i].insert(jm[1]);
            continue;
        }
    }
    vi vis(n + 1, 0);
    rep(i, 1, n + 1)
    {
        if(vis[i])continue;
        rep(j, 0, 2)
        {
            if (v1[v[i][j]].count(i)){
                vis[i]=1;
                vis[v[i][j]]=1;
                Answer(i,v[i][j]);
                break;
            }
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -