제출 #253902

#제출 시각아이디문제언어결과실행 시간메모리
253902MolukhyyehNadan (COCI18_nadan)C++14
50 / 50
1 ms256 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end() 

int const N = 200001;

int main(){
    int n, k;
    scanf("%d%d", &k, &n);
    int i = 1; 
    if(k >= (n * (n+1))/2){
    while(i < n){
       k -= i;
       printf("%d\n", i++);
    }
    printf("%d\n", k);
   }
   else {
     for(int j = 0; j<n-1; ++j)printf("1\n"), --k;
     printf("%d\n", k);
   }
}

컴파일 시 표준 에러 (stderr) 메시지

nadan.cpp: In function 'int main()':
nadan.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &k, &n);
     ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...