結果
| 問題 |
No.316 もっと刺激的なFizzBuzzをください
|
| コンテスト | |
| ユーザー |
nxteru
|
| 提出日時 | 2018-10-28 18:00:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 650 bytes |
| コンパイル時間 | 903 ms |
| コンパイル使用メモリ | 81,972 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-19 07:12:02 |
| 合計ジャッジ時間 | 1,794 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 25 WA * 8 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int n,a,b,c;
int gcd(int x,int y){
if(x<y)swap(x,y);
if(x%y==0)return y;
return gcd(y,x%y);
}
int lca(int x,int y){
return x*y/gcd(x,y);
}
int main(void){
cin>>n>>a>>b>>c;
cout<<n/a+n/b+n/c-n/lca(a,b)-n/lca(b,c)-n/lca(c,a)+n/lca(lca(a,b),c)<<endl;
}
nxteru