add aloha/2025maple
This commit is contained in:
8
storage/aloha/cpp/2025maple-div1-B.cpp
Normal file
8
storage/aloha/cpp/2025maple-div1-B.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main() {
|
||||
cin.tie(nullptr);
|
||||
ios_base::sync_with_stdio(false);
|
||||
|
||||
|
||||
}
|
||||
59
storage/aloha/cpp/2025maple-div1-C.cpp
Normal file
59
storage/aloha/cpp/2025maple-div1-C.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#define MAXN 50
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
char ansLine;
|
||||
int N, T, A[MAXN][MAXN], B[MAXN][MAXN], ansNum;
|
||||
|
||||
void check();
|
||||
|
||||
int main() {
|
||||
ios_base::sync_with_stdio(0);
|
||||
cin.tie(0); cout.tie(0);
|
||||
|
||||
while (!cin.eof()) {
|
||||
cin >> T;
|
||||
|
||||
if (T == 1) {
|
||||
cin >> N;
|
||||
for (int i = 0; i < N; i++)
|
||||
for (int j = 0; j < N; j++)
|
||||
cin >> A[i][j];
|
||||
for (int i = 0; i < N; i++) cout << "H 1\n";
|
||||
|
||||
if (N % 2)
|
||||
for (int i = 0; i < N; i++) A[0][i] = !A[0][i];
|
||||
|
||||
} else if (T == 2) {
|
||||
cin >> N;
|
||||
for (int i = 0; i < N; i++)
|
||||
for (int j = 0; j < N; j++)
|
||||
cin >> B[i][j];
|
||||
|
||||
check();
|
||||
if (ansNum == -1) cout << 0 << "\n";
|
||||
else cout << 1 << "\n" << ansLine << " " << ansNum << "\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void check() {
|
||||
int row = -1, col = -1;
|
||||
|
||||
for (int i = 0; i < N; i++) {
|
||||
for (int j = 0; j < N; j++) {
|
||||
if (A[i][j] != B[i][j]) {
|
||||
if (row == i) ansLine = 'H';
|
||||
else if (col == j) ansLine = 'V';
|
||||
|
||||
row = i, col = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ansLine == 'H') ansNum = row+1;
|
||||
else if (ansLine == 'V') ansNum = col+1;
|
||||
else ansNum = -1;
|
||||
}
|
||||
40
storage/aloha/cpp/completed/2025maple-div1-E.cpp
Normal file
40
storage/aloha/cpp/completed/2025maple-div1-E.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#define N 8
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
|
||||
using namespace std;
|
||||
using pii = pair<int, int>;
|
||||
|
||||
int n = N, arr[N];
|
||||
queue<pii> q;
|
||||
|
||||
void sweet(int l, int r);
|
||||
|
||||
int main() {
|
||||
sweet(0, N-1);
|
||||
for (int e : arr) cout << e << " ";
|
||||
cout << "\n";
|
||||
}
|
||||
|
||||
void sweet(int l, int r) {
|
||||
q.push({l, r});
|
||||
|
||||
while (!q.empty()) {
|
||||
pii now = q.front(); q.pop();
|
||||
|
||||
int l = now.first, r = now.second;
|
||||
int mid = (l+r)/2;
|
||||
|
||||
if (l > r) continue;
|
||||
arr[mid] = n--;
|
||||
|
||||
if (mid-1 - l > r - (mid+1)) {
|
||||
q.push({l, mid-1});
|
||||
q.push({mid+1, r});
|
||||
} else {
|
||||
q.push({mid+1, r});
|
||||
q.push({l, mid-1});
|
||||
}
|
||||
}
|
||||
}
|
||||
33
storage/aloha/cpp/completed/2025maple-div1-G.cpp
Normal file
33
storage/aloha/cpp/completed/2025maple-div1-G.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n, inv, curr, before;
|
||||
int delta;
|
||||
|
||||
cin >> n >> before;
|
||||
|
||||
bool bflag = false;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
if (bflag) {
|
||||
cout << i - 1 << " " << i << endl;
|
||||
} else {
|
||||
cout << i << " " << i << endl;
|
||||
}
|
||||
cin >> curr;
|
||||
if(curr == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
delta = curr - before;
|
||||
if(delta > 0) {
|
||||
bflag = true;
|
||||
} else {
|
||||
bflag = false;
|
||||
before = curr;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
0
storage/aloha/kt/2025maple-div1-A.kt
Normal file
0
storage/aloha/kt/2025maple-div1-A.kt
Normal file
0
storage/aloha/kt/2025maple-div1-B.kt
Normal file
0
storage/aloha/kt/2025maple-div1-B.kt
Normal file
0
storage/aloha/kt/2025maple-div1-C.kt
Normal file
0
storage/aloha/kt/2025maple-div1-C.kt
Normal file
0
storage/aloha/kt/2025maple-div1-D.kt
Normal file
0
storage/aloha/kt/2025maple-div1-D.kt
Normal file
0
storage/aloha/kt/2025maple-div1-E.kt
Normal file
0
storage/aloha/kt/2025maple-div1-E.kt
Normal file
0
storage/aloha/kt/2025maple-div1-F.kt
Normal file
0
storage/aloha/kt/2025maple-div1-F.kt
Normal file
0
storage/aloha/kt/2025maple-div1-G.kt
Normal file
0
storage/aloha/kt/2025maple-div1-G.kt
Normal file
0
storage/aloha/kt/2025maple-div1-H.kt
Normal file
0
storage/aloha/kt/2025maple-div1-H.kt
Normal file
Reference in New Issue
Block a user