Submission #1324078

#TimeUsernameProblemLanguageResultExecution timeMemory
1324078aritro_Mutating DNA (IOI21_dna)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using ordset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

/*
less<T> can be changed to:
1. less_equal<T>
2. greater<T>

ordered_set functions:
1. *(os.find_by_order(x)) -> return the value at position x (0 base)
2. os.order_of_key(x) -> return the number of elements less than x
*/

typedef long long ll;
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(),a.end()

const int MOD=1000000007;

#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))

#define fios(); ios_base::sync_with_stdio(0);cin.tie(0);
#define fraction(x); cout.unsetf(ios::floatfield); cout.precision(x); cout.setf(ios::fixed,ios::floatfield);
#define file(); freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

string s1,s2;

int get_distance(int x,int y){
    //subtask 1
    x--,y--;
    int cnt=0;
    for(int i=x;i<=y;i++) cnt+=(s1[i]!=s2[i]);
    string t1,t2;
    for(int i=x;i<=y;i++){
        t1+=s1[i];
        t2+=s2[i];
    }
    sort(all(t1));
    sort(all(t2));
    if(t1!=t2) return -1;
    return (cnt+1)/2;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccCN35Nv.o: in function `main':
grader.cpp:(.text.startup+0x348): undefined reference to `init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status