Submission #1322929


Source Code Expand

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/



int N, A[101010];
int dp[101][10101];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i];
    
    dp[0][0] = 1;
    rep(i, 0, N) rep(j, 0, 10001) if(dp[i][j]) {
        dp[i + 1][j] = 1;
        dp[i + 1][j + A[i]] = 1;
    }

    int ans = 0;
    rep(j, 0, 10001) if (j % 10 && dp[N][j]) ans = max(ans, j);
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - Bugged
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1300 Byte
Status AC
Exec Time 3 ms
Memory 3072 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 12
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12
Case Name Status Exec Time Memory
a01 AC 2 ms 2304 KB
a02 AC 2 ms 2304 KB
a03 AC 2 ms 2304 KB
b04 AC 2 ms 2304 KB
b05 AC 3 ms 3072 KB
b06 AC 2 ms 2816 KB
b07 AC 3 ms 2816 KB
b08 AC 3 ms 2816 KB
b09 AC 3 ms 2944 KB
b10 AC 2 ms 2304 KB
b11 AC 3 ms 3072 KB
b12 AC 3 ms 2816 KB