結果

問題 No.1101 鼻水
ユーザー yuya1234yuya1234
提出日時 2020-07-04 08:38:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 773 bytes
コンパイル時間 2,938 ms
コンパイル使用メモリ 166,920 KB
実行使用メモリ 11,312 KB
最終ジャッジ日時 2023-10-17 17:53:32
合計ジャッジ時間 7,836 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
11,312 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 394 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1,537 ms
4,348 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

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

int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  ll v, t, p;
  cin >> v >> t >> p;

  ll a = 0, i = 0,va=0,vmax;
  vmax=(p+1)*v;

  if (v < t)
  {
    for (;;)
    {
      a++;
      i++;
      if (i % t == 1)
        a--;
      if (p > 0 && a == v)
      {
        p--;
        cout << a << " " << p << endl;
        a = 0;
      }
      if (a == v)
        break;
    }
  }
  else
  {
    i=1;
    for (;;)
    {
        a+=t-1;
        i+=t;

      if(a>vmax)
      {
        va=a-vmax;
        i-=va+1;
        a=vmax;
        break;
      }  

      if (a == vmax)
        break;
    }
  }

  cout << i<< endl;

  return 0;
}
0