cf851A

http://www.elijahqi.win/archives/680
A. Arpa and a research in Mexican wave
time limit per test
1 second

memory limit per test
256 megabytes

input
standard input

output
standard output

Arpa is researching the Mexican wave.

There are n spectators in the stadium, labeled from 1 to n. They start the Mexican wave at time 0.

At time 1, the first spectator stands.
At time 2, the second spectator stands.

At time k, the k-th spectator stands.
At time k + 1, the (k + 1)-th spectator stands and the first spectator sits.
At time k + 2, the (k + 2)-th spectator stands and the second spectator sits.

At time n, the n-th spectator stands and the (n - k)-th spectator sits.
At time n + 1, the (n + 1 - k)-th spectator sits.

At time n + k, the n-th spectator sits.
Arpa wants to know how many spectators are standing at time t.

Input
The first line contains three integers n, k, t (1 ≤ n ≤ 109, 1 ≤ k ≤ n, 1 ≤ t < n + k).

Output
Print single integer: how many spectators are standing at time t.

Examples
input
10 5 3
output
3
input
10 5 7
output
5
input
10 5 12
output
3
Note
In the following a sitting spectator is represented as -, a standing spectator is represented as ^.

At t = 0  ———- number of standing spectators = 0.
At t = 1  ^——— number of standing spectators = 1.
At t = 2  ^^——– number of standing spectators = 2.
At t = 3  ^^^——- number of standing spectators = 3.
At t = 4  ^^^^—— number of standing spectators = 4.
At t = 5  ^^^^^—– number of standing spectators = 5.
At t = 6  -^^^^^—- number of standing spectators = 5.
At t = 7  –^^^^^— number of standing spectators = 5.
At t = 8  —^^^^^– number of standing spectators = 5.
At t = 9  —-^^^^^- number of standing spectators = 5.
At t = 10 —–^^^^^ number of standing spectators = 5.
At t = 11 ——^^^^ number of standing spectators = 4.
At t = 12 ——-^^^ number of standing spectators = 3.
At t = 13 ——–^^ number of standing spectators = 2.
At t = 14 ———^ number of standing spectators = 1.
At t = 15 ———- number of standing spectators = 0.

#include<cstdio>
long long n,k,t;
int main(){
//  freopen("cfa.in","r",stdin);
    scanf("%lld%lld%lld",&n,&k,&t);
    long long tmp=t%(n+k);
    if (tmp==0) {printf("0");return 0;}
    if (tmp>=k&&tmp<=n) {printf("%lld",k);return 0;}
    if (tmp<k) printf("%lld",tmp);else printf("%lld",n+k-tmp);
    return 0;
}
将下面的JSON转成C#实体类:{ "totalCount": 224, "items": [ { "componentName": "Activiti - BPMN Converter", "componentVersionName": "7.0.0.SR1", "component": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2", "componentVersion": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478", "totalFileMatchCount": 1, "matchConfidenceStatus": "OK", "matchAmbiguity": { "kbArtifactMatchPercentage": 100.0 }, "licenses": [ { "licenseDisplay": "Apache License 2.0", "license": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/licenses/7cae335f-1193-421e-92f1-8802b4243e93", "spdxId": "Apache-2.0", "licenseFamilyName": "PERMISSIVE", "licenses": [], "ownership": "OPEN_SOURCE" } ], "origins": [ { "name": "7.0.0.SR1", "origin": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9", "externalNamespace": "maven", "externalId": "org.activiti:activiti-bpmn-converter:7.0.0.SR1", "externalNamespaceDistribution": false, "packageUrl": "pkg:maven/org.activiti/activiti-bpmn-converter@7.0.0.SR1", "_meta": { "allow": [], "links": [ { "rel": "origin", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9" }, { "rel": "matched-files", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9/matched-files" }, { "rel": "upgrade-guidance", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9/upgrade-guidance" }, { "rel": "transitive-upgrade-guidance", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9/transitive-upgrade-guidance" }, { "rel": "component-origin-copyrights", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9/copyrights" } ] } } ], "usages": [ "DYNAMICALLY_LINKED" ], "matchTypes": [ "FILE_DEPENDENCY" ], "inputExternalIds": [ "org.activiti:activiti-bpmn-converter:7.0.0.SR1" ], "releasedOn": "2025-07-16T08:09:52.985Z", "licenseRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "securityRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "versionRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 0 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 1 }, { "countType": "CRITICAL", "count": 0 } ] }, "activityRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "operationalRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 0 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 1 }, { "countType": "CRITICAL", "count": 0 } ] }, "activityData": { "lastCommitDate": "2019-03-05T11:25:59.000Z", "newerReleases": 416 }, "reviewStatus": "NOT_REVIEWED", "approvalStatus": "NOT_IN_VIOLATION", "policyStatus": "NOT_IN_VIOLATION", "componentModified": false, "_meta": { "allow": [ "GET" ], "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478", "links": [ { "rel": "comments", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/component-versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/comments" }, { "rel": "component-issues", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/component-versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/issues" }, { "rel": "policy-rules", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/policy-rules" }, { "rel": "vulnerabilities", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/vulnerabilities" }, { "rel": "matched-files", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins/2ec04e6d-12d2-4416-8049-8685e13912d9/matched-files" }, { "rel": "origins", "href": "https://oss.cn.kworld.kpmg.com/api/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/origins" }, { "rel": "policy-status", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/0cd833f4-80d8-4666-88f2-e8c4aee85478/policy-status" }, { "rel": "bom-component-version-license", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/fbd5bd81-0a1a-4e96-af3a-61cf7bb5eca2/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/license-adjustment" }, { "rel": "component-home", "href": "http://activiti.org/modules/activiti-bpmn-converter" } ] } }, { "componentName": "Activiti - BPMN Model", "componentVersionName": "7.0.0.SR1", "component": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca", "componentVersion": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca", "totalFileMatchCount": 1, "matchConfidenceStatus": "OK", "matchAmbiguity": { "kbArtifactMatchPercentage": 100.0 }, "licenses": [ { "licenseDisplay": "Apache License 2.0", "license": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/licenses/7cae335f-1193-421e-92f1-8802b4243e93", "spdxId": "Apache-2.0", "licenseFamilyName": "PERMISSIVE", "licenses": [], "ownership": "OPEN_SOURCE" } ], "origins": [ { "name": "7.0.0.SR1", "origin": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008", "externalNamespace": "maven", "externalId": "org.activiti:activiti-bpmn-model:7.0.0.SR1", "externalNamespaceDistribution": false, "packageUrl": "pkg:maven/org.activiti/activiti-bpmn-model@7.0.0.SR1", "_meta": { "allow": [], "links": [ { "rel": "origin", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008" }, { "rel": "matched-files", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008/matched-files" }, { "rel": "upgrade-guidance", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008/upgrade-guidance" }, { "rel": "transitive-upgrade-guidance", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008/transitive-upgrade-guidance" }, { "rel": "component-origin-copyrights", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008/copyrights" } ] } } ], "usages": [ "DYNAMICALLY_LINKED" ], "matchTypes": [ "FILE_DEPENDENCY" ], "inputExternalIds": [ "org.activiti:activiti-bpmn-model:7.0.0.SR1" ], "releasedOn": "2025-07-16T08:09:52.985Z", "licenseRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "securityRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "versionRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 0 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 1 }, { "countType": "CRITICAL", "count": 0 } ] }, "activityRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 1 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 0 }, { "countType": "CRITICAL", "count": 0 } ] }, "operationalRiskProfile": { "counts": [ { "countType": "UNKNOWN", "count": 0 }, { "countType": "OK", "count": 0 }, { "countType": "LOW", "count": 0 }, { "countType": "MEDIUM", "count": 0 }, { "countType": "HIGH", "count": 1 }, { "countType": "CRITICAL", "count": 0 } ] }, "activityData": { "lastCommitDate": "2019-03-05T11:25:35.000Z", "newerReleases": 417 }, "reviewStatus": "NOT_REVIEWED", "approvalStatus": "NOT_IN_VIOLATION", "policyStatus": "NOT_IN_VIOLATION", "componentModified": false, "_meta": { "allow": [ "GET" ], "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca", "links": [ { "rel": "comments", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/component-versions/f43f5264-e1e9-421c-acea-818417bf70ca/comments" }, { "rel": "component-issues", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/component-versions/f43f5264-e1e9-421c-acea-818417bf70ca/issues" }, { "rel": "policy-rules", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/policy-rules" }, { "rel": "vulnerabilities", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/vulnerabilities" }, { "rel": "matched-files", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins/388c1ecc-b367-4457-b98f-18e0fde80008/matched-files" }, { "rel": "origins", "href": "https://oss.cn.kworld.kpmg.com/api/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/origins" }, { "rel": "policy-status", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/f43f5264-e1e9-421c-acea-818417bf70ca/policy-status" }, { "rel": "bom-component-version-license", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components/bcdb9f5b-0b19-4861-a225-0db5b75267ca/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/license-adjustment" }, { "rel": "component-home", "href": "http://activiti.org/activiti-bpmn-model" } ] } } ], "appliedFilters": [], "_meta": { "allow": [ "GET" ], "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components", "links": [ { "rel": "quick-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=adjusted", "name": "adjusted", "label": "Adjusted" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomComment", "name": "bomComment", "label": "Component Comments" }, { "rel": "quick-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=componentIntelligence", "name": "componentIntelligence", "label": "Component Intelligence" }, { "rel": "dynamic-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomComponents", "name": "bomComponents", "label": "Component Version" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomInclusion", "name": "bomInclusion", "label": "Ignore" }, { "rel": "dynamic-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomLicense", "name": "bomLicense", "label": "License" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=licenseRisk", "name": "licenseRisk", "label": "License Risk" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomMatchType", "name": "bomMatchType", "label": "Match Type" }, { "rel": "quick-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=missingData", "name": "missingData", "label": "Missing Custom Field Data" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomAttribution", "name": "bomAttribution", "label": "Notices File Report" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=operationalRisk", "name": "operationalRisk", "label": "Operational Risk" }, { "rel": "dynamic-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=policyRuleViolation", "name": "policyRuleViolation", "label": "Policy Rule" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=policyCategory", "name": "policyCategory", "label": "Policy Rule Category" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=policyRuleSeverity", "name": "policyRuleSeverity", "label": "Policy Rule Severity" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomPolicy", "name": "bomPolicy", "label": "Policy Violations" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomReviewStatus", "name": "bomReviewStatus", "label": "Review Status" }, { "rel": "dynamic-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=sbomCreator", "name": "sbomCreator", "label": "SBOM Creator Name" }, { "rel": "dynamic-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=sbomName", "name": "sbomName", "label": "SBOM Name" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=securityRisk", "name": "securityRisk", "label": "Security Risk" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomMatchReviewStatus", "name": "bomMatchReviewStatus", "label": "Snippet Match Status" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomComponentSource", "name": "bomComponentSource", "label": "Source/Type" }, { "rel": "quick-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=unknownVersion", "name": "unknownVersion", "label": "Unknown Version" }, { "rel": "static-filter", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components-filters?filterKey=bomUsage", "name": "bomUsage", "label": "Usage" }, { "rel": "paging-next", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components?limit=2&offset=2" }, { "rel": "paging-last", "href": "https://oss.cn.kworld.kpmg.com/api/projects/1633754f-2535-41da-b18e-c93d1a427ea9/versions/4d26c1ed-8535-4b0f-851a-9088f59599ae/components?limit=2&offset=222" } ] } }
最新发布
07-17
原始输入 24A837533C437BDE74DA851DF4C5FA19 是 32 字符十六进制字符串 UTF-8 编码后为 32 字节:MjRBODM3NT...(见您的日志输出) 远小于 RSA-2048 最大加密长度 245 字节(256-11) 加密参数正确: 填充方式:RSA/ECB/PKCS1Padding(标准安全填充) 密钥格式:X509 标准的 PEM 公钥帮我根据的ras加密和参照public static String encryptByPublicKey(String data, RSAPublicKey publicKey) throws Exception { // 模长 int key_len = publicKey.getModulus().bitLength() / 8; System.out.println(“模长:” +key_len); // 加密数据长度 <= 模长-11 String[] datas = splitString(data, key_len - 11); System.out.println(“加密字符根据秘钥模长拆分后数组:” + JSON.toJSONString(datas)); String mi = “”; // 如果明文长度大于模长-11则要分组加密 for (String s : datas) { mi += bcd2Str(encryptByPublicKey(s.getBytes(), publicKey)); System.out.println(“字符串编码:” + JSON.toJSONString(s.getBytes())); System.out.println(“编码加密结果:” + JSON.toJSONString(encryptByPublicKey(s.getBytes(), publicKey))); System.out.println(“加密转码结果:” + JSON.toJSONString(bcd2Str(encryptByPublicKey(s.getBytes(), publicKey)))); System.out.println(“分组加密后结果:” + mi); } return mi; }/** BCD转字符串 */ private static String bcd2Str(byte[] bytes) { char temp[] = new char[bytes.length * 2], val; for (int i = 0; i < bytes.length; i++) { val = (char) (((bytes[i] & 0xf0) >> 4) & 0x0f); temp[i * 2] = (char) (val > 9 ? val + ‘A’ - 10 : val + ‘0’); val = (char) (bytes[i] & 0x0f); temp[i * 2 + 1] = (char) (val > 9 ? val + 'A' - 10 : val + '0'); } return new String(temp); }写一个python的代码,使其加密加密24A837533C437BDE74DA851DF4C5FA19后得出的值为模长:256 加密字符根据秘钥模长拆分后数组:["24A837533C437BDE74DA851DF4C5FA19"] 字符串编码:"MjRBODM3NTMzQzQzN0JERTc0REE4NTFERjRDNUZBMTk=" 编码加密结果:"TDvxX9GdrW1WxL5IgTmMbxiIaUTQVFwM4vyJvwEC5Izdf5B+8UsabuEoHMk6GoKcsCQNBggL2JxMYWa1mMqHTsIxJBhiiqiJyiQFWeTNkGSATdG0tcMkSbWNr0wvbuyk3Q/DLDIZKNPMksYRAL+4rPD9VaHtiJYojn7zQL7R8V0YrugVXmZ0aaXZWE3c2e/0xm+yXqi/Ry2vlB4BGZuGfmDsDNqtvNxfAVUUBBh78xdyDTMPxerELMKFh+P/WQ3eb/3D71LASDm9EdLfumhOx0z+/dfpTCM+RUHhX6D/LGCai8zrcZ1mpQFr04NhrSQpWhOEjPXKzsdZAzrgyFKCpA==" 加密转码结果:"4C3BF15FD19DAD6D56C4BE4881398C6F18886944D0545C0CE2FC89BF0102E48CDD7F907EF14B1A6EE1281CC93A1A829CB0240D06080BD89C4C6166B598CA874EC2312418628AA889CA240559E4CD9064804DD1B4B5C32449B58DAF4C2F6EECA4DD0FC32C321928D3CC92C61100BFB8ACF0FD55A1ED8896288E7EF340BED1F15D18AEE8155E667469A5D9584DDCD9EFF4C66FB25EA8BF472DAF941E01199B867E60EC0CDAADBCDC5F01551404187BF317720D330FC5EAC42CC28587E3FF590DDE6FFDC3EF52C04839BD11D2DFBA684EC74CFEFDD7E94C233E4541E15FA0FF2C609A8BCCEB719D66A5016BD38361AD24295A13848CF5CACEC759033AE0C85282A4" 分组加密后结果:4C3BF15FD19DAD6D56C4BE4881398C6F18886944D0545C0CE2FC89BF0102E48CDD7F907EF14B1A6EE1281CC93A1A829CB0240D06080BD89C4C6166B598CA874EC2312418628AA889CA240559E4CD9064804DD1B4B5C32449B58DAF4C2F6EECA4DD0FC32C321928D3CC92C61100BFB8ACF0FD55A1ED8896288E7EF340BED1F15D18AEE8155E667469A5D9584DDCD9EFF4C66FB25EA8BF472DAF941E01199B867E60EC0CDAADBCDC5F01551404187BF317720D330FC5EAC42CC28587E3FF590DDE6FFDC3EF52C04839BD11D2DFBA684EC74CFEFDD7E94C233E4541E15FA0FF2C609A8BCCEB719D66A5016BD38361AD24295A13848CF5CACEC759033AE0C85282A4 RSA加密AES密钥:4C3BF15FD19DAD6D56C4BE4881398C6F18886944D0545C0CE2FC89BF0102E48CDD7F907EF14B1A6EE1281CC93A1A829CB0240D06080BD89C4C6166B598CA874EC2312418628AA889CA240559E4CD9064804DD1B4B5C32449B58DAF4C2F6EECA4DD0FC32C321928D3CC92C61100BFB8ACF0FD55A1ED8896288E7EF340BED1F15D18AEE8155E667469A5D9584DDCD9EFF4C66FB25EA8BF472DAF941E01199B867E60EC0CDAADBCDC5F01551404187BF317720D330FC5EAC42CC28587E3FF590DDE6FFDC3EF52C04839BD11D2DFBA684EC74CFEFDD7E94C233E4541E15FA0FF2C609A8BCCEB719D66A5016BD38361AD24295A13848CF5CACEC759033AE0C85282A4
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值