This file contains 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
#include"bits/stdc++.h" | |
/* | |
Problem Name: SEND MORE MONEY riddle in Artificial Intelligence | |
Problem Category: | |
----------------- | |
Constraint Optimisation Problem | |
Problem Description: | |
-------------------- | |
SEND | |
+ MORE |
This file contains 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
__author__ = 'wasi0013' | |
#Algorithm resources: http://crypto.interactive-maths.com/introduction-to-cryptography.html | |
def caeser_encrypt(text, key): | |
""" | |
Takes string as text and encrypts it with the key | |
>>> caeser_encrypt("Hello World",2) | |
'JGNNQ YQTNF' | |
>>> caeser_encrypt("Hello World",0) | |
'HELLO WORLD' |
This file contains 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 cProfile | |
def row_check(i,j): return i//9==j//9 | |
def col_check(i,j): return (i-j)%9==0 | |
def blocks_check(i,j): return i//27==j//27 and (i%9)//3==(j%9)//3 | |
def show(grid): | |
print "".join(num+" "+" "*((i+1)%3==0)+"\n"*((i+1)%9==0) for i,num in enumerate(grid)) | |
def solve(grid): |
This file contains 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
#include"bits/stdc++.h" | |
using namespace std; | |
main(){ | |
int vec[]={0,1,2,3,4,5,6,7},n=8,c=0; | |
set <int> mset,nset; | |
set<int>::iterator it; | |
do{ | |
mset.clear(); | |
nset.clear(); |
NewerOlder