Submission #00265
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #include <bits/stdc++.h> #define endl "\n" #define INF INT_MAX using namespace std; int main(){ #define int long long cin.tie(nullptr);ios::sync_with_stdio( false ); while ( true ){ int y,c,r; cin >>y>>c>>r; if (y == 0&&c == 0&&r == 0) return 0; int R = 10000000000,L = 0; while (R-1 > L){ // cout <<R<<" "<<L<<endl; //m円でできるか int m = (R+L)/2; int x = m; for ( int i = 0;i < y;i++){ x -= c; x += (x*r)/100; if (x > m){ x = 1; break ; } } // cout <<x<<endl; if (x >= 0){ R = m; } else { L = m; } } cout <<R<<endl; } } //100000 100000 1 |
ステータス
項目 | データ |
---|---|
問題 | 0008 - 毎日がHoliday |
ユーザー名 | ei2332 |
投稿日時 | 2024-03-29 14:36:41 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 775 Byte |
最大実行時間 | 131 ms |
最大メモリ使用量 | 648 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 30 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | WA | 131 ms | 604 KB |
1
|
B2 | WA | 114 ms | 564 KB |
1
|
B3 | WA | 126 ms | 648 KB |
1
|
B4 | WA | 112 ms | 608 KB |
1
|