Created
February 28, 2015 00:55
-
-
Save chiro/4658fa0671b82df35053 to your computer and use it in GitHub Desktop.
requests
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
POST / HTTP/1.1 | |
Host: localhost:8000 | |
Accept-Encoding: gzip | |
Content-Length: 3482 | |
Content-Type: application/x-www-form-urlencoded | |
csrf_token=32bddc9d70f30f3441d01309c7117708&action=submitSolutionFormSubmitted&submittedProblemIndex=A&source=%23include%20%3Ciostream%3E%0D%0A%23include%20%3Cstring%3E%0D%0A%23include%20%3Cvector%3E%0D%0A%23include%20%3Cset%3E%0D%0A%23include%20%3Calgorithm%3E%0D%0Ausing%20namespace%20std%3B%0D%0A%0D%0A%2F%2F%20top%20bottom%20right%20left%20front%20back%0D%0A%0D%0Astring%20x%28string%20%26s%29%20%7B%0D%0A%20%20%20%20string%20ret%20%3D%20%22aaaaaa%22%3B%0D%0A%20%20%20%20ret%5B0%5D%20%3D%20s%5B4%5D%3B%0D%0A%20%20%20%20ret%5B1%5D%20%3D%20s%5B5%5D%3B%0D%0A%20%20%20%20ret%5B2%5D%20%3D%20s%5B2%5D%3B%0D%0A%20%20%20%20ret%5B3%5D%20%3D%20s%5B3%5D%3B%0D%0A%20%20%20%20ret%5B4%5D%20%3D%20s%5B1%5D%3B%0D%0A%20%20%20%20ret%5B5%5D%20%3D%20s%5B0%5D%3B%0D%0A%20%20%20%20return%20ret%3B%0D%0A%7D%0D%0A%0D%0Astring%20y%28string%20%26s%29%20%7B%0D%0A%20%20%20%20string%20ret%20%3D%20%22aaaaaa%22%3B%0D%0A%20%20%20%20ret%5B0%5D%20%3D%20s%5B3%5D%3B%0D%0A%20%20%20%20ret%5B1%5D%20%3D%20s%5B2%5D%3B%0D%0A%20%20%20%20ret%5B2%5D%20%3D%20s%5B0%5D%3B%0D%0A%20%20%20%20ret%5B3%5D%20%3D%20s%5B1%5D%3B%0D%0A%20%20%20%20ret%5B4%5D%20%3D%20s%5B4%5D%3B%0D%0A%20%20%20%20ret%5B5%5D%20%3D%20s%5B5%5D%3B%0D%0A%20%20%20%20return%20ret%3B%0D%0A%7D%0D%0A%0D%0Astring%20z%28string%20%26s%29%20%7B%0D%0A%20%20%20%20string%20ret%20%3D%20%22aaaaaa%22%3B%0D%0A%20%20%20%20ret%5B0%5D%20%3D%20s%5B0%5D%3B%0D%0A%20%20%20%20ret%5B1%5D%20%3D%20s%5B1%5D%3B%0D%0A%20%20%20%20ret%5B2%5D%20%3D%20s%5B4%5D%3B%0D%0A%20%20%20%20ret%5B3%5D%20%3D%20s%5B5%5D%3B%0D%0A%20%20%20%20ret%5B4%5D%20%3D%20s%5B3%5D%3B%0D%0A%20%20%20%20ret%5B5%5D%20%3D%20s%5B2%5D%3B%0D%0A%20%20%20%20return%20ret%3B%0D%0A%7D%0D%0A%0D%0Aint%20main%28%29%20%7B%0D%0A%20%20%20%20string%20col%3B%0D%0A%20%20%20%20cin%3E%3Ecol%3B%0D%0A%0D%0A%20%20%20%20set%3Cstring%3E%20s%3B%0D%0A%20%20%20%20sort%28col.begin%28%29%2Ccol.end%28%29%29%3B%0D%0A%0D%0A%20%20%20%20do%20%7B%0D%0A%0D%0A%20%20%20%20%20%20%20%20string%20ss%20%3D%20col%3B%0D%0A%20%20%20%20%20%20%20%20for%28int%20i%3D0%3B%20i%3C4%3B%20%2B%2Bi%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%28s.find%28ss%29%20%21%3D%20s.end%28%29%29%20goto%20NEXT%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20for%28int%20j%3D0%3B%20j%3C4%3B%20%2B%2Bj%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ss%20%3D%20z%28ss%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%28s.find%28ss%29%20%21%3D%20s.end%28%29%29%20goto%20NEXT%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20ss%20%3D%20x%28ss%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20for%28int%20i%3D0%3B%20i%3C4%3B%20%2B%2Bi%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%28s.find%28ss%29%20%21%3D%20s.end%28%29%29%20goto%20NEXT%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20for%28int%20j%3D0%3B%20j%3C4%3B%20%2B%2Bj%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ss%20%3D%20z%28ss%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%28s.find%28ss%29%20%21%3D%20s.end%28%29%29%20goto%20NEXT%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20ss%20%3D%20y%28ss%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20s.insert%28col%29%3B%0D%0A%0D%0A%20%20%20%20NEXT%3A%3B%0D%0A%20%20%20%20%7D%20while%28%20next_permutation%28col.begin%28%29%2C%20col.end%28%29%29%20%29%3B%0D%0A%0D%0A%20%20%20%20cout%3C%3Cs.size%28%29%3C%3Cendl%3B%0D%0A%7D%0D%0A&programTypeId=1&sourceFile=&_tta=222 | |
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
POST /?csrf_token=32bddc9d70f30f3441d01309c7117708 HTTP/1.1 | |
Host: localhost:8000 | |
Content-Length: 2444 | |
Accept-Encoding: gzip, deflate | |
Accept: */* | |
User-Agent: python-requests/2.5.3 CPython/2.7.9 Darwin/14.1.0 | |
Connection: keep-alive | |
Cookie: X-User=0ee8330da0293d680f6fb6cc05491e9d744cc1114383819b0a54e5b7e01a1df485c76f8c65896cbd | |
Content-Type: multipart/form-data; boundary=ea5b4f4bfbc64e9782796e72ed2b7400 | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="csrf_token"; filename="csrf_token" | |
32bddc9d70f30f3441d01309c7117708 | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="_tta"; filename="_tta" | |
222 | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="sourceFile"; filename="sourceFile" | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="submittedProblemIndex"; filename="submittedProblemIndex" | |
A | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="source"; filename="98A.cpp" | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
using namespace std; | |
// top bottom right left front back | |
// Some comments? | |
string x(string &s) { | |
string ret = "aaaaaa"; | |
ret[0] = s[4]; | |
ret[1] = s[5]; | |
ret[2] = s[2]; | |
ret[3] = s[3]; | |
ret[4] = s[1]; | |
ret[5] = s[0]; | |
return ret; | |
} | |
string y(string &s) { | |
string ret = "aaaaaa"; | |
ret[0] = s[3]; | |
ret[1] = s[2]; | |
ret[2] = s[0]; | |
ret[3] = s[1]; | |
ret[4] = s[4]; | |
ret[5] = s[5]; | |
return ret; | |
} | |
string z(string &s) { | |
string ret = "aaaaaa"; | |
ret[0] = s[0]; | |
ret[1] = s[1]; | |
ret[2] = s[4]; | |
ret[3] = s[5]; | |
ret[4] = s[3]; | |
ret[5] = s[2]; | |
return ret; | |
} | |
int main() { | |
string col; | |
cin>>col; | |
set<string> s; | |
sort(col.begin(),col.end()); | |
do { | |
string ss = col; | |
for(int i=0; i<4; ++i) { | |
if(s.find(ss) != s.end()) goto NEXT; | |
for(int j=0; j<4; ++j) { | |
ss = z(ss); | |
if(s.find(ss) != s.end()) goto NEXT; | |
} | |
ss = x(ss); | |
} | |
for(int i=0; i<4; ++i) { | |
if(s.find(ss) != s.end()) goto NEXT; | |
for(int j=0; j<4; ++j) { | |
ss = z(ss); | |
if(s.find(ss) != s.end()) goto NEXT; | |
} | |
ss = y(ss); | |
} | |
s.insert(col); | |
NEXT:; | |
} while( next_permutation(col.begin(), col.end()) ); | |
cout<<s.size()<<endl; | |
} | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="action"; filename="action" | |
submitSolutionFormSubmitted | |
--ea5b4f4bfbc64e9782796e72ed2b7400 | |
Content-Disposition: form-data; name="programTypeId"; filename="programTypeId" | |
16 | |
--ea5b4f4bfbc64e9782796e72ed2b7400-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment