結果
問題 |
No.555 世界史のレポート
|
ユーザー |
|
提出日時 | 2017-08-11 23:39:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 1,528 ms |
コンパイル使用メモリ | 165,380 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 22:06:47 |
合計ジャッジ時間 | 2,214 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 14 |
ソースコード
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int main() { int n,c,v;scanf("%d%d%d",&n,&c,&v); int a=1,b=0; int ans=0; while(a<n){ if(b==0){ ans+=c;b=a;continue; } if(c+((n-a)/a+((n-a)%a>0))*v<=((n-a)/b+((n-a)%b>0))*v){ ans+=c;b=a; } else{ ans+=v;a+=b; } } printf("%d\n",ans); }