-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
612 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <bits/stdc++.h> | ||
|
||
template<typename T> T gcd(T a, T b) { | ||
if(!b) return a; | ||
return gcd(b, a % b); | ||
} | ||
template<typename T> T lcm(T a, T b) { | ||
return a * b / gcd(a, b); | ||
} | ||
|
||
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } | ||
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } | ||
int in() { int x; scanf("%d", &x); return x; } | ||
|
||
using namespace std; | ||
|
||
typedef long long Int; | ||
typedef unsigned uint; | ||
|
||
const int MAXN = 1010; | ||
|
||
int W, B; | ||
|
||
double dp[MAXN][MAXN][2]; | ||
bool mm[MAXN][MAXN][2]; | ||
|
||
double func(int w, int b, int pos) { | ||
if (w == 0) { | ||
return 0.0; | ||
} else { | ||
double& ans = dp[w][b][pos]; | ||
|
||
if (!mm[w][b][pos]) { | ||
mm[w][b][pos] = 1; | ||
|
||
if (pos == 0) { | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
int main(void) { | ||
W = in(); | ||
B = in(); | ||
|
||
memset(mm, false, sizeof(mm)); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include <bits/stdc++.h> | ||
|
||
template<typename T> T gcd(T a, T b) { | ||
if(!b) return a; | ||
return gcd(b, a % b); | ||
} | ||
template<typename T> T lcm(T a, T b) { | ||
return a * b / gcd(a, b); | ||
} | ||
|
||
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } | ||
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } | ||
int in() { int x; scanf("%d", &x); return x; } | ||
|
||
using namespace std; | ||
|
||
typedef long long Int; | ||
typedef unsigned uint; | ||
|
||
string S; | ||
string goal = "niet"; | ||
|
||
int rem[4] = {3, 1, 3, 1}; | ||
int sum[512]; | ||
|
||
int main(void) { | ||
freopen("i.in", "r", stdin); | ||
cin >> S; | ||
|
||
for (int i = 0; i < (int) S.size(); i++) { | ||
sum[S[i]] += 1; | ||
} | ||
|
||
int ans = INT_MAX / 3; | ||
|
||
for (int i = 0; i < 4; i++) { | ||
int now; | ||
if (i == 0) { | ||
now = (sum[goal[i]] / rem[i]) + (sum[goal[i]] % rem[i]) ? 1 : 0; | ||
} else { | ||
now = sum[goal[i]] / rem[i]; | ||
} | ||
cout << goal[i] << " " << now << "\n"; | ||
ans = min(ans, now); | ||
} | ||
|
||
cout << ans << "\n"; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include <bits/stdc++.h> | ||
|
||
template<typename T> T gcd(T a, T b) { | ||
if(!b) return a; | ||
return gcd(b, a % b); | ||
} | ||
template<typename T> T lcm(T a, T b) { | ||
return a * b / gcd(a, b); | ||
} | ||
|
||
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } | ||
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } | ||
int in() { int x; scanf("%d", &x); return x; } | ||
|
||
using namespace std; | ||
|
||
typedef long long Int; | ||
typedef unsigned uint; | ||
|
||
const int MAXN = 100005; | ||
|
||
int N; | ||
int P[MAXN]; | ||
|
||
int main(void) { | ||
cin >> N; | ||
|
||
set<int> ans; | ||
bool ten = false; | ||
for (int i = 0; i < N; i++) { | ||
cin >> P[i]; | ||
|
||
if (P[i] == 0 || P[i] == 100) { | ||
ans.insert(P[i]); | ||
} | ||
} | ||
|
||
sort(P, P + N); | ||
|
||
bool A = false, B = false; | ||
|
||
for (int i = 0; i < N; i++) { | ||
if (P[i] != 0 && P[i] != 100) { | ||
if (!A && P[i] < 10) { | ||
A = true; | ||
ans.insert(P[i]); | ||
} else if (!B && P[i] >= 10 && (P[i] % 10 == 0 || (!A && ans.count(100)))) { | ||
B = true; | ||
ans.insert(P[i]); | ||
} | ||
} | ||
} | ||
|
||
if (ans.size() == 0) { | ||
ans.insert(P[0]); | ||
} | ||
|
||
cout << ans.size() << "\n"; | ||
|
||
for (set<int>::iterator it = ans.begin(); it != ans.end(); it++) { | ||
cout << *it << " "; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nineteenineteen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
4 | ||
1 | ||
NN | ||
YN | ||
2 | ||
NNNN | ||
NNNN | ||
NNNN | ||
NNNN | ||
2 | ||
NYNN | ||
NNNN | ||
NNNY | ||
NNNN | ||
2 | ||
NYYY | ||
YNYY | ||
YYNY | ||
YYYN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include <bits/stdc++.h> | ||
|
||
template<typename T> T gcd(T a, T b) { | ||
if(!b) return a; | ||
return gcd(b, a % b); | ||
} | ||
template<typename T> T lcm(T a, T b) { | ||
return a * b / gcd(a, b); | ||
} | ||
|
||
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } | ||
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } | ||
int in() { int x; scanf("%d", &x); return x; } | ||
|
||
using namespace std; | ||
|
||
typedef long long Int; | ||
typedef unsigned uint; | ||
|
||
const int MAXN = 100005; | ||
|
||
int N; | ||
int P[MAXN]; | ||
|
||
int main(void) { | ||
freopen("i.in", "r", stdin); | ||
cin >> N; | ||
|
||
set<int> ans; | ||
bool ten = false; | ||
for (int i = 0; i < N; i++) { | ||
cin >> P[i]; | ||
|
||
if (P[i] == 0 || P[i] == 100) { | ||
ans.insert(P[i]); | ||
} else if (P[i] % 10 == 0 && !ten) { | ||
ten = true; | ||
ans.insert(P[i]); | ||
} | ||
} | ||
|
||
bool A = false, B = false; | ||
|
||
for (int i = 0; i < N; i++) { | ||
if (P[i] != 0) { | ||
if (!A && P[i] < 10) { | ||
A = true; | ||
ans.insert(P[i]); | ||
} else if (!B && P[i] > 10 && ans.count(100)) { | ||
B = true; | ||
ans.insert(P[i]); | ||
} | ||
} | ||
} | ||
|
||
if (ans.size() == 0) { | ||
ans.insert(P[0]); | ||
} | ||
|
||
cout << ans.size() << "\n"; | ||
|
||
for (set<int>::iterator it = ans.begin(); it != ans.end(); it++) { | ||
cout << *it << " "; | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.