Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define double long double
- #define _FastIO ios_base::sync_with_stdio(0); cin.tie(0)
- #define F first
- #define S second
- const int mod = 1e9 + 7;
- signed main()
- {
- _FastIO;
- /*
- // A
- int n;
- string a , b;
- cin >> n >> a >> b;
- for(int i = 0; i < n; i++){
- cout << a[i] << b[i];
- }
- */
- /*
- // B
- int n , x;
- cin >> n;
- map<int , int> cnt;
- for(int i = 0; i < 4 * n - 1; i++){
- cin >> x;
- cnt[x]++;
- }
- for(int i = 1; i <= n; i++){
- if(cnt[i] < 4)
- cout << i << '\n';
- }
- */
- /*
- // C
- for(int i = 8; i >= 1; i--){
- for(char j = 'a'; j <= 'h'; j++){
- char x;
- cin >> x;
- if(x == '*'){
- cout << j << i;
- }
- }
- }
- */
- /*
- 4
- Kita 3193
- Aino 3189
- Fuji 3776
- Okuhotaka 3190
- 3776 Fuji
- 3193 Kita
- 3190 Okuhotaka
- 3189 Aino
- */
- /*
- // D
- int n , h;
- string name;
- cin >> n;
- vector<pair<int , string> > v;
- for(int i = 0; i < n; i++){
- cin >> name >> h;
- v.push_back({h , name});
- }
- sort(v.rbegin() , v.rend()); // sort reverse
- //sort(v.begin() , v.end() , greater<>());
- //sort(v.begin() , v.end());
- //reverse(v.begin() , v.end());
- cout << v[1].S << '\n';
- */
- /*
- // J
- int n;
- cin >> n;
- int a[n + 5];
- vector<pair<int , int> > v;
- for(int i = 1; i <= n; i++){
- int x;
- cin >> x;
- v.push_back({x , i});
- }
- sort(v.rbegin() , v.rend());
- cout << v[1].S << '\n';
- */
- /*
- // E
- int n;
- cin >> n;
- int a[n + 5];
- for(int i = 1; i <= n; i++){
- cin >> a[i];
- }
- int q , type , k , x;
- cin >> q;
- while(q--){
- cin >> type;
- if(type == 1){
- cin >> k >> x;
- a[k] = x;
- }else{
- cin >> k;
- cout << a[k] << '\n';
- }
- }
- */
- /*
- // F
- int n;
- string s;
- cin >> n >> s;
- for(int i = 0; i < n; i++){
- cout << s[i];
- if(s[i] == 'n' && s[i + 1] == 'a')
- cout << 'y';
- }
- */
- /*
- // G
- int r , d , x;
- cin >> r >> d >> x;
- for(int i = 0; i < 10; i++){
- x = r * x - d;
- cout << x << '\n';
- }*/
- // 0 <= i < j < n
- // H
- /*
- int n;
- cin >> n;
- int a[n + 5];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- int sum = 0;
- for(int i = 0; i < n; i++){
- for(int j = i + 1; j < n; j++){
- sum += a[i] * a[j];
- }
- }
- cout << sum << '\n';
- */
- /*
- // I
- int n;
- cin >> n;
- int a[n + 5];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- int s = 0 , ans = 0;
- for(int i = 0; i < n; i++){
- ans += s * a[i];
- ans %= mod;
- s += a[i];
- s %= mod;
- }
- cout << ans << '\n';
- */
- /*
- 1 2 3 4
- 2 * 1
- 3 * 2 + 3 * 1
- 4 * 3 + 4 * 2 + 4 * 1
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement