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;" andtomodifyaviewを使用して、 "createorreplaceviewview_nameasselect ..."を使用します

mysqlviewscanefectiveativeativeizedesignpatternslikeadapter、decorator、factory、andobserver.1)adapterpatternadaptsdatafromdifferenttablesintoaunifiedview.2)decoratorpatternenhancesdatawithedfieldsfieldsiffieldsiffieldsiffiedを

viewsinmysqlarebenefentialforsimprifiningcomplexqueries、拡張セキュリティ、ダタコンシーニング、および最適化されたパフォーマンスを保証する1)itsmplifyififycomplexqueriesbyencapsulsingthemintoreusableviews.2)viewsencurationecuritybycontrollingcescesces.3)

to CreateAsimpleviewinmysql、usethecreateviewstatement.1)DefinetheTheTheThecreateview_nameas.2)SpecifyTheSelectStatementtatementtatementtatementtatementtatementtatementedeSireddata.3)

tocleateusersinmysql、usethecreateuserstatement.1)foralocaluser:createUser'localuser '@' localhost'identifidedifiedifiedified 'securepassword';

mysqlviewshavelimitations:1)supportallsqloperations、制限、dataManipulationswithjoinsorubqueries.2)それらは、特にパフォーマンス、特にパルフェクソルラージャターセット

reperusermanmanagementInmysqliscialforenhancingsecurationsinginuring databaseaperation.1)usecreateusertoaddusers、指定connectionsourcewith@'localhost'or@'% '。

mysqldoes notimposeahardlimitontriggers、しかしpracticalfactorsdeTerminetheireffectiveuse:1)serverconufigurationStriggermanagement; 2)complentiggersincreaseSystemload;


ホット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 - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

SublimeText3 中国語版
中国語版、とても使いやすい

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)
