2020/1/14 (尽量)每天日记开始!

这是什么? 我要考3月底的hsk6级考试。但是目前的水平还没达到6级。所以此后要努力学习。于是我决定每天写日记,为了提高写中文的能力。 内容 一整天做着论讲的幻灯片。过午去游泳馆锻炼。有点儿累了。 逐渐接近比赛的日子。

codefestival final C Time Gap

問題 コード (2WA間違いコード) int N; int pot(int a,int b){ return ((a*b)?max(abs(a-b),abs(24 - a - b)):max(a,b)); } int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); cin >> N; vector<int> d(N+1,0); vector<int> ct(13); //カウ</int></int>…

チャンネル内の一人をランダムに選ぶslackbotを作った。

仕様 誰かがそのbotをメンションすると、そのチャンネル内のメンバーから一人を選んでメンションを飛ばす。 コード

ABC 088 D - Grid Repainting

問題 atcoder.jp コード typedef pair<int,int> pii; int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); int H,W; cin >> H >> W; char s[100][100]; vector<vector<int>> dist(H,vector<int>(W,-1)); int ct = 0; rep(i,H)rep(j,W){ cin >> s[i][j]; if(s[</int></vector<int></int,int>…

ABC016 C - 友達の友達

問題 atcoder.jp コード using Graph = vector<vector<int>>; Graph G; vector<int> ct; vector<bool> seen; void dfs(int pre, int c, int p,int d){ //pre:スタート, c:探索ノード, p:親, d:深さ if(d == 2){ for(auto i:G[c]){ if(i == pre) return; } if(seen[c]){ ct[pre]++; s</bool></int></vector<int>…

diverta 2019 Programming Contest 2 B - Picking Up

問題 atcoder.jp コード int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); int N;cin >> N; vector<pair<ll,ll>> x(N); rep(i,N) cin >> x[i].first >> x[i].second; sort(ALL(x)); pair<ll,ll> a[100][100]; map<pair<ll,ll>,ll> mp; rep(i,N){ for(int j = i </pair<ll,ll></ll,ll></pair<ll,ll>…

ABC037 C - 総和

問題 atcoder.jp コード ll N,K; ll func(ll l,ll r){ if(l >= K - 1 && r >= K - 1)return K; chmin(l,K-1);chmin(r,K-1); return max((ll)0,l + r - K + 2); } int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); cin >> N >> K…

ARC067 C -Factors of Factorial

問題 atcoder.jp コード int N; map<int,int> prime_factor(int64_t n) { map<int,int> ret; for(int64_t i = 2; i * i <= n; i++) { while(n % i == 0) { ret[i]++; n /= i; } } if(n != 1) ret[n] = 1; return ret; } int main(){ //cout.precision(10); cin.tie(0); ios::sy</int,int></int,int>…

ABC011 C - 123引き算

問題 atcoder.jp コード int N; int a,b,c; int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); cin >> N; cin >> a >> b >> c; int dp[310]; memset(dp,110,sizeof(dp)); dp[0] = 0; REP(i,N){ if(i != a && i != b && i != c){ …

ABC138 D - Ki

問題 atcoder.jp コード vector<vector<int>> G; vector<int> score; vector<bool> seen; void dfs(int v,int point){ if(!seen[v]){ seen[v] = true; score[v] += point; for(int next_v:G[v]){ dfs(next_v,score[v]); } } } int main(){ //cout.precision(10); cin.tie(0); ios::s</bool></int></vector<int>…

ABC079 D - Wall

問題 atcoder.jp コード int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); int H,W; cin >> H >> W; int G[10][10]; rep(i,10)rep(j,10) cin >> G[i][j]; int V = 10; //ワーシャルフロイド法 for (int k = 0; k < V; k++) { fo…

ABC026 C - 高橋君の給料

問題 atcoder.jp コード vector<vector<int>> b; int solve(int x){ int cost; vector<int> y; if(sz(b[x])){ for(int i: b[x]){ y.PB(solve(i)); } auto itr_max = max_element(ALL(y)); auto itr_min = min_element(ALL(y)); return cost = *itr_max + *itr_min + 1; }else{</int></vector<int>…

ABC027 B - 島と橋

問題 atcoder.jp コード int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> a(N); rep(i,N) cin >> a[i]; int sum = accumulate(ALL(a),0); if(sum % N){ cout << -1 << endl; return 0; } int ave = su</int>…

ABC084 C - Spetial Trains

問題 atcoder.jp コード #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> VLL; typedef vector<pair<int,int>> VP; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define rep(i,n) for(int i=0; i<(in</pair<int,int></long></bits/stdc++.h>…

ABC146D - Coloring Edges on Tree

問題 atcoder.jp コード struct Edge{ int to,index; }; vector<bool> seen; vector<int> parent; vector<int> vert; vector<vector<Edge>> G; void dfs(int v,int p,int num,int index){ vert[index] = num; int tmp = 1; for(auto next_e:G[v]){ if(tmp == num) tmp++; dfs(next_e.to,v,</vector<edge></int></int></bool>…

ARC097C Kth-Substring

問題 atcoder.jp コード int main(){ //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); string s; int K; cin >> s >> K; int N = s.size(); vector<vector<int> > a(26); rep(i,N){ a[s[i]-'a'].PB(i); } vector<string> S,ans; rep(i,26){ if(!a[i].empty()){ </string></vector<int>…

HSK5级 周9

应试策略与技巧 有家体育场为满足球迷看球的需要,把球场内观众的座位从八万个增加到了十二万个。 观看球赛的人多了,体育场的收入也增多了。 但是这也带了一个严重的问题:球场周围的路只能供十万人通行。 对于十二万的观众来说远远不够。 这样有重大比赛时…

ABC022C Blue Bird

問題 atcoder.jp コード(テンプレは省略) using P = pair<int, int>; struct edge { int to; int cost; }; int V; vector<edge> G[400]; int d[100000]; void dijkstra(int s) { priority_queue<P, vector<P>, greater<P> > que; fill(d, d+V, INF); d[s] = 0; que.push(P(0, s)); while (!qu</p></p,></edge></int,>…

ABC37 D 経路

問題 atcoder.jp コード(テンプレは省略) int H,W; ll a[1010][1010]; ll dp[1010][1010]; void dfs(int x,int y){ if(dp[x][y]) return; dp[x][y] = 1; if(x > 0 && a[x][y] < a[x-1][y]){ dfs(x-1,y); dp[x][y] += dp[x-1][y]; dp[x][y] %= (ll)MOD; } if(…

DDCC予選

問題 atcoder.jp A DDCC Finals コード(テンプレは省略) ll point(ll a){ if(a == 1) return 300000; if(a == 2) return 200000; if(a == 3) return 100000; return 0; } int main(){ ll x,y; cin >> x >> y; cout << point(x) + point(y) + (x*y==1?400000:…

問題 atcoder.jp コード #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> VLL; typedef vector<pair<int,int>> VP; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define MOD (1e9+7) #define rep(i,n</pair<int,int></long></bits/stdc++.h>…

ABC003 C AtCoderプログラミング講座

問題 atcoder.jp コード #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> VLL; typedef vector<pair<int,int>> VP; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define MOD (1e9+7) #define rep(i,n</pair<int,int></long></bits/stdc++.h>…

中国語検定2級 第98回 筆記 2

(1)开会日期推迟到下周,以便有充裕的准备时间。 推迟tuīchí 把预定的时间往后移 以便 用在下半句话的开头,表示使下文所说的目的容易实现 充裕chōngyù 充足富裕 充裕が形容詞であることに気づけなかった。 (2)就是未成年人也得对自己做的事负责 (3)这件事直…

ABC135 D Digits Parade

問題 atcoder.jp コード #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <vector> #include <queue> #include <iostream> #include <set> #include <map> #include <string> #include <algorithm> #include <stack> #include <sstream> #include <list> using namespace std; #define rep(…</list></sstream></stack></algorithm></string></map></set></iostream></queue></vector></cmath></cstring></cstdlib></cstdio>

小点心 怎么区别?

生词 翻 反转 数量成倍的增加 超过 飞 模糊 轮廓模糊不清 强调难以辨认 时常 经常 如同 好像,类似 难以 根据场合或情况很难作为自然的结果或后果 分辨 区分辨别 扭 痒 皮肤或黏膜受刺激需要抓挠的一种感觉 无济于事 对解决问题毫无济助 茅塞顿开 比喻人心有…

ABC145 感想

ABC145 問題 atcoder.jp A r * r B s[i]とs[i+n/2]をi=[0,n/2)で順に調べていく C グラフで考えると、枝の総数は本。各!通りの経路について、1つの経路に使用される枝の本数は本。 よって、経路の総和のが1つの経路に使われていることがわかるから、対称性…

ARC043 A 点数変換

問題 atcoder.jp コード C++ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> VLL; typedef vector<pair<int,int>> VP; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define MOD (1e9+7) #define rep</pair<int,int></long></bits/stdc++.h>…

AGC 018 A

問題 atcoder.jp コード import numpy as np import sys import math from functools import reduce import fractions as fr def gcd(*numbers): return reduce(fr.gcd, numbers) n,k = map(int,input().split()) a = list(map(int,input().split())) c = in…

小点心 东南西北

生词 本来 从一开始 心慌意乱 形容心里着乱,乱了主意 自如 没有障碍的 尽管 表示不必考虑的,相当于只管

中国語検定2級 第98回

問題 問題はこちら 1 生词 泡茶 用煮开的水冲茶 涮 摇动着冲刷,略微洗洗 看不上 看不过眼,不合意