| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 113599 | 梁乃元 | 分割等和子集 | C++ | Accepted | 100 | 0 MS | 252 KB | 547 | 2023-12-02 11:13:01 |
# include <bits/stdc++.h> using namespace std ; int a [114514] ; int m ; void dfs ( int cur , int s1 , int s2 ) { if ( cur > m && s1 == s2 ) { cout << "true" << endl ; exit ( 0 ) ; return ; } else if ( cur <= m ) { dfs ( cur + 1 , s1 + a [cur] , s2 ) ; dfs ( cur + 1 , s1 , s2 + a [cur] ) ; } else { return ; } } int main ( ) { cin >> m ; for ( int i = 1 ; i <= m ; i ++ ) { cin >> a [i] ; } sort ( a + 1 , a + m + 1 ) ; dfs ( 1 , 0 , 0 ) ; cout << "false" << endl ; return 0 ; }