- Care e publicul care îți va rezolva problema?
- Ce cunoștiințe au?
- Cât timp trebuie să ia rezolvarea?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read and convert the matrix | |
s = 0 | |
for i in range(lines): | |
m.append([1 if j == '#' else 0 for j in f.readline()]) | |
s += sum(m[-1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get first row with a black cell | |
while not filter(None, m[0]): | |
m.pop(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get left right indices | |
l = [i for i, x in enumerate(m[0]) if x] | |
left = l[0] | |
right = l[-1] + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sum up the portion of the matrix where the square | |
# should be | |
new_sum = 0 | |
for line in range(sum_on_a_line): | |
if sum_on_a_line != sum(line[left : right]): | |
break | |
else: | |
new_sum += sum_on_a_line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
f = open('input.in') | |
cases = int(f.readline()) | |
for case in range(cases): | |
m = [ ] | |
lines = int(f.readline()) | |
# read and convert the matrix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math;f=open('i');r=f.readline | |
for _ in range(1,int(r())+1): | |
m=[];s=b=0 | |
for i in range(int(r())):m.append([1 if j=='#' else 0 for j in r()]);s+=sum(m[i]) | |
a=int(math.sqrt(s)) | |
while not filter(None,m[0]):m.pop(0) | |
l=[i for i,x in enumerate(m[0]) if x];x=l[0];y=l[-1] | |
for v in m: | |
if a!=sum(v[x:y+1]):break | |
else:b+=a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do you hate coming at the office, opening your text editor, looking over the Github issues, seeing a bug you can easily fix and bang... you forgot to open Vagrant. So, you type like a robot <i>vagrant up</i>, you wait 90 seconds for the beast to load and bang... you forgot to connect to the VPN and Puppet cannot sync your packages. | |
You code the whole day at work, pack your things, arrive home, start browsing threads on Hacker News and bang... you have low battery because you forgot to close Vagrant. Damn the technology stack is too big to fit my tiny brain cache. Well, for those of you on OSX, I made <a href="https://github.com/palcu/dotfiles/tree/master/applescripts">some tiny little AppleScripts</a> that solve these annoying little pesky problems.<br /> | |
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> | |
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-tBswMBVY02k/Uv-1LjKELxI/AAA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************** | |
* Alex Palcuie | |
* Romania - 2013 | |
* alex [dot] palcuie [at] gmail [dot] com | |
* http://palcu.blogspot.com/ | |
****************************************************/ | |
#include <vector> | |
#include <list> | |
#include <map> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am palcu on github. | |
* I am palcu (https://keybase.io/palcu) on keybase. | |
* I have a public key whose fingerprint is 6358 CF15 1950 FF81 5071 E002 C855 EF72 A8DF C37F | |
To claim this, I am signing this object: |