Codeforces

Codeforces Beta Round #80 (DIV.2)

Rating: 1486(緑)→1461(緑)1310 Points A - Blackjack #include <cstdio> int main() { int n; scanf("%d\n", &n); int res = 0; n -= 10; if (1 <= n && n <= 11) { if ((1 <= n && n <= 9) || n == 11) { res = 4; } else if (n == 10) { res = 15; } } else { res</cstdio>…

Codeforces Beta Round #65 (Div. 2)

Rating: 1400(緑) → 1558(青) 2714 Points A - Way Too Long Words 492 Points #include <iostream> #include <string> using namespace std; int main() { int n; cin>>n; for(int i = 0; i < n; i++){ string s; cin>>s; if(s.size() > 10){ cout<</string></iostream>

Codeforces Beta Round #64

本番は死にました。その後HaskellでAだけ解けてやったーとか言ってるので貼っておきます。 Real World Haskell読み途中。 main = getLine >>= putStrLn . show . solve . (read :: String -> Int) where solve 0 = 1 solve n = (3 ^ (n - 1)) `mod` (10^6 + …

Codeforces Beta Round #54 (Div. 2)

A. Chat room #include <iostream> #include <string> using namespace std; int main() { string s, t("hello"); cin>>s; int cnt = 0; for(int i = 0; i < s.size(); i++){ if(cnt >= t.size()) break; if(s[i] == t[cnt]){ cnt++; } } cout<<(cnt >= t.size() ? "YES" : "NO</string></iostream>…