Skip to content

Instantly share code, notes, and snippets.

View Florian3k's full-sized avatar
🎩
doing things

Mikołaj Fornal Florian3k

🎩
doing things
View GitHub Profile
@Florian3k
Florian3k / analysis.draft.md
Created February 16, 2024 11:14 — forked from MattPD/analysis.draft.md
Program Analysis Resources (WIP draft)
#include <algorithm>
#include <numeric>
#include <iterator>
int findWinner( float c[30][5] )
{
float maxes[30];
for ( int i = 0; i < 30 ; i++ ) {
auto minmax = std::minmax_element(
std::begin(c[i]),
#!/usr/bin/python3
from random import shuffle
def filter_list(lst, nums):
return list( filter( lambda x: x not in nums, lst ) )
excludes = [7,10,13]
sources = filter_list( range( 1, 32 ), excludes)
targets = sources[:]
#include <algorithm>
namespace fornal {
int calcLoad(int sectors[], int n)
{
//return 0;
if (n > 43) {
n = 43;
}
int max = std::accumulate(sectors, sectors + (n > 7 ? 7 : n), 0);
void calcDelivery(int stock[], int demand[], int n)
{
int begin = 0;
int end = 0;
int deficit = 0;
for (int i = 0; i < n; ++i) {
int diff = stock[i] - demand[i];
if ( deficit == 0 ) {
enum class direction {
up, right, down, left
};
inline void rotate(direction& dir) {
switch (dir) {
case direction::right:
dir = direction::down;
return;
case direction::down:
dir = direction::left;
enum class direction {
up, right, down, left
};
inline void rotate(direction& dir) {
switch (dir) {
case direction::right:
dir = direction::down;
return;
case direction::down:
dir = direction::left;
int calcLoad(int sectors[], int n)
{
//return 0;
if (n > 43)
{
n = 43;
}
int max = std::accumulate(sectors, sectors + (n > 7 ? 7 : n), 0);
if (n <= 7)
{
import java.util.Scanner;
import java.io.PrintWriter;
public class HelloWorld {
private static Scanner s;
public static void main(String[] args){
System.out.println(Bownik() + Chuj());
s = new Scanner(System.in);
try {
System.out.print("Podaj liczbę ciągów: ");