結果
| 問題 |
No.816 Beautiful tuples
|
| コンテスト | |
| ユーザー |
Cvadogsan
|
| 提出日時 | 2019-04-19 21:47:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 647 bytes |
| コンパイル時間 | 2,067 ms |
| コンパイル使用メモリ | 191,824 KB |
| 最終ジャッジ日時 | 2025-01-07 02:40:03 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 2 RE * 5 TLE * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
19 | printf("%d", c);
| ~^ ~
| | |
| int size_t {aka long unsigned int}
| %ld
ソースコード
#include <bits/stdc++.h>
#define ll long long
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
int main() {
INIT;
int a,b;
cin >> a >> b;
for (size_t c = b-a; c < 10^18; c+=b) {
if((a+b) % c == 0 && (c+b) % a == 0 && (a+c) % b == 0){
//cout << c << endl;
printf("%d", c);
exit(0);
}
}
//cout << "-1" << endl;
printf("-1");
return 0;
}
Cvadogsan