提出 #33632229


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int main(){
  long long n, a, b;
  cin >> n >> a >> b;
  long long g = n / a * a;
  long long ans = g / a * (1 + min(a - 1, b - 1));
  ans -= min(a - 1, b - 1);
  ans += min(n - g, b - 1);
  cout << ans << endl;
}

提出情報

提出日時
問題 B - AB Game
ユーザ learningcurve_
言語 C++ (GCC 9.2.1)
得点 0
コード長 300 Byte
結果 WA
実行時間 6 ms
メモリ 3576 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 500
結果
AC × 2
AC × 20
WA × 2
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt, 02_handmade_08.txt, 02_handmade_09.txt, 02_handmade_10.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 6 ms 3444 KiB
00_sample_02.txt AC 3 ms 3440 KiB
01_random_01.txt AC 2 ms 3556 KiB
01_random_02.txt AC 2 ms 3560 KiB
01_random_03.txt WA 2 ms 3564 KiB
01_random_04.txt AC 2 ms 3552 KiB
01_random_05.txt AC 2 ms 3572 KiB
01_random_06.txt WA 2 ms 3576 KiB
01_random_07.txt AC 2 ms 3564 KiB
01_random_08.txt AC 2 ms 3556 KiB
01_random_09.txt AC 2 ms 3440 KiB
01_random_10.txt AC 3 ms 3512 KiB
02_handmade_01.txt AC 2 ms 3560 KiB
02_handmade_02.txt AC 2 ms 3444 KiB
02_handmade_03.txt AC 2 ms 3476 KiB
02_handmade_04.txt AC 2 ms 3556 KiB
02_handmade_05.txt AC 2 ms 3576 KiB
02_handmade_06.txt AC 2 ms 3384 KiB
02_handmade_07.txt AC 2 ms 3572 KiB
02_handmade_08.txt AC 2 ms 3384 KiB
02_handmade_09.txt AC 2 ms 3500 KiB
02_handmade_10.txt AC 2 ms 3440 KiB