ABC 252, in process of making c, got idea but got sidetracked
This commit is contained in:
18
atcoder/beginner_contests/252/a.cpp
Normal file
18
atcoder/beginner_contests/252/a.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int n;
|
||||
cin >> n;
|
||||
|
||||
cout << (char)n << endl;
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
44
atcoder/beginner_contests/252/b.cpp
Normal file
44
atcoder/beginner_contests/252/b.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int n, k;
|
||||
cin >> n >> k;
|
||||
|
||||
set<int> tasty_foods;
|
||||
int tastiest = 0;
|
||||
|
||||
for(int i = 0; i < n; ++i){
|
||||
int a;
|
||||
cin >> a;
|
||||
|
||||
if(a > tastiest){
|
||||
tasty_foods.clear();
|
||||
tastiest = a;
|
||||
tasty_foods.insert(i+1);
|
||||
} else if(a == tastiest){
|
||||
tasty_foods.insert(i+1);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < k; ++i){
|
||||
int b;
|
||||
cin >> b;
|
||||
|
||||
if(tasty_foods.count(b)){
|
||||
cout << "Yes" << endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
cout << "No" << endl;
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
51
atcoder/beginner_contests/252/c.cpp
Normal file
51
atcoder/beginner_contests/252/c.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int n;
|
||||
cin >> n;
|
||||
|
||||
vector<map<int, int>> reels(n);
|
||||
|
||||
for(int i = 0; i < n; ++i){
|
||||
long long reel_in;
|
||||
cin >> reel_in;
|
||||
|
||||
for(int j = 9; j >= 0; --j){
|
||||
int l = reel_in % 10;
|
||||
reel_in /= 10;
|
||||
|
||||
reels[i][l] = j;
|
||||
}
|
||||
}
|
||||
|
||||
set<int> button_presses;
|
||||
int min_time = 100000;
|
||||
|
||||
for(int i = 0; i < 10; ++i){
|
||||
button_presses.clear();
|
||||
|
||||
for(int j = 0; j < n; ++j){
|
||||
int time = reels[i][j];
|
||||
while(button_presses.count(time)){
|
||||
time += 10;
|
||||
}
|
||||
button_presses.insert(time);
|
||||
|
||||
if(time < min_time){
|
||||
min_time = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << min_time << endl;
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
atcoder/beginner_contests/252/d.cpp
Normal file
25
atcoder/beginner_contests/252/d.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
atcoder/beginner_contests/252/e.cpp
Normal file
25
atcoder/beginner_contests/252/e.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
atcoder/beginner_contests/252/ex.cpp
Normal file
25
atcoder/beginner_contests/252/ex.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
atcoder/beginner_contests/252/f.cpp
Normal file
25
atcoder/beginner_contests/252/f.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
atcoder/beginner_contests/252/g.cpp
Normal file
25
atcoder/beginner_contests/252/g.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user