We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c83f09 commit 399e592Copy full SHA for 399e592
codeforces/Codeforces Round #324 (Div. 2)/B.cpp
@@ -0,0 +1,26 @@
1
+// http://codeforces.com/contest/584/problem/B
2
+
3
+#include<bits/stdc++.h>
4
+using namespace std;
5
6
+long long md = 1e9 + 7;
7
8
+long long mpow (long long a, long long b) {
9
+ long long p = a;
10
+ while (b --> 1) {
11
+ p = (p * a) % md;
12
+ p %= md;
13
+ }
14
15
+ return p % md;
16
+}
17
18
+int main() {
19
+ int n;
20
+ cin >> n;
21
22
+ long long a = mpow(3LL, n * 3);
23
+ long long b = mpow(7LL, n);
24
+ long long tmp = (a + md) - b;
25
+ cout << tmp % md;
26
codeforces/data.db
@@ -677,4 +677,5 @@
677
13425589
678
13463792
679
13443199
680
-13465613
+13465613
681
+13486876
0 commit comments