Submission #1238321

#TimeUsernameProblemLanguageResultExecution timeMemory
1238321RifalRice Hub (IOI11_ricehub)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <fstream> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#define endl '\n' #define pb push_back #define INF 20000000000 #define fi first #define se second //#define cin fin //#define cout fout using namespace std; //ofstream fout("input.txt"); //ifstream fin("output.txt"); //double const EPS = 1e-14; typedef long long ll; //const ll P = 10007; const ll mod = 1e9 + 7; //using namespace __gnu_pbds; //typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // find_by_order, order_of_key ll n, m, k; int main() { ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); cin >> n >> m >> k; ll arr[n]; for(int i = 0; i < n; i++) cin >> arr[i]; int best = 0; for(int i = 0; i < n; i++) { set<ll> st; for(int j = 0; j < n; j++) { st.insert(abs(arr[i]-arr[j])); } ll sum = 0; int cnt = 0; for(auto j : st) { if(sum+j <= k) {sum += j; cnt++;} else break; } best = max(best,cnt); } cout << best << endl; return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccSwVAy8.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc3IS6hZ.o:ricehub.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccSwVAy8.o: in function `main':
grader.cpp:(.text.startup+0xaa): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status