結果

問題 No.2526 Kth Not-divisible Number
ユーザー DeltaStructDeltaStruct
提出日時 2023-11-03 21:32:04
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 3,565 ms
コンパイル使用メモリ 245,440 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-11-03 21:32:19
合計ジャッジ時間 6,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 290 ms
4,348 KB
testcase_04 AC 282 ms
4,348 KB
testcase_05 AC 302 ms
4,348 KB
testcase_06 AC 279 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
#define int long long
  int q,a,b,c,x,y,z; cin >> q;
while(q--){
  cin >> a >> b >> c;
  x=0,y=0,z=c;
  while(z/a!=x||z/b!=y) x = z/a,y = z/b,z=(c+x+y)-(c+x+y)/lcm(a,b);
cout << z << endl;
}
}
0