답안 #862282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
862282 2023-10-18T01:18:45 Z fdagdg Timovi (COCI18_timovi) C++17
0 / 80
2 ms 352 KB
#include <bits/stdc++.h>
#define ll long long
#define FASTER ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define NAME "equa"
#define F first
#define S second
#define mp(_a,_b) make_pair(_a,_b)
#define matrix vector<vector<ll>>
const int nmax=1e5+7;
const int mod=1e7+7;
const int oo=1e5+7;
using namespace std;
typedef pair<int,int> ii;
typedef pair<ll,int> li;
int n,k,m,ans[2*nmax];
int main() {
    FASTER
    freopen(NAME".inp","r",stdin);
    freopen(NAME".out","w",stdout);
    cin >> n >> k >> m;
    int i=0;
    bool kt=0;
    while(m){
        if(!kt){
            ans[i]+=min(m,k);
            m-=min(m,k);
            i++;
            if(i==n-1)kt=1;
        }
        if(kt){
            ans[i]+=min(m,k);
            m-=min(m,k);
            i--;
            if(i==0)kt=0;
        }
    }
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
    return 0;
}

Compilation message

timovi.cpp: In function 'int main()':
timovi.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     freopen(NAME".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
timovi.cpp:19:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     freopen(NAME".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Incorrect 1 ms 348 KB Output isn't correct
7 Incorrect 2 ms 348 KB Output isn't correct
8 Incorrect 2 ms 352 KB Output isn't correct