| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 786105 | devariaota | Exhibition (JOI19_ho_t2) | C++17 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll arr[100000];
ll sumtotal = 0, sum = 0;
void findsum(ll a, ll b, ll idx, ll sum){
if(a == idx){
arr[sum]++;
sumtotal += sum;
return;
}
for(int i = 1; i <= b; i++){
findsum(a, b, idx+1, sum+i);
}
}
int main(){
ll n, m;
for(int i = 0; i < 100; i++){
arr[i] = 0;
}
cin >> n >> m;
// for(ll i = 1; i <= m; i++){
// for(ll j = 1; j <= m; j++){
// for(int k = 1; k <= m; k++){
// for(int x = 1; x <= m; x++){
// cout << i << j << k << x << " " << i + j + k + x << endl;
// sumtotal += i + j + k + x;
// arr[i+j+k+x]++;
//
// }
// }
// }
// }
//
findsum(n, m, 0, 0);
for(int i = 0; i < 100003; i++){
if(arr[i] != 0) sum+=i;
}
cout << sum;
}
컴파일 시 표준 에러 (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... | ||||
