| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 166666 | abil | Bootfall (IZhO17_bootfall) | C++14 | 2 ms | 252 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define all(s) s.begin(),s.end()
//#define int long long
using namespace std;
const int N = (1e6 + 12);
const int mod = (1e9 + 7);
const int INF = (0x3f3f3f3f);
int a[N];
main()
{
set<int > s;
int n;
cin >> n;
for(int i = 1;i <= n; i++){
scanf("%d", &a[i]);
s.insert(a[i]);
}
bool f = false;
for(int mask = 1;mask < (1 << n); mask++){
int sum = 0, sum1 = 0;
for(int i = 0;i < n; i++){
if(mask & i){
sum += a[i + 1];
}
else{
sum1 += a[i + 1];
}
}
if(sum == sum1){
f = true;
break;
}
}
if(!f){
cout << 0;
return 0;
}
cout << s.size() << endl;
for(auto to : s){
cout << to << " ";
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
