CSES - Datatähti 2019 alku - Results
Submission details
Task:Kolikot
Sender:N00B.exe
Submission time:2018-10-07 15:12:20 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp:1:1: error: stray '\377' in program
 ��# i n c l u d e   < i o s t r e a m > 
 
 ^
input/code.cpp:1:2: error: stray '\376' in program
 ��# i n c l u d e   < i o s t r e a m > 
 
  ^
input/code.cpp:1:3: error: stray '#' in program
 ��# i n c l u d e   < i o s t r e a m > 
 
   ^
input/code.cpp:1:4: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
    ^
input/code.cpp:1:6: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
      ^
input/code.cpp:1:8: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
        ^
input/code.cpp:1:10: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
          ^
input/code.cpp:1:12: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
            ^
input/code.cpp:1:14: warning: null character(s) ignored
 ��# i n c l u d e   < i o s t r e a m > 
 
              ^
input/code.cpp:1:16: warning: null characte...

Code

��#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n, ans, omit, i;
int test = 0;
scanf("%d", &n);
ans = (int)(sqrt(8*n + 1) / 2 - 0.5);
printf("%d\n", ans);
ans++;
omit = ans*((ans+1.0)/2)-n;
for(i = 1; i <= ans; i++)
{
if(i == omit)
{ continue; }
if(n == 0)
{ printf(" "); }
else
{ n = 0; }
printf("%d", i);
test += i;
}
printf("\n");
return 0;
}