답안 #83323

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
83323 2018-11-06T23:45:41 Z josiftepe Timovi (COCI18_timovi) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 2e5 + 10;
ll n, k, m;
l ret[maxn];
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
//    ifstream cin("in.txt");
    cin >> n >> k >> m;
    ll path_sz = 2 * n - 2;
    ll kids = path_sz * k;
    ll full = m / kids;
    ll rem_groups = (m % kids) / k;
    ll rem_children = (m % kids) % k;
    for(int i = 1; i <= path_sz; i ++){
        ret[i] = full * k;
    }
    for(int i = 1; i <= full; i ++){
        ret[i] += k;
    }
    ret[rem_groups + 1] += rem_children;
    cout << ret[1] << " ";
    for(int i = 2; i < n; i ++){
        ret[i] += ret[path_sz - i + 2];
        cout << ret[i] << " ";
    }
    cout << ret[n] << endl;
    return 0;
}

Compilation message

timovi.cpp:21:1: error: 'l' does not name a type
 l ret[maxn];
 ^
timovi.cpp: In function 'int main(int, const char**)':
timovi.cpp:32:9: error: 'ret' was not declared in this scope
         ret[i] = full * k;
         ^~~
timovi.cpp:32:9: note: suggested alternative: 'drem'
         ret[i] = full * k;
         ^~~
         drem
timovi.cpp:35:9: error: 'ret' was not declared in this scope
         ret[i] += k;
         ^~~
timovi.cpp:35:9: note: suggested alternative: 'drem'
         ret[i] += k;
         ^~~
         drem
timovi.cpp:37:5: error: 'ret' was not declared in this scope
     ret[rem_groups + 1] += rem_children;
     ^~~
timovi.cpp:37:5: note: suggested alternative: 'drem'
     ret[rem_groups + 1] += rem_children;
     ^~~
     drem