結果
問題 | No.2742 Car Flow |
ユーザー | eve__fuyuki |
提出日時 | 2024-04-20 13:32:25 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 2,129 ms |
コンパイル使用メモリ | 203,672 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 09:02:01 |
合計ジャッジ時間 | 4,084 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 50 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/modint> using namespace std; using mint = atcoder::modint998244353; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; int cnt[2] = {0, 0}; for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x]++; } mint ans = min(cnt[0], cnt[1]); ans /= n; cout << ans.val() << endl; }