提出 #74098956


ソースコード 拡げる

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using db = double;
using P = pair<ll, ll>;
#define rep(i,n) for (ll i = 0; i < n; i++)
#define pb push_back;
#define mp make_pair;

int main() {
  int n,l,r;
  cin >> n >> l >> r;
  vector<char> s(n);
  rep(i,n) cin >> s[i];
  int ans = 0;
  for(int i = 0; i < n-1; i++) {
    for(int j = l+i; j <= r+i; j++) {
      if(s[i] == s[j]) ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}

提出情報

提出日時
問題 C - Comfortable Distance
ユーザ WebP
言語 C++23 (GCC 15.2.0)
得点 0
コード長 527 Byte
結果 WA
実行時間 > 2000 ms
メモリ 4048 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 300
結果
AC × 3
AC × 9
WA × 9
TLE × 5
セット名 テストケース
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.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
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 3408 KiB
sample01.txt AC 1 ms 3588 KiB
sample02.txt AC 1 ms 3468 KiB
testcase00.txt AC 1 ms 3452 KiB
testcase01.txt AC 1 ms 3556 KiB
testcase02.txt AC 184 ms 3536 KiB
testcase03.txt WA 849 ms 4048 KiB
testcase04.txt WA 616 ms 3580 KiB
testcase05.txt WA 703 ms 3604 KiB
testcase06.txt AC 95 ms 3672 KiB
testcase07.txt TLE > 2000 ms 3712 KiB
testcase08.txt TLE > 2000 ms 3864 KiB
testcase09.txt WA 530 ms 3800 KiB
testcase10.txt TLE > 2000 ms 3784 KiB
testcase11.txt WA 538 ms 3920 KiB
testcase12.txt AC 14 ms 3776 KiB
testcase13.txt TLE > 2000 ms 3728 KiB
testcase14.txt WA 14 ms 4008 KiB
testcase15.txt WA 568 ms 3940 KiB
testcase16.txt AC 14 ms 3928 KiB
testcase17.txt TLE > 2000 ms 3760 KiB
testcase18.txt WA 14 ms 3928 KiB
testcase19.txt WA 1237 ms 3796 KiB