結果
問題 | No.311 z in FizzBuzzString |
ユーザー | Edfood |
提出日時 | 2020-08-24 16:06:55 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,500 ms |
コード長 | 499 bytes |
コンパイル時間 | 1,471 ms |
コンパイル使用メモリ | 166,068 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-25 03:01:37 |
合計ジャッジ時間 | 2,089 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 2 ms
4,348 KB |
testcase_03 | AC | 2 ms
4,348 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 2 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,348 KB |
testcase_07 | AC | 2 ms
4,348 KB |
testcase_08 | AC | 2 ms
4,348 KB |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 2 ms
4,348 KB |
ソースコード
#include<bits/stdc++.h> #define rep(i,N) for(ll (i)=0;(i)<(N);(i)++) #define chmax(x,y) x=max(x,y) #define chmin(x,y) x=min(x,y) using namespace std; typedef long long ll; typedef pair<int,int> P; const int mod = 1000000007; const int INF = 1001001001; int main() { ll n; cin >> n; ll three = n / 3; ll five = n / 5; ll threefive = n / 15; three -= threefive; five -= threefive; three *= 2; five *= 2; threefive *= 4; ll ans = three + five + threefive; cout << ans << endl; }