Submission #60324751


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793238462643383279502884L
#define LL long long
#define DD double
#define ULL unsigned long long
#define STR string
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
#define MLL map<LL, LL>
#define MSL map<STR, LL>
#define MLB map<LL, bool>
template <class T>
using PQA = priority_queue<T, V<T>, greater<T>>;
template <class T>
using PQD = priority_queue<T, V<T>, less<T>>;
#define IT iterator
#define F first
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>

using namespace std;
#define PI 3.141592653589793238462643383279502884L
#define LL long long
#define DD double
#define ULL unsigned long long
#define STR string
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
#define MLL map<LL, LL>
#define MSL map<STR, LL>
#define MLB map<LL, bool>
template <class T>
using PQA = priority_queue<T, V<T>, greater<T>>;
template <class T>
using PQD = priority_queue<T, V<T>, less<T>>;
#define IT iterator
#define F first
#define S second
#define PB push_back
#define PLL pair<LL, LL>
#define MP make_pair
#define rep(i, e) for (LL i = 0; i < e; i++)
#define repa(i, s, e) for (LL i = s; i < e; i++)
#define repd(i, s, e) for (LL i = s; i >= e; i--)
#define repauto(x, s) for (auto x : s)
#define rd(...) \
  __VA_ARGS__;  \
  read(__VA_ARGS__)
#define rdv(value, ...) \
  value(__VA_ARGS__);   \
  cin >> value
template <class T>
auto &operator>>(istream &is, vector<T> &xs)
{
  for (auto &x : xs)
    is >> x;
  return is;
}
template <class T>
auto &operator<<(ostream &os, vector<T> &xs)
{
  int sz = xs.size();
  rep(i, sz) os << xs[i] << " \n"[i + 1 == sz];
  return os;
}
template <class T, class Y>
auto &operator<<(ostream &os, pair<T, Y> &xs)
{
  os << "{" << xs.first << ", " << xs.second << "}";
  return os;
}
template <class T, class Y>
auto &operator>>(istream &is, vector<pair<T, Y>> &xs)
{
  for (auto &[x1, x2] : xs)
    is >> x1 >> x2;
  return is;
}
template <class... Args>
auto &read(Args &...args) { return (cin >> ... >> args); }
#define vsorta(v) sort(v.begin(), v.end())
#define vsortd(v) sort(v.begin(), v.end(), greater<>())
#define sort_arr(v, n) sort(v, v + n)
#define rev(v) reverse(v.begin(), v.end())
#define pr(x) cout << x
#define prs(x) cout << x << ' '
#define prn(x) cout << x << '\n'
#define prd() cout << fixed << setprecision(50);
#define Yes cout << "Yes\n"
#define YES cout << "YES\n"
#define No cout << "No\n"
#define NO cout << "NO\n"
#define PN cout << '\n'
#define PS cout << ' '
#define INF (1LL << 60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N 100100

struct ST
{
  int N, M;
  VV<LL> ans;

  ST(int n, int m)
  {
    N = n;
    M = m;
  }

  void rec(LL now, V<LL> cur)
  {
    int n = cur.size();
    if (n == N)
    {
      ans.push_back(cur);
      return;
    }
    repa(i, now + 10, M - (N - n - 1) * 10 + 1)
    {
      cur.push_back(i);
      rec(i, cur);
      cur.pop_back();
    }
  }
  void print()
  {
    prn(ans.size());
    repauto(x, ans) pr(x);
  }
};

void solve()
{
  LL rd(n, m);
  ST st(n, m);
  repa(i, 1, m - 10 * (n - 1) + 1) st.rec(i, V<LL>(1, i));
  st.print();
}

int main()
{
  LL T = 1;
  // LL rd(T);
  while (T--)
    solve();
  return 0;
}

Submission Info

Submission Time
Task D - Keep Distance
User togi11
Language C++ 20 (gcc 12.2)
Score 425
Code Size 2862 Byte
Status AC
Exec Time 192 ms
Memory 50516 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 425 / 425
Status
AC × 1
AC × 31
Set Name Test Cases
Sample sample00.txt
All sample00.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt, testcase23.txt, testcase24.txt, testcase25.txt, testcase26.txt, testcase27.txt, testcase28.txt, testcase29.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3460 KB
testcase00.txt AC 1 ms 3572 KB
testcase01.txt AC 1 ms 3508 KB
testcase02.txt AC 1 ms 3660 KB
testcase03.txt AC 1 ms 3504 KB
testcase04.txt AC 1 ms 3464 KB
testcase05.txt AC 1 ms 3464 KB
testcase06.txt AC 1 ms 3600 KB
testcase07.txt AC 2 ms 3548 KB
testcase08.txt AC 1 ms 3452 KB
testcase09.txt AC 1 ms 3368 KB
testcase10.txt AC 1 ms 3504 KB
testcase11.txt AC 1 ms 3444 KB
testcase12.txt AC 1 ms 3484 KB
testcase13.txt AC 2 ms 3808 KB
testcase14.txt AC 2 ms 3740 KB
testcase15.txt AC 1 ms 3440 KB
testcase16.txt AC 1 ms 3468 KB
testcase17.txt AC 12 ms 5516 KB
testcase18.txt AC 9 ms 4664 KB
testcase19.txt AC 46 ms 12396 KB
testcase20.txt AC 1 ms 3508 KB
testcase21.txt AC 1 ms 3576 KB
testcase22.txt AC 1 ms 3484 KB
testcase23.txt AC 1 ms 3564 KB
testcase24.txt AC 3 ms 3748 KB
testcase25.txt AC 5 ms 4180 KB
testcase26.txt AC 13 ms 5776 KB
testcase27.txt AC 35 ms 9664 KB
testcase28.txt AC 82 ms 21796 KB
testcase29.txt AC 192 ms 50516 KB


2025-03-05 (Wed)
20:46:25 +00:00