12195 | 2024-12-08 14:03:01 | SRob | Úthasználati díj (75 pont) | cpp17 | Compilation error |
// uthasznalat.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int varosDb, K;
cin >> varosDb >> K;
int seged;
int egyDb = 0;
for (int i = 0; i < varosDb; i++)
{
cin >> seged;
if (seged== 1)
{
egyDb++;
}
}
int megoldas = 0;
if (egyDb >1)
{
megoldas = (egyDb-K+1)*(K-1)+(K*K/2 - K);
}
else
{
megoldas = 0;
}
cout << megoldas;
}
open /var/local/lib/isolate/411/box/a.out: no such file or directory
main.cpp:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.