본문 바로가기

2011/04

또다시 안풀기 시작함 더보기
PKU 3074. Sudoku 스도쿠 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5294 Accepted: 1578 설명 스도쿠에서는 9 × 9 크기의 격자가 3 × 3 크기의 더 작은 격자들로 나뉘어져있습니다. 예를 들면, . 2 7 3 8 . . 1 . . 1 . . . 6 7 3 5 . . . . . . . 2 9 3 . 5 6 9 2 . 8 . . . . . . . . . . . 6 . 1 7 4 5 . 3 6 4 . . . . . . . 9 5 1 8 . . . 7 . . 8 . . 6 5 3 4 . 격자 안에 몇몇개의 숫자가 주어졌을 때, 당신은 남은 칸들에 1부터 9까지의 숫자들을 집어넣어야 하는데 이때 1부터 9까지의 각 숫자들은 (1) 9개의 3 × 3 격.. 더보기
PKU 3074. Sudoku Sudoku Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5294 Accepted: 1578 Description In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, . 2 7 3 8 . . 1 . . 1 . . . 6 7 3 5 . . . . . . . 2 9 3 . 5 6 9 2 . 8 . . . . . . . . . . . 6 . 1 7 4 5 . 3 6 4 . . . . . . . 9 5 1 8 . . . 7 . . 8 . . 6 5 3 4 . Given some of the numbers in the.. 더보기
PKU 3364. Black and white painting. [판정:AC] 사뿐하게 AC 어려운 문제인줄 알았는데 아니었구만 :) #include using namespace std; int main() { int n, m, c; int temp; cin >> n >> m >> c; while( (n != 0) || (m != 0) || (c != 0) ) { temp = (n - 7) * (m - 7); if( (temp % 2 == 1) && (c == 1) ) { cout m >> c; } return 0; } 더보기
PKU 3364. Black and white painting. AC get~ #include using namespace std; int main() { int n, m, c; while(cin >> n >> m >> c) { if (n == 0 && m == 0 && c == 0) { break; } if(n < 8 || m < 8) { cout 더보기
UVa 628. Passwords. AC g~e~t~ #include #include char words[101][300], input[10000]; int n, m, now, tot; int out[10]; void fuck(int x) { int i, k; if (x == tot) { k = 0; for (i = 0; input[i]; i++) { if (input[i] == '#') { printf("%s", words[now]); } else { putchar(out[k++] + '0'); } } putchar('\n'); return; } for (i = 0; i < 10; i++) { out[x] = i; fuck(x + 1); } } int main() { int i, j; while (~scanf("%d", &n)) { getchar(); f.. 더보기
PKU 3364. Black and white painting 흑백 채색 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2092 Accepted: 1396 설명 당신은 현대 그림이 많이 전시되어 있는 Centre Pompidou 를 방문중입니다. 특히 당신은 마치 체스판처럼 오로지 검은색과 흰색의 사각형들로만 이루어진 한 그림을 주목합니다 (맞닿은 사각형들은 같은 색이 아닙니다). 그런데 이 그림을 그린 화가는 그림을 그릴 때 problem A 의 도구를 사용하지 않았습니다. 너무도 심심했던 당신은, 이 작품 속에 얼마나 많은 8 × 8 크기의 체스판이 들어갈 수 있는지 알고 싶어졌습니다. 체스판의 오른쪽 제일 아래칸은 반드시 흰 색이어야 합니다. 입력 입력은 여러 개의 테스트 케이스들로 이루어집니다. 각 .. 더보기
PKU 3364. Black and white painting Black and white painting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2092 Accepted: 1396 Description You are visiting the Centre Pompidou which contains a lot of modern paintings. In particular you notice one painting which consists solely of black and white squares, arranged in rows and columns like in a chess board (no two adjacent squares have the same colour). By the way, the .. 더보기