結果

問題 No.46 はじめのn歩
ユーザー Namu3Namu3
提出日時 2020-01-04 11:53:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 755 bytes
コンパイル時間 3,026 ms
コンパイル使用メモリ 174,280 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 07:59:05
合計ジャッジ時間 4,570 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int solve()':
main.cpp:16:14: warning: 'b' is used uninitialized [-Wuninitialized]
   16 |   cout << (b + a - 1) / a << endl;
      |            ~~^~~
main.cpp:15:9: note: 'b' was declared here
   15 |   int a,b;
      |         ^
main.cpp:16:14: warning: 'a' is used uninitialized [-Wuninitialized]
   16 |   cout << (b + a - 1) / a << endl;
      |            ~~^~~
main.cpp:15:7: note: 'a' was declared here
   15 |   int a,b;
      |       ^

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll fac(ll a) { return a > 1 ? fac(a - 1) * a : 1; }
int solve(){
  int a,b;
  cout << (b + a - 1) / a << endl;
  return 0;
}
int main(){
  ios::sync_with_stdio(false);cin.tie(nullptr);
  solve();
  return 0;
}
0