Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

김태오 25175 #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define endl "\n"
#define pii pair<int,int>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define fs first
#define sc second
#define ll long long
#define np(v) while(next_permutation(v.begin(),v.end()))
using namespace std;

int n, m, k;
int main() {
cin >> n >> m >> k;
k -= 3; m += k;
m %= n;
if (m == 0) {
m = n;
}
if (m < 0) {
m = n + m;
}
cout << m;
}


48 changes: 48 additions & 0 deletions Codeforces/(2022.05.23) ECR_129/(A) Game with Cards/CF129_A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define endl "\n"
#define pii pair<int,int>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define fs first
#define sc second
#define ll long long
#define np(v) while(next_permutation(v.begin(),v.end()))
using namespace std;

int n, m, t;
int k;
int tmp = 0;
int main() {
fastio;
vector<int>a; vector<int>b;
cin >> t;
while (t--) {
a.clear(); b.clear();
cin >> n;
for (int i = 0; i < n; i++) {
cin >> k;
a.push_back(k);
}
cin >> m;
for (int i = 0; i < m; i++) {
cin >> k; b.push_back(k);
}
sort(all(a));
sort(all(b));
if (a[n - 1] >= b[m - 1]) {
cout << "Alice" << endl;
}
else if (a[n - 1] <= b[m - 1]) {
cout << "Bob" << endl;
}
if (a[n - 1] <= b[m - 1]) {
cout << "Bob" << endl;
}
else if (a[n - 1] >= b[m - 1]) {
cout << "Alice" << endl;
}



}
}