結果

問題 No.358 も~っと!門松列
ユーザー CodeCreater123
提出日時 2024-11-14 22:19:39
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 329 ms / 1,000 ms
コード長 2,682 bytes
コンパイル時間 3,527 ms
コンパイル使用メモリ 276,248 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-14 22:19:50
合計ジャッジ時間 9,931 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

//
// 便
    
// Code by ttq012.
#include <bits/stdc++.h>
#define eb emplace_back
#define int long long
using namespace std;
const int N = 500100;
const int mod = 1e9 + 7;
const int base = 256;
const int inf = 0x0d000721ll << 2 | 0xAC66666;
namespace ttq012 {
int read() {
int o = 1, x = 0;
char ch;
while (!isdigit(ch = getchar())) {
if (ch == '-') {
o = -o;
}
}
x = ch & 15;
while (isdigit(ch = getchar())) {
x = (x << 3) + (x << 1) + (ch & 15);
}
return x * o;
}
int exgcd(int a, int b, int &x, int &y) {
if (!b) {
x = 1, y = 0;
return a;
}
int g, xp, yp;
g = exgcd(b, a % b, xp, yp);
x = yp, y = xp - yp * (a / b);
return g;
}
int ksm(int a, int b, int c) {
a %= c;
int ans = 1;
while (b) {
if (b & 1) {
ans = ans * a % c;
}
a = a * a % c;
b >>= 1;
}
return ans;
}
int Inv(int a, int Mod) {
return ksm(a, Mod - 2, Mod);
}
// calc a^(b^c)
int calcpow(int a, int b, int c) {
int k = ksm(b, c, mod - 1);
if (k >= mod - 1) {
k = k % (mod - 1) + (mod - 1);
}
return ksm(a, k, mod);
}
int gcd(int a, int b) {
return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
return a / gcd(a, b) * b;
}
void swap(int &a, int &b) {
a ^= b ^= a ^= b;
} } // using namespace ttq012;
namespace ttq012 {
struct myhash{
static uint64_t rand(uint64_t x){
x^=x<<13;
x^=x>>7;
return x^=x<<17;
}
size_t operator()(size_t x)const{
static const uint64_t f_rand=chrono::steady_clock::now().time_since_epoch().count();
return rand(x+f_rand);
}
};
int chk(int a, int b, int c) {
if ((a < b && b > c || a > b && b < c) && a != c) {
return 1;
}
return 0;
}
void run() {
int a = read(), b = read(), c = read();
if (chk(a, b, c)) {
cout << "INF\n";
} else {
int cnt = 0;
for (int i = 1; i < 1e7; ++i) {
if (chk(a % i, b % i, c % i)) {
++cnt;
}
}
cout << cnt << '\n';
}
} }
signed main() {
ttq012::run();
return 0;
}
/*
*/
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0