select mycol from my_table;
select MYCOL from MY_TABLE;
select Mycol from My_table;
create table my_table (mycol char(10));
хорошо, а create table "My_Table" ("Mycol" char(10));
- плохо, лучше так не делать. n, m = map(int, input().split())
parent, weight, rank = [-1 for _ in range(n)], [0 for _ in range(n)], [1 for _ in range(n)]
def find_set(v):
while parent[v] != -1 and parent[v] != v:
parent[v] = parent[parent[v]]
weight[parent[v]] += weight[v]
weight[v] = 0
v = parent[v]
if parent[v] == -1:
parent[v] = v
return v
def union_sets(a, b, cost):
a = find_set(a)
b = find_set(b)
if a != b:
if rank[a] < rank[b]:
a, b = b, a
parent[b] = a
weight[a] += cost
weight[a] += weight[b]
weight[b] = 0
if rank[a] == rank[b]:
rank[a] += 1
else:
weight[a] += cost
def main():
with open("input.txt", "r") as inp:
with open("output.txt", "w") as out:
inp.__next__()
for line in inp:
st = line.split()
if len(st) != 4:
out.write(str(weight[find_set(int(st[1]) - 1)]) + "\n")
else:
union_sets(int(st[1]) - 1, int(st[2]) - 1, int(st[3]))
main()
Стоит задача выделил из каждого видео 2 динамичные минуты.
VLC плеер считает и записывает кол-во изменений в соседних кадрах.
ostream& tab(ostream & output)
{
return output<< '\t';
}
cout << 'a' << tab << 'b' << 'c' << endl;
basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& (*pf) (basic_ostream<charT,traits>&) );
template< typename TInterface, typename... TArguments >
class AbstractFactory final
{
public:
// Produce the implementation, but return the pointer to interface.
inline std::shared_ptr<TInterface> Produce( const std::string& implementation_name, TArguments... arguments )
{
auto found_function = m_factory_functions.find( implementation_name );
return ( found_function == m_factory_functions.end() )? std::shared_ptr<TInterface>{} : found_function->second( std::forward<TArguments>( arguments )... );
};
// Define the implementation.
template< typename TImplementation >
inline const bool DefineImplementation()
{
return DefineImplementation<TImplementation>( TImplementation::ClassName() );
};
// Define the implementation.
template< typename TImplementation >
inline const bool DefineImplementation( const std::string& implementation_name )
{
// Abort the incorrect registration.
static_assert( std::is_base_of<TInterface, TImplementation>::value, "Implementation may only be derived from interface of Factory." );
auto found_function = m_factory_functions.find( implementation_name );
if( found_function == m_factory_functions.end() )
{
m_factory_functions[ implementation_name ] = &AbstractFactory<TInterface, TArguments...>::template ConstructImplementation<TImplementation>;
return true;
};
return false;
};
// Check the implementation name is already defined.
inline const bool IsImplementationDefined( const std::string& implementation_name ) const
{
return m_factory_functions.find( implementation_name ) != m_factory_functions.end();
};
private:
// The factory function just produce implementation.
template< typename TImplementation >
static std::shared_ptr<TInterface> ConstructImplementation( TArguments... arguments )
{
return std::static_pointer_cast<TInterface>(
std::make_shared<TImplementation>( std::forward<TArguments>( arguments )... )
);
};
private:
// Factory function produces the implementations of TInterface.
using FactoryFunction = std::shared_ptr<TInterface> (*)( TArguments... arguments );
std::unordered_map<std::string, FactoryFunction> m_factory_functions;
};