156892025-02-21 18:23:40999Maximális szorzat (50 pont)csharpForditási hiba
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using namespace std;
#define int long long

template<typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int INF = 1e12;

signed main(){
    int n,k,b;cin>>n>>k>>b;
    ordered_set<int> s;
    for(int i = 0;i<n;i++){
        int a;cin>>a;
        if(b==n)s.insert(-a);
        else s.insert(a);
    }
    if(b==n)b=0;
    while(k>0){
        auto it=s.find_by_order((b==0?0:b+1));
        int value=*it;
        s.erase(it);
        s.insert(value+1);
        k--;
    }
    if(*s.find_by_order(b+1)<0||b>0&&*s.find_by_order(b)>=0){
        cout<<-1;return 0;
    }
    int num=1;
    for(auto x:s)num*=x;
    cout<<num<<endl;

}
 
Forditási hiba
open /var/local/lib/isolate/424/box/main.exe: no such file or directory
main.cs(4,0): error CS1024: Wrong preprocessor directive
main.cs(5,0): error CS1024: Wrong preprocessor directive
main.cs(6,0): error CS1024: Wrong preprocessor directive
main.cs(6,6): error CS1525: Unexpected symbol `namespace', expecting `identifier' or `static'
main.cs(6,19): error CS1525: Unexpected symbol `;', expecting `identifier' or `static'
main.cs(7,15): error CS1514: Unexpected symbol `namespace', expecting `.' or `{'
main.cs(7,26): error CS1525: Unexpected symbol `;', expecting `identifier' or `static'
main.cs(8,15): error CS1514: Unexpected symbol `namespace', expecting `.' or `{'
main.cs(8,19): error CS1525: Unexpected symbol `;', expecting `identifier' or `static'
main.cs(10,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file
main.cs(17,4): error CS1525: Unexpected symbol `int', expecting `identifier' or `static'
main.cs(20,8): error CS1525: Unexpected symbol `int', expecting `identifier' or `static'
main.cs(21,24): error CS1525: Unexpected symbol `(', expecting `identifier' or `static'
main.cs(22,21): error CS1525: Unexpected symbol `(', expecting `identifier' or `static'
main.cs(23,5): error CS1514: Unexpected symbol `}', expecting `.' or `{'
Compilation failed: 15 error(s), 0 warnings