結果
| 問題 | No.316 もっと刺激的なFizzBuzzをください |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-02-06 21:50:45 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 672 bytes |
| 記録 | |
| コンパイル時間 | 1,275 ms |
| コンパイル使用メモリ | 200,928 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-27 09:48:41 |
| 合計ジャッジ時間 | 2,521 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b)
{
while (b != 0)
{
long long temp = b;
b = a % b;
a = temp;
}
return a;
}
long long lcm(long long x, long long y)
{
return (x / gcd(x, y)) * y;
}
int main()
{
long long int n = 0;
cin >> n;
int a = 0, b = 0, c = 0;
cin >> a >> b >> c;
int countA = n / a;
int countB = n / b;
int countC = n / c;
int countAB = n/lcm(a,b);
int countBC = n/lcm(b,c);
int countAC =n/lcm(a,c) ;
int countABc = n/lcm(a,lcm(b,c));
cout << countA + countB + countC - countAB - countBC - countAC + countABc << endl;
}
vjudge1