提出 #72513222
ソースコード 拡げる
//#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include <stdlib.h>
#include<string>
#include<math.h>
#include<sstream>
#include<set>
#include<math.h>
#include <algorithm>
#include<map>
#include <numeric>
#include <sstream>
#include <iomanip>
#include<tuple>
#include <bitset>
#include <queue>
#include <iomanip>
#include <stack>
#include<time.h>
#include <unordered_set>
#include <random>
using namespace::std;
#define RANDMAX 100000
#define ll long long
#define lint long long int
#define ldouble long double
#define ALL(a) (a).begin(),(a).end()
using ve = vector<lint>;
vector<vector<int>> map2;
//
using Gra = vector<vector<lint>>;
using sve = vector<string>;
//
//cout << std::fixed << std::setprecision(15)<< ans;//�����_
//
//
//<stack>//�ォ��
// box.push()
// box.pop()
// box.top()
//
// <queue>������
// box.push()
// box.front()
// box.pop()
//
// <set>
// ite=g2.lower_bound(r) set�T��
// distance(ls.begin(), ite);�T��������̈���
// advance() �͋ɗ͎g��Ȃ����ƁI�I�@***************************************
// g2.count() set()���̌�
// lower_bound(a.begin(),a.end(),a[i])
// box.size()
//
// <vector>
// vector<int>
// lower_bound(a.begin(),a.end(),a[i])
// vector<vector<lint>> v(2, vector<lint>(3)) -> v.at(1).at(2);
// next_permutation(aaa.begin(), aaa.end()) �x�N�^�[�̑g�ݍ��킹
//
//<2���T���@�`�蓮�����`>
// int binary_search(int key) {
// int left = 0, right = (int)a.size() - 1; // �z�� a �̍��[�ƉE�[
// while (right >= left) {
// int mid = left + (right - left) / 2; // ��Ԃ̐^��
// if (a[mid] == key) return mid;
// else if (a[mid] > key) right = mid - 1;
// else if (a[mid] < key) left = mid + 1;
// }
// return -1;
// }
//
// <bit�S�T��>
//�@bitset<60> bs(n);
//
//�{��swap����Ƃ��͔��̔ԍ���ς���
/* par=time_check(nh, nm);
nh = par.first; nm = par.second;*/
pair<lint, lint> time_check(int h, int m) {
while (m >= 60) {
h += 1;
m -= 60;
}
while (m < 0) {
h -= 1;
m += 60;
}
return make_pair(h, m);
}
std::random_device seed_gen;
uint32_t get_rand() {
// ����������i�����ɃV�[�h���w��\�j
static std::mt19937 mt32(seed_gen());
// [0, (2^32)-1] �̈�l���z������
return mt32();
}
class ansd {
public:
int p;
int x;
int y;
};
class zahyo {
public:
int x;
int y;
};
lint n, max_p = 0, nowi, now_we, now_po, lost_p, max_w = 0;
int rec_dp(lint nowi, lint now_p, lint now_w, lint lost_p, vector<map<lint, lint>>& dp, ve& w, ve& p) {
if (dp[nowi].contains(now_w))return dp[nowi][now_w];
lint res = 0;
if (nowi == n) {
res = 0;
}
else if (now_w + w[nowi] > max_p - lost_p - p[nowi]) {
res = rec_dp(nowi + 1, now_p + p[nowi], now_w, lost_p, dp, w, p);
}
else {
res = max(
rec_dp(nowi + 1, now_p + p[nowi], now_w, lost_p, dp, w, p),
rec_dp(nowi + 1, now_p, now_w + w[nowi], lost_p + p[nowi], dp, w, p) + 1
);
}
return dp[nowi][now_w] = res;
}
int main() {
lint n, m;
string s, t;
lint q;
cin >> n >> m;
cin >> s >> t;
cin >> q;
map<char,int> ta, ao;
for (lint i = 0; i < s.size(); i++) {
ta[s[i]] = 0;
}
for (lint i = 0; i < t.size(); i++) {
ao[t[i]] = 0;
}
for (lint i = 0; i < q; i++) {
string a;
cin >> a;
int fl_a = 0, fl_t = 0;
for (lint j = 0; j < a.size(); j++) {
if (!ta.contains(a[j]))fl_t = 1;
if (!ao.contains(a[j]))fl_a = 1;
}
if (fl_t == fl_a) {
cout << "Unknown" << endl;
}
else if (fl_t == 0) {
cout << "Takahashi" << endl;
}
else {
cout << "Aoki" << endl;
}
}
}
提出情報
提出日時
2026-01-17 21:11:49+0900
問題
B - Two Languages
ユーザ
tbbt95
言語
C++23 (GCC 15.2.0)
得点
200
コード長
4248 Byte
結果
AC
実行時間
2 ms
メモリ
3552 KiB
コンパイルエラー
./Main.cpp: In function 'int main()':
./Main.cpp:156:24: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
156 | for (lint i = 0; i < s.size(); i++) {
| ~~^~~~~~~~~~
./Main.cpp:159:24: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
159 | for (lint i = 0; i < t.size(); i++) {
| ~~^~~~~~~~~~
./Main.cpp:166:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
166 | for (lint j = 0; j < a.size(); j++) {
| ~~^~~~~~~~~~
ジャッジ結果
セット名
Sample
All
得点 / 配点
0 / 0
200 / 200
結果
セット名
テストケース
Sample
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt
ケース名
結果
実行時間
メモリ
00_sample_00.txt
AC
2 ms
3420 KiB
00_sample_01.txt
AC
1 ms
3420 KiB
00_sample_02.txt
AC
1 ms
3416 KiB
01_random_03.txt
AC
1 ms
3448 KiB
01_random_04.txt
AC
1 ms
3436 KiB
01_random_05.txt
AC
1 ms
3396 KiB
01_random_06.txt
AC
1 ms
3552 KiB
01_random_07.txt
AC
1 ms
3552 KiB
01_random_08.txt
AC
1 ms
3536 KiB
01_random_09.txt
AC
1 ms
3460 KiB
01_random_10.txt
AC
1 ms
3552 KiB
01_random_11.txt
AC
1 ms
3536 KiB
01_random_12.txt
AC
1 ms
3460 KiB
01_random_13.txt
AC
1 ms
3448 KiB
01_random_14.txt
AC
1 ms
3476 KiB