結果
| 問題 | No.51 やる気の問題 | 
| コンテスト | |
| ユーザー |  tenkyu9 | 
| 提出日時 | 2018-03-07 09:34:25 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 415 bytes | 
| コンパイル時間 | 589 ms | 
| コンパイル使用メモリ | 81,448 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-25 02:44:58 | 
| 合計ジャッジ時間 | 1,373 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<utility>
using namespace std;
typedef long long int ll;
int main(){
  ll w, d, tmp;
  cin >> w >> d;
  ll n=d;
  for(int i=0; i<n; i++){
    tmp=w;
    w=w/(d*d);
    d--;
    if(i<n-1){
      w=tmp-w;
    }
  }
  cout << w << endl;
  return 0;
}
            
            
            
        