結果
| 問題 | No.1350 2019-6problem |
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-01-23 19:48:53 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 445 bytes |
| 記録 | |
| コンパイル時間 | 1,236 ms |
| コンパイル使用メモリ | 212,880 KB |
| 実行使用メモリ | 11,424 KB |
| 最終ジャッジ日時 | 2026-06-17 09:32:36 |
| 合計ジャッジ時間 | 5,044 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
signed main(){
ll a,b,k;
cin>>a>>b>>k;
if(a==1||b==1){
cout<<k<<endl;
return 0;
}
ll x=lcm(a,b);
vector<ll>vec;
for(int i=1;i<=x;i++){
if(i%a==0||i%b==0){
vec.push_back(i);
}
}
ll s=vec.size();
if(s>=k){
cout<<vec[k-1]<<endl;
return 0;
}
cout<<(k/s)*x+vec[k%s-1]<<endl;
return 0;
}
chacoder1