POJ 1166 Brute Force search is an enumeration

Source: Internet
Author: User

E.... Rice still did not read the question .... T_t .....

E.... This is the legendary violence .... It's bloody .... It's too violent ... Kokonoe for loop .... It's such a naked ac ....

Water is a bit of water. But.. I didn't think it was possible. Because each operation can only be done at most three times or it is repeated. So 、、、 attached code:

#include <stdio.h>
#include <iostream>
#include <string.h>
#define for (x) for (x=0; x<=3; ++x)
using namespace Std;

int main ()
{
int a[10], b[10], c[10];
for (int i=0; i<9; ++i)
CIN >> A[i];
for (B[0])
for (B[1])
for (B[2])
for (B[3])
for (B[4])
for (B[5])
for (B[6])
for (B[7])
for (B[8])
{
C[0] = (A[0] + b[0] + b[1] + b[3])% 4;
C[1] = (a[1] + b[0] + b[1] + b[2] + b[4])% 4;
C[2] = (a[2] + b[1] + b[2] + b[5])% 4;
C[3] = (A[3] + b[0] + b[3] + b[4] + b[6])% 4;
C[4] = (A[4] + b[0] + b[2] + b[4] + b[6] + b[8])% 4;
C[5] = (A[5] + b[2] + b[4] + b[5] + b[8])% 4;
C[6] = (A[6] + b[3] + b[6] + b[7])% 4;
C[7] = (A[7] + b[4] + b[6] + b[7] + b[8])% 4;
C[8] = (A[8] + b[5] + b[7] + b[8])% 4;
if (C[0] + c[1] +c[2] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] = = 0)
{
while (b[0]--) cout << "1";
while (b[1]--) cout << "2";
while (b[2]--) cout << "3";
while (b[3]--) cout << "4";
while (b[4]--) cout << "5";
while (b[5]--) cout << "6";
while (b[6]--) cout << "7";
while (b[7]--) cout << "8";
while (b[8]--) cout << "9";
cout << Endl;
return 0;
}
}
}

POJ 1166 Brute Force search is an enumeration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.