All 6 sides of a cube are to becoated with paint. Each side is is coated uniformly with one color. When a selectionof n different colors of paint is available, how many different cubes can youmake? Note that any two cubes are onlyto be cal
All 6 sides of a cube are to becoated with paint. Each side is is coated uniformly with one color. When a selectionof n different colors of paint is available, how many different cubes can youmake?
Note that any two cubes are onlyto be called "different" if it is not possible to rotate the one intosuch a position that it appears with the same coloring as the other.
Input
Each line of the input filecontains a single integer n(0
Output
For each line of input produce oneline of output. This line should contain the number of different cubes that canbe made by using the according number of colors.
SampleInput Outputfor Sample Input
1 2 0 |
1 10 |
Problem setter: EricSchmidt
Special Thanks: DerekKisman, EPS
题意:求用n中颜色涂立方体的不同种数,能旋转到的算一种
题意:和上一题UVA - 10601 Cubes (组合+置换) 的立方体旋转考虑的分类是一样的,不过这里我们考虑的是涂面的情况
1.不变置换(1)(2)(3)(4)(5)(6), 共1个;
2.沿对面中心轴旋转 90度, 270度 (1)(2345)(6), (1)(5432)(6) 同类共 6个;
3.沿对面中心轴旋转 180度 (1)(24)(35)(6), 同类共 3个;
4.沿对角线轴旋转 120度, 240度 (152)(346), (251)(643) 同类共 8个;
5.沿对边中点轴旋转 180度 (16)(25)(43) 同类共 6个;
<strong>[cpp]</strong> view plaincopy


-
#include <iostream></iostream>
-
#include <cstdio></cstdio>
-
#include <cstring></cstring>
-
#include <cmath></cmath>
-
#include <algorithm></algorithm>
-
typedef long long ll;
-
using namespace std;
-
ll n;
-
ll still() {
-
return n * n * n * n * n * n;
-
}
-
ll point() {
-
return 4 * 2 * n * n;
-
}
-
ll edge() {
-
return 6 * n * n * n;
-
}
-
ll plane() {
-
return 3 * 2 * n * n * n + 3 * n * n * n * n;
-
}
-
ll polya() {
-
ll ans = 0;
-
ans += still();
-
ans += point();
-
ans += edge();
-
ans += plane();
-
return ans / 24;
-
}
-
int main() {
-
while (scanf("%lld", &n) != EOF && n) {
-
printf("%lld\n", polya());
-
}
-
return 0;
-
}

todropaViewInmysql, "dropviewifexistsview_name;"및 TomodifyAview를 사용하고 "createOrreplaceViewView_NameAsselect ...". "

mysqlViewScaneFeficTicallyINGILIDESIGNPATTORNSLIKEADAPTER, DECIARATOR, FACTORY 및 OBSERVER.1) AdapterPatternAdAptSDataFromDifferentTablesinToAunifiedView.2) Decor

viewsinmysqlarebeneficialforsimplifyingcomplexqueries, envancingsecurity, dataconsistency, andoptimizing promperformance

toeteimpleviewinmysql, usethecreateviewstatement.1) definetheviewwithReateViewview_nameas.2) specifyTesLectStatementToreTrievesiredData.3) usetheViewLikeAtableForqueries.ViewsSimplifyDataAccessAndenHances, ButconSiderFormance

toCreateUserSinmysql, usethecreateuserstatement.1) foralocaluser : createUser'LocalUser '@'localHost'IndifiedBy'SecurePassword '; 2) foremoteUser : createUser'RemoteUser'@'%'reidentifiedBy'StrongPassword ';

mysqlviewshavelimitations : 1) 그들은 upportallsqloperations, datamanipulation throughviewswithjoinsorbqueries를 제한하지 않습니다

적절한 usermanagementInmysqliscrucialforenhancingsecurityandensuringfefficientDatabaseOperation.1) USECREATEUSERTOWDDUSERS,@'localHost'or@'%'.

mysqldoes notimposeahardlimitontriggers, butpracticalfactorsdeteirefectiveuse : 1) ServerConfigurationimpactStriggerManagement; 2) 복잡한 트리거 스케일 스케일 사이드로드; 3) argertableSlowtriggerTriggerPerformance; 4) High ConconcercencyCancaUspriggerContention; 5) m


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

WebStorm Mac 버전
유용한 JavaScript 개발 도구

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)