Codeforces Round #682 (Div. 2)
Codeforces Round #682 (Div. 2)
A. Specific Tastes of Andre
#include <bits/stdc++.h>
#define int ll
using namespace std;
typedef long long ll;
const int maxn = 3e4 + 10;
const int mod = 998244353;
void solve() {
int n;
cin>>n;
for (int i = 0; i < n; ++i) {
cout<<"1 ";
}
}
signed main() {
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int _ = 1;
cin >> _;
while (_--) {
solve();
}
return 0;
}
B. Valerii Against Everyone
因為ai=2^bi,所以如果有兩段相等必有倆個相等的數。
#include <bits/stdc++.h>
#define int ll
using namespace std;
typedef long long ll;
const int maxn = 3e4 + 10;
const int mod = 998244353;
map<int ,int >mp;
void solve() {
mp.clear();
int n;
cin>>n;
for (int i = 0; i < n; ++i) {
int x;
cin>>x;
mp[x]++;
}
for(auto x:mp)
if(x.second>1) {
cout<<"YES\n";
return;
}
cout<<"NO\n";
}
signed main() {
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int _ = 1;
cin >> _;
while (_--) {
solve();
}
return 0;
}
C. Engineer Artem
奇偶錯位,這沒想到鐵鍋鐵鍋。
#include <bits/stdc++.h>
#define int ll
using namespace std;
typedef long long ll;
const int maxn = 3e4 + 10;
const int mod = 998244353;
void solve() {
int n,m,x;
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>x;
cout<<((i+j)%2!=x%2)+x<<" ";
}
cout<<"\n";
}
}
signed main() {
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int _ = 1;
cin >> _;
while (_--) {
solve();
}
return 0;
}
相關文章
- Codeforces Round #639 (Div. 2)
- Codeforces Round #541 (Div. 2)
- Codeforces Round #678 (Div. 2)
- Codeforces Round #747 (Div. 2)
- Codeforces Round #673 (Div. 2)
- Codeforces Round #672 (Div. 2)
- Codeforces Round #448 (Div. 2) A
- Codeforces Round #217 (Div. 2)
- Codeforces Round #256 (Div. 2)
- Codeforces Round #259 (Div. 2)
- Codeforces Round #257 (Div. 2)
- Codeforces Round #258 (Div. 2)
- Codeforces Round #171 (Div. 2)
- Codeforces Round #173 (Div. 2)
- Codeforces Round 951 (Div. 2)
- Codeforces Round 955 (Div. 2)
- Codeforces Round 953 (Div. 2)
- Codeforces Round 975 (Div. 2)
- Codeforces Round 976 (Div. 2)
- Codeforces Round 972 (Div. 2)
- Codeforces Round 979 (Div. 2)
- Codeforces Round 982 (Div. 2)
- Codeforces Round 932 (Div. 2)
- Codeforces Round 934 (Div. 2)
- Codeforces Round 940 (Div. 2)
- Codeforces Round 973 (Div. 2)
- Codeforces Round 960 (Div. 2)
- Codeforces Round 958 (Div. 2)
- Codeforces Round 961 (Div. 2)
- Codeforces Round 948 (Div. 2)
- Codeforces Round 945 (Div. 2)
- Codeforces Round 873 (Div. 2)
- Codeforces Round 969 (Div. 2)
- Codeforces Round 949 (Div. 2)
- Codeforces Round 965 (Div. 2)
- Codeforces Round 963 (Div. 2)
- Codeforces Round 967 (Div. 2)
- Codeforces Round 987 (Div. 2)