結果

問題 No.2516 Credit Creation
コンテスト
ユーザー donuthole
提出日時 2023-10-27 21:30:15
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.90.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 2,660 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,166 ms
コンパイル使用メモリ 147,644 KB
最終ジャッジ日時 2026-07-02 20:51:53
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:54:25: error: declaration of ‘operator<=’ as non-function
   54 | struct Pos{ll y,x; auto operator<=>(const Pos&) const = default;};
      |                         ^~~~~~~~
main.cpp:54:33: error: expected ‘;’ at end of member declaration
   54 | struct Pos{ll y,x; auto operator<=>(const Pos&) const = default;};
      |                                 ^~
      |                                   ;
main.cpp:54:35: error: expected unqualified-id before ‘>’ token
   54 | struct Pos{ll y,x; auto operator<=>(const Pos&) const = default;};
      |                                   ^
main.cpp:55:30: error: declaration of ‘operator<=’ as non-function
   55 | struct dPos{double y,x; auto operator<=>(const dPos&) const = default;};
      |                              ^~~~~~~~
main.cpp:55:38: error: expected ‘;’ at end of member declaration
   55 | struct dPos{double y,x; auto operator<=>(const dPos&) const = default;};
      |                                      ^~
      |                                        ;
main.cpp:55:40: error: expected unqualified-id before ‘>’ token
   55 | struct dPos{double y,x; auto operator<=>(const dPos&) const = default;};
      |                                        ^
main.cpp:58:30: error: no matching function for call to ‘Pos::Pos(int, int)’
   58 | const vec<Pos> Dir4={Pos(-1,0),Pos(1,0),Pos(0,-1),Pos(0,1)}; // UDLR
      |                              ^
main.cpp:54:8: note: candidate: ‘Pos::Pos()’
   54 | struct Pos{ll y,x; auto operator<=>(const Pos&) const = default;};
      |        ^~~
main.cpp:54:8: note:   candidate expects 0 arguments, 2 provided
main.cpp:54:8: note: candidate: ‘constexpr Pos::Pos(const Pos&)’
main.cpp:54:8: note:   candidate expects 1 argument, 2 provided
main.cpp:54:8: note: candidate: ‘constexpr Pos::Pos(Pos&&)’
main.cpp:54:8: note:   candidate expects 1 argument, 2 provided
main.cpp:58:39: error: no matching function for call to ‘Pos::Pos(int, int)’
   58

ソースコード

diff #
raw source code

#include <atcoder/all>
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <compare>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll=long long;
ll const mod = 998244353;
using mint = atcoder::modint998244353;

#define _REP_OVERLOAD(e1,e2,e3,_REP,...) _REP
#define _REP_2(i,x) for(ll i = 0; i < ll(x); i++)
#define _REP_3(i,x,y) for(ll i = ll(x); i < ll(y); i++)
#define rep(...) _REP_OVERLOAD(__VA_ARGS__, _REP_3, _REP_2)(__VA_ARGS__)

#define _IREP_OVERLOAD(e1,e2,e3,_IREP,...) _IREP
#define _IREP_2(i,x) for(ll i = ll(x); i > -1; i--)
#define _IREP_3(i,x,y) for(ll i = ll(x); i > ll(y); i--)
#define irep(...) _IREP_OVERLOAD(__VA_ARGS__, _IREP_3, _IREP_2)(__VA_ARGS__)

#define all(x) (x).begin(),(x).end()
#define vec vector
#define _V1_OVERLOAD(e1,e2,e3,e4,_V1,...) _V1
#define _V1_2(type,name) vec<type> name
#define _V1_3(type,name,n) vec<type> name(n)
#define _V1_4(type,name,n,val) vec<type> name(n,val)
#define v1(...) _V1_OVERLOAD(__VA_ARGS__, _V1_4, _V1_3, _V1_2)(__VA_ARGS__)

#define _V2_OVERLOAD(e1,e2,e3,e4,e5,_V2,...) _V2
#define _V2_2(type,name) vec<vec<type>> name
#define _V2_3(type,name,h) vec<vec<type>> name(h)
#define _V2_4(type,name,h,w) vec<vec<type>> name(h,vec<type>(w))
#define _V2_5(type,name,h,w,val) vec<vec<type>> name(h,vec<type>(w,val))
#define v2(...) _V2_OVERLOAD(__VA_ARGS__, _V2_5, _V2_4, _V2_3, _V2_2)(__VA_ARGS__)

struct Pos{ll y,x; auto operator<=>(const Pos&) const = default;};
struct dPos{double y,x; auto operator<=>(const dPos&) const = default;};
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; }
const vec<Pos> Dir4={Pos(-1,0),Pos(1,0),Pos(0,-1),Pos(0,1)}; // UDLR
const vec<Pos> Dir8={Pos(-1,0),Pos(1,0),Pos(0,-1),Pos(0,1),Pos(-1,-1),Pos(1,1),Pos(-1,1),Pos(1,-1)};
bool inRange(int lower, int val, int upper){return lower<=val && val<upper;}
// struct item{ll a; auto operator<=>(const item&) const = default;};

ll llinf=ll(1e18)*2+10;
double dinf=1e24;

int main()
{
    cout << fixed << setprecision(15);

    ll N;
    double R;
    cin>>N>>R;
    v1(double,res);
    res.emplace_back(100);
    rep(i,N-1){
        res.emplace_back(res[i]*(1-R));
    }

    double _res=0;
    rep(i,N) _res+=res[i];
    cout<<_res<<'\n';

    return 0;

}

0