Submission #319429

#TimeUsernameProblemLanguageResultExecution timeMemory
319429VimmerPainting Walls (APIO20_paint)C++14
0 / 100
1 ms492 KiB
#include <bits/stdc++.h>
//#include "paint.h"
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")

#define N 100100
#define F first
#define S second
#define M ll(1e9 + 7)
#define endl '\n'
#define all(x) x.begin(), x.end()
#define PB push_back
#define sz(x) ll(x.size())
#define pw(x) (1ll << x)
#define pwr(x) ((1ll << x) - 1)
#define _ << " " <<
#define pri(s) cout << s << endl

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef short int si;
typedef unsigned long long ull;

//typedef tree<int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int> > b)
{
    int who[k];

    for (int i = 0; i < m; i++) who[b[i][0]] = i;

    for (int i = 0; i < n; i++) a[i] = who[a[i]];

    for (int i = 0; i < n; i++)
      if (a[i] == 0)
      {
          int len = 0;

          int cur = i;

          while (len < m)
          {
            if (a[cur] != len) return -1;

            len++;

            cur++;

            cur %= m;
          }
      }

    return n / m;
}

//int main()
//{
//    ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//
//
//}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...