/* https://www.ptt.cc/bbs/C_Chat/M.1417696853.A.E8F.html https://paiza.jp/poh/enkoi  提出言語:C++  得点:100 点  結果:  テストケース1:success 0.01秒  テストケース2:success 0.01秒  テストケース3:success 0.01秒  テストケース4:success 0.22秒  テストケース5:success 0.22秒 */ #include #include using namespace std; int main(void) { int range, input_n; int i, input, ans=0, tmp=0, offset; vector v; vector ::iterator it; cin >> range >> input_n; for (i=0; i> input; v.push_back (input); if (i ans) ans = tmp + offset; tmp = tmp + offset; if (*(it+range) == -1) break; } cout << ans << endl; return 0; }