Submission #71999995


Source Code Expand

//#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 d, f;
    cin >> d >> f;
    while (f < d) {
        f += 7;
    }
    if (f - d == 0) {
        cout << 7; return 0;
    }
    cout << f-d;
}

Submission Info

Submission Time
Task A - First Contest of the Year
User tbbt95
Language C++23 (GCC 15.2.0)
Score 100
Code Size 3631 Byte
Status AC
Exec Time 1 ms
Memory 3636 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 14
Set Name Test Cases
Sample sample00.txt, sample01.txt
All sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3596 KiB
sample01.txt AC 1 ms 3480 KiB
testcase00.txt AC 1 ms 3540 KiB
testcase01.txt AC 1 ms 3504 KiB
testcase02.txt AC 1 ms 3636 KiB
testcase03.txt AC 1 ms 3504 KiB
testcase04.txt AC 1 ms 3572 KiB
testcase05.txt AC 1 ms 3572 KiB
testcase06.txt AC 1 ms 3440 KiB
testcase07.txt AC 1 ms 3560 KiB
testcase08.txt AC 1 ms 3636 KiB
testcase09.txt AC 1 ms 3540 KiB
testcase10.txt AC 1 ms 3540 KiB
testcase11.txt AC 1 ms 3444 KiB