답안 #253896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
253896 2020-07-29T05:11:47 Z Molukhyyeh Nadan (COCI18_nadan) C++14
10 / 50
1 ms 384 KB
#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; 
    while(i < n && k > 0){
       printf("%d\n", i++);
       k-=i;
    }
    printf("%d\n", k);
}

Compilation message

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);
     ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Incorrect 1 ms 256 KB Output isn't correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB Output isn't correct
6 Incorrect 0 ms 256 KB Output isn't correct
7 Incorrect 0 ms 256 KB Output isn't correct
8 Correct 0 ms 384 KB Output is correct
9 Incorrect 0 ms 256 KB Output isn't correct
10 Incorrect 0 ms 256 KB Output isn't correct