Special Judge에는 이상이 없습니다.
소스를 올려주시면, 어떤 부분에 실수가 있는지 알려드릴 수 있습니다.
#include <cstdio>
#include <memory.h>
int d[1000];
int sol[1000];
int idx;
int main() {
int first, second, third, mx=0;
int tmp;
scanf("%d", &first);
tmp = first;
for (int i=first-1; i>=1; i--) {
memset(d, 0, sizeof(d));
idx = 0;
second = i;
first = tmp;
d[idx++] = first;
d[idx++] = second;
while (true) {
third = first-second;
if (third<0) break;
d[idx++] = third;
first = second;
second = third;
}
if (mx<idx) {
mx = idx;
for (int j=0; j<mx; j++) sol[j] = d[j];
}
}
printf("%d\n", mx);
for (int i=0; i<mx; i++) printf("%d ", sol[i]);
printf("\n");
return 0;
}
댓글을 작성하려면 로그인해야 합니다.
sbjwin 9년 전
제가 제출한 소스 분명히 이상없는데 special judge 된 건지 모르겠는데
오답나는게 이해가 안 되네요...