結果
| 問題 | No.8044 April Sum of Odd |
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-04-08 15:37:04 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 431 bytes |
| 記録 | |
| コンパイル時間 | 487 ms |
| コンパイル使用メモリ | 73,532 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-23 02:10:49 |
| 合計ジャッジ時間 | 1,669 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include <iostream>
int main() {
int n,m;
std::cin >> n >> m;
long ans=0;
int cnt=0;
long a;
for (int i=0;i<n;i++) {
std::cin >> a;
if (a&0x01) {
ans+=a;
cnt++;
}
else {
if (cnt>=m) std::cout << ans << std::endl;
ans=0;
cnt=0;
}
}
if (cnt>=m) std::cout << ans << std::endl;
ans=0;
cnt=0;
}
greentea011