提出 #76530117


ソースコード 拡げる

#include <bits/stdc++.h>

using namespace std;

template <typename T>
using vc = vector<T>;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)

void solve() {
  int N, M;
  cin >> N >> M;
  int d = 1;
  FOR(j, 0, M) {
    int L, R;
    cin >> L >> R;
    d = max(d, R - L + 1);
  }
  vc<int> A(N);
  FOR(i, 0, N) A[i] = (i % d) + 1;

  FOR(i, 0, N) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << "\n";
}

signed main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int T;
  cin >> T;
  FOR(t, 0, T) solve();
}

提出情報

提出日時
問題 A - Colorful Intervals
ユーザ maspy
言語 C++23 (GCC 15.2.0)
得点 300
コード長 573 Byte
結果 AC
実行時間 24 ms
メモリ 4216 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 30
セット名 テストケース
Sample 01_sample_01.txt
All 01_sample_01.txt, 02_small_01.txt, 02_small_02.txt, 03_rand_1_01.txt, 03_rand_1_02.txt, 03_rand_1_03.txt, 03_rand_1_04.txt, 03_rand_1_05.txt, 04_rand_2_01.txt, 04_rand_2_02.txt, 04_rand_2_03.txt, 04_rand_2_04.txt, 04_rand_2_05.txt, 05_rand_3_01.txt, 05_rand_3_02.txt, 05_rand_3_03.txt, 05_rand_3_04.txt, 05_rand_3_05.txt, 05_rand_3_06.txt, 05_rand_3_07.txt, 05_rand_3_08.txt, 05_rand_3_09.txt, 05_rand_3_10.txt, 06_other_01.txt, 06_other_02.txt, 06_other_03.txt, 06_other_04.txt, 06_other_05.txt, 06_other_06.txt, 06_other_07.txt
ケース名 結果 実行時間 メモリ
01_sample_01.txt AC 1 ms 3428 KiB
02_small_01.txt AC 16 ms 3428 KiB
02_small_02.txt AC 17 ms 3560 KiB
03_rand_1_01.txt AC 20 ms 3428 KiB
03_rand_1_02.txt AC 20 ms 3520 KiB
03_rand_1_03.txt AC 20 ms 3580 KiB
03_rand_1_04.txt AC 20 ms 3364 KiB
03_rand_1_05.txt AC 20 ms 3508 KiB
04_rand_2_01.txt AC 20 ms 3544 KiB
04_rand_2_02.txt AC 21 ms 3636 KiB
04_rand_2_03.txt AC 20 ms 3612 KiB
04_rand_2_04.txt AC 20 ms 3568 KiB
04_rand_2_05.txt AC 20 ms 3688 KiB
05_rand_3_01.txt AC 13 ms 4164 KiB
05_rand_3_02.txt AC 17 ms 4056 KiB
05_rand_3_03.txt AC 22 ms 4064 KiB
05_rand_3_04.txt AC 17 ms 4160 KiB
05_rand_3_05.txt AC 17 ms 4164 KiB
05_rand_3_06.txt AC 19 ms 4172 KiB
05_rand_3_07.txt AC 15 ms 4088 KiB
05_rand_3_08.txt AC 13 ms 4052 KiB
05_rand_3_09.txt AC 15 ms 4052 KiB
05_rand_3_10.txt AC 17 ms 4216 KiB
06_other_01.txt AC 16 ms 3428 KiB
06_other_02.txt AC 11 ms 4216 KiB
06_other_03.txt AC 24 ms 4152 KiB
06_other_04.txt AC 22 ms 4092 KiB
06_other_05.txt AC 21 ms 4156 KiB
06_other_06.txt AC 18 ms 4172 KiB
06_other_07.txt AC 21 ms 4152 KiB