結果

問題 No.2706 One Nafmo
ユーザー vjudge1
提出日時 2024-04-20 23:22:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 190,640 KB
最終ジャッジ日時 2025-02-21 07:33:06
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     freopen(wp ".inp", "r`", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:12:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |     freopen(wp ".out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long int

using namespace std;
ll a, b, x;
int main()
{
#define wp ""
  if (fopen(wp ".inp", "r"))
  {
    freopen(wp ".inp", "r`", stdin);
    freopen(wp ".out", "w", stdout);
  }
  cin.tie(0)->sync_with_stdio(0);
  cin >> a >> b >> x;
  if (x <= a)
    cout << b;
  else
    cout << ((x / a) * b + (x % a > 0) * b);
}
/*
tho la am nhac cua tam hon,nhat la voi nhung tam hon cao ca,da cam (voltaire).tho chi bat ra khi tim
nguoi nghe si dang co nhung nhip rung dong thon thuc,nhung nhip ngan vang vong tam hon.tuy la vay,nhung
van the tuy ngan gon lai co kha nang ket tinh nhieu giot ngoc cua cuoc song con nguoi truyen den the
gioi cam xuc cua ta nhung gia tri
*/
0