結果
| 問題 | No.316 もっと刺激的なFizzBuzzをください |
| コンテスト | |
| ユーザー |
ひばち
|
| 提出日時 | 2019-12-19 14:37:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 797 bytes |
| コンパイル時間 | 1,730 ms |
| コンパイル使用メモリ | 167,472 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 01:09:58 |
| 合計ジャッジ時間 | 2,379 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 10 WA * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define itn long long
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,m) for(int i=(int)(m)-1;i>=0;--i)
#define debug(x) cout << #x << "=" << (x) << endl;
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> void fail(T v){cout << v << endl;exit(0);}
//template end
void solve(){
int N;
cin>>N;
int a[3];
rep(i,3)cin>>a[i];
ll res=0;
for(int i=1;i<8;i++){
ll p=1;int c=0;
rep(j,3)
if(1&i>>j)
{p*=a[j];c++;}
res+=(c%2?1:-1)*(N/p);
}
cout<<res<<endl;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
solve();
return 0;
}
ひばち