From 577a9dde8d088fea23eee83e578433e69fa5d259 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 6 Jul 2016 13:56:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?Create=201000=5F=E5=86=B0=E5=B0=81.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- POJ/1000_冰封.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 POJ/1000_冰封.java diff --git a/POJ/1000_冰封.java b/POJ/1000_冰封.java new file mode 100644 index 0000000..81c5837 --- /dev/null +++ b/POJ/1000_冰封.java @@ -0,0 +1,13 @@ +import java.util.Scanner; + +/** + * @author ice1000 + * Created by weber on 2016/6/13. + */ +public class Main { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + int a = scanner.nextInt(), b = scanner.nextInt(); + System.out.println(a + b); + } +} From 659999813cc4fd62270bb7f381813739f49b7493 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 6 Jul 2016 14:03:59 +0800 Subject: [PATCH 2/4] Create Readme.md --- CWOJ/Readme.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CWOJ/Readme.md diff --git a/CWOJ/Readme.md b/CWOJ/Readme.md new file mode 100644 index 0000000..332eb23 --- /dev/null +++ b/CWOJ/Readme.md @@ -0,0 +1,2 @@ +#成都外国语学校 CWOJ +[Goto Home Page](https://www.cwoj.tk/ "Welcome to CWOJ") From 8cdda848bd2c6cc03657fb23dcae32311172370f Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 6 Jul 2016 14:06:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Create=201193-more=5F=E5=86=B0=E5=B0=81.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CWOJ/1193-more_冰封.cpp | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 CWOJ/1193-more_冰封.cpp diff --git a/CWOJ/1193-more_冰封.cpp b/CWOJ/1193-more_冰封.cpp new file mode 100644 index 0000000..8b28e78 --- /dev/null +++ b/CWOJ/1193-more_冰封.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#define LL long long + +LL fast_plus(LL a, LL b, LL m) { + LL ret = 0; + while(b) { + if(b & 1) + ret = (ret + a) % m; + b >>= 1; + a = (a << 1) % m; + } + return ret; +} + +LL fast_pow(LL a, LL b, LL m) { + LL ret = 1; + while(b) { + if(b & 1) + ret = fast_plus(ret, a, m); + b >>= 1; + a = fast_plus(a, a, m); + } + return ret; +} + +int main() { + int i; + LL n, m, t, aa = 0; + char a[10005]; + ifstream fin; + fin.open("password.in"); + std::cin.sync_with_stdio(false); + std::cin>>a>>n>>m; + for(i = 0; i < strlen(a); i++) + aa = (aa * 10 + a[i] - '0') % m; + if(n == 1) + std::cout< Date: Wed, 6 Jul 2016 14:06:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?Create=201193-wrong=5F=E5=86=B0=E5=B0=81.cp?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CWOJ/1193-wrong_冰封.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 CWOJ/1193-wrong_冰封.cpp diff --git a/CWOJ/1193-wrong_冰封.cpp b/CWOJ/1193-wrong_冰封.cpp new file mode 100644 index 0000000..d8fea43 --- /dev/null +++ b/CWOJ/1193-wrong_冰封.cpp @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#define LL long long + +LL fast_plus(LL a, LL b, LL m) { + LL ret = 0; + while(b) { + if(b & 1) + ret = (ret + a) % m; + b >>= 1; + a = (a << 1) % m; + } + return ret; +} + +LL fast_pow(LL a, LL b, LL m) { + LL ret = 1; + while(b) { + if(b & 1) + ret = (ret * a) % m; + b >>= 1; + a = fast_plus(a, a, m); + } + return ret; +} + +int main() { + LL n, m, t, a; + std::cin.sync_with_stdio(false); + std::cin>>a>>n>>m; + t = fast_pow(a, n, m); + std::cout<