結果
| 問題 |
No.8044 April Sum of Odd
|
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-04-08 15:37:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 2,000 ms |
| コード長 | 431 bytes |
| コンパイル時間 | 548 ms |
| コンパイル使用メモリ | 62,848 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 22:52:21 |
| 合計ジャッジ時間 | 1,263 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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