Just run it through the pre-processor (gcc -E) to see
Hereās the output of doing that; cutting out all the boring stuff; then pretty-ing it up:
[simon@simon-laptop][17:15:44]
[~/devel/hackerrank/otherpeoples]>gcc -E revin_99-ACCBIP.cpp | sed -ne '/using namespace std;/,$ p' | grep -v "^#" | clang-format
using namespace std;
long long int fun(long long int num, int colour,
vector<long long int> lines_set[]) {
vector<long long int> lines = lines_set[colour];
for (long long int i = 0; i < lines.size() && num > 0; i++) {
long long int temp = min(lines[i], num);
lines[i] = lines[i] - temp;
num = num - temp;
}
if (num > 0) {
return 0;
}
long long int sum1 = 0;
long long int k = lines.size();
for (int i = 0; i < k; i++)
sum1 += lines[i];
long long int sum2 = 0;
long long int temp[k + 1];
for (long long int i = 0; i < k; i++) {
temp[i] = lines[i] * (sum1 - lines[i]);
sum2 += temp[i];
}
sum2 /= 2;
long long int sum3 = 0;
for (long long int i = 0; i < k; i++)
sum3 += lines[i] * (sum2 - temp[i]);
sum3 /= 3;
return sum3;
}
int main() {
long long int t;
cin >> t;
while (t--) {
long long int N, C, K;
cin >> N >> C >> K;
unordered_map<long long int, int> colour[C + 1];
vector<long long int> lines[C + 1];
for (int i = 1; i <= N; i++) {
long long int a, b, col;
cin >> a >> b >> col;
colour[col][a]++;
}
long long int V[C + 1] = {0};
for (long long int i = 1; i <= C; i++) {
cin >> V[i];
}
for (long long int i = 1; i <= C; i++) {
vector<long long int> lines_set;
for (auto it : colour[i]) {
lines_set.push_back(it.second);
}
sort(lines_set.begin(), lines_set.end());
lines[i] = lines_set;
}
long long int dp[K + 1][C + 1];
long long int fun_mem[K + 1][C + 1];
for (int i = 0; i <= K; i++) {
for (long long int j = 0; j <= C; j++) {
dp[i][j] = 0x7fffffffffffffffLL;
if (j == 0) {
dp[i][j] = 0;
}
fun_mem[i][j] = -1;
}
}
for (long long int i = 0; i <= K; i++) {
for (long long int j = 1; j <= C; j++) {
long long int max_lines_rem = i / V[j];
for (long long int k = 0; k <= max_lines_rem; k++) {
long long int val_rem = k * V[j];
if (fun_mem[k][j] == -1) {
fun_mem[k][j] = fun(k, j, lines);
}
dp[i][j] = min(dp[i][j], dp[i - val_rem][j - 1] + fun_mem[k][j]);
}
}
}
cout << dp[K][C] << "\n";
}
return 0;
}
I have an appeal; I have been accused of plagiarism; whereas Iām sure I have never used any code not my own or discusses solutions. First off, can someone point me to how to see which problem in which Iāve been accused? On my profile I see only the competitions in which Iām accused. I shall then post further with my appeal.
It is a real account. I was 5 star before this. Check my submission history please.
EDIT; Please also try to avoid any unnecessary hate. I understand that you automaticaly percieve of me as a cheater trying to act innocent but I really am not; well at least give me the benefit of doubt and help me figure out what exactly was flagged.
Also to repeat, this is NOT a fake account. It is on THIS account that I have been accused
actually both were my submissions⦠At that time I just started coding and was not aware of Moss so I made 2 ids for fun and submitted the same code on both when I heard about Moss I myself reported my both ids and deleted both of them.
Hey all, this august long challenge was one of such contest in which i had worked a lot. SInce i had started since last two months, therefore i wanted to give my best shot. I did till 430 and struck at chefwed partially. My twocases was not working , i worked hard to get them right . But could not do so. But when i looked at submissions i was amazed. Chefwed had alot of correct submissions.So out of just curiosity i stalked some college friends codes and got amazed they were all same. Putting them down.
Shri Ramdeobaba college of engineering (One of the best private institution in central maharashtra)
WoW, checked the second one, Iām so confused on how does this even works. then Checked two more solution from his profile, dude surely loves america.
This guy has cheated in almost every contest . He has made three codechef id just to cheat and increase the rating.
All three idās are of same person. I mean just look at this id ashis_19 | CodeChef User Profile for Code_Kar | CodeChef . How can someone who was performing so bad till july cookoff 2020 suddenly improved a lot just in a matter of few days and got rank of 265 in july lunchtime and rank 469 in august long challenge.
I have checked all the three profiles of this guy .Same cheating case in these contest too by this guy.
3.July challenge.
4.August long challenge.
5. June lunchtime.
6.April challenge.
Codechef kindly look into the matter . I am 100 percent sure this guy cheated in august challenge and july lunchtime . This guy has become 4 star just due to cheating.