Content-Length: 445975 | pFad | http://github.com/jash13desai/codeforces/commit/62b93ff416026515b173ebfc404fbc6f1b4fdeeb

E9 499B · jash13desai/codeforces@62b93ff · GitHub
Skip to content

Commit 62b93ff

Browse files
committed
499B
1 parent 1496177 commit 62b93ff

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

1000/499B - Lecture.cpp

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
Problem Name: Lecture
3+
Problem Type: B - 1000
4+
Problem Link: https://codeforces.com/problemset/problem/499/B
5+
Author: Jash Desai (jash13desai)
6+
*/
7+
// ---------- HEADER ----------
8+
#include<bits/stdc++.h>
9+
using namespace std;
10+
// ---------- TEMPLATES ----------
11+
template<typename... T>
12+
void see(T&... args) { ((cin >> args), ...);}
13+
template<typename... T>
14+
void put(T&&... args) { ((cout << args << " "), ...);}
15+
template<typename... T>
16+
void putl(T&&... args) { ((cout << args << " "), ...); cout<<'\n';}
17+
// ---------- MACROS ----------
18+
#define int long long
19+
#define pb push_back
20+
#define mp make_pair
21+
#define ff first
22+
#define ss second
23+
#define ll long long
24+
#define ld long double
25+
#define ull unsigned long long
26+
#define print(x) cout << (x)
27+
#define sz size()
28+
#define vc(x) vector<x>
29+
#define nl cout<<'\n'
30+
#define sqof(a) (a)*(a)
31+
#define vi vector<int>
32+
#define vvi vector<vector<int>>
33+
#define pii pair<int,int>
34+
#define vii vector<pii>
35+
#define IOS ios_base:: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cin.exceptions(cin.failbit)
36+
#define all(x) (x).begin(), (x).end()
37+
#define setpr(x) cout<<setprecision(x)<<fixed
38+
#define setbits(x) builtin_popcount((x))
39+
#define tostr(x) to_string(x)
40+
#define rep(i,a,b) for(int i=a; i<b; i++)
41+
#define seeArr(arr,n) for(int i=0;i<n;i++){cin>>arr[i];}
42+
#define seeVi(v) for(int i=0;i<v.sz;i++){int x; cin>>x; v.pb(x);}
43+
#define seevi(v) for(int i=0;i<v.sz;i++){cin>>v[i];}
44+
// ---------- DEBUG ----------
45+
#ifndef ONLINE_JUDGE
46+
#define debug(x) cerr << #x <<" : "; _print(x); cerr << '\n';
47+
#else
48+
#define debug(x)
49+
#endif
50+
void _print(int t) {cerr << t;}
51+
void _print(string t) {cerr << t;}
52+
void _print(char t) {cerr << t;}
53+
void _print(ld t) {cerr << t;}
54+
void _print(double t) {cerr << t;}
55+
void _print(ull t) {cerr << t;}
56+
void _print(bool t) {cerr << t;}
57+
void _print(pair<int, int> t) {cerr << "[ " << t.ff << ", " << t.ss << " ]"; nl;}
58+
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
59+
// ---------- CONSTANTS ----------
60+
const ll infmax = INT_MAX;
61+
const ll infmin = INT_MIN;
62+
const ll N1 = 1e3+2;
63+
const ll N2 = 1e5+2;
64+
const ld ep = 0.0000001;
65+
const ld pi = acos(-1.0);
66+
const ll md = 1000000007;
67+
// ---------- FUNCTIONS ----------
68+
int gcd(int a, int b){return (!b) ? a : gcd(b, a % b);}
69+
int fact(int n){if(n==1 || n==0){return 1;} return (n*fact(n-1));}
70+
// ---------- SOLUTIONS ----------
71+
void solve(){
72+
vector<string> vs1;
73+
vector<string> vs2;
74+
int n,m; see(n,m);
75+
string a,b;
76+
string mn[n];
77+
rep(i,0,m){
78+
string a,b; see(a,b);
79+
vs1.pb(a); vs2.pb(b);
80+
}
81+
rep(i,0,n){
82+
see(mn[i]);
83+
}
84+
rep(i,0,n){
85+
rep(j,0,m){
86+
if(mn[i]==vs1[j]){
87+
if(vs1[j].size()>vs2[j].size()) put(vs2[j]);
88+
else put(vs1[j]);
89+
if(i!=n-1) put(" ");
90+
break;
91+
}
92+
}
93+
}
94+
}
95+
// ---------- MAIN ----------
96+
signed main() {
97+
#ifndef ONLINE_JUDGE
98+
freopen("error.txt", "w", stderr);
99+
#endif
100+
IOS;
101+
int t=1;
102+
// cin>>t;
103+
while(t--){
104+
solve();
105+
nl;
106+
}
107+
return 0;
108+
}
109+
// ---------- ROUGHCODE ----------
110+
/*
111+
*/
112+
// ---------- END ----------
113+

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/jash13desai/codeforces/commit/62b93ff416026515b173ebfc404fbc6f1b4fdeeb

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy