Skip to content

Commit b64192e

Browse files
2024.9.15
1 parent f749289 commit b64192e

File tree

1,114 files changed

+45156
-9273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,114 files changed

+45156
-9273
lines changed

.clang-format

+278
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -1
4+
AlignAfterOpenBracket: Align
5+
AlignArrayOfStructures: Right
6+
AlignConsecutiveAssignments:
7+
Enabled: false
8+
AcrossEmptyLines: false
9+
AcrossComments: false
10+
AlignCompound: false
11+
AlignFunctionPointers: false
12+
PadOperators: true
13+
AlignConsecutiveBitFields:
14+
Enabled: false
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: false
18+
AlignFunctionPointers: false
19+
PadOperators: false
20+
AlignConsecutiveDeclarations:
21+
Enabled: false
22+
AcrossEmptyLines: false
23+
AcrossComments: false
24+
AlignCompound: false
25+
AlignFunctionPointers: false
26+
PadOperators: false
27+
AlignConsecutiveMacros:
28+
Enabled: false
29+
AcrossEmptyLines: false
30+
AcrossComments: false
31+
AlignCompound: false
32+
AlignFunctionPointers: false
33+
PadOperators: false
34+
AlignConsecutiveShortCaseStatements:
35+
Enabled: false
36+
AcrossEmptyLines: false
37+
AcrossComments: false
38+
AlignCaseColons: false
39+
AlignEscapedNewlines: Left
40+
AlignOperands: Align
41+
AlignTrailingComments:
42+
Kind: Always
43+
OverEmptyLines: 0
44+
AllowAllArgumentsOnNextLine: true
45+
AllowAllParametersOfDeclarationOnNextLine: true
46+
AllowBreakBeforeNoexceptSpecifier: Never
47+
AllowShortBlocksOnASingleLine: Always
48+
AllowShortCaseLabelsOnASingleLine: true
49+
AllowShortCompoundRequirementOnASingleLine: true
50+
AllowShortEnumsOnASingleLine: true
51+
AllowShortFunctionsOnASingleLine: All
52+
AllowShortIfStatementsOnASingleLine: WithoutElse
53+
AllowShortLambdasOnASingleLine: All
54+
AllowShortLoopsOnASingleLine: true
55+
AlwaysBreakAfterDefinitionReturnType: None
56+
AlwaysBreakAfterReturnType: None
57+
AlwaysBreakBeforeMultilineStrings: true
58+
AlwaysBreakTemplateDeclarations: MultiLine
59+
AttributeMacros:
60+
- __capability
61+
BinPackArguments: true
62+
BinPackParameters: true
63+
BitFieldColonSpacing: Both
64+
BraceWrapping:
65+
AfterCaseLabel: false
66+
AfterClass: false
67+
AfterControlStatement: Never
68+
AfterEnum: false
69+
AfterFunction: false
70+
AfterNamespace: false
71+
AfterObjCDeclaration: false
72+
AfterStruct: false
73+
AfterUnion: false
74+
AfterExternBlock: false
75+
BeforeCatch: false
76+
BeforeElse: false
77+
BeforeLambdaBody: false
78+
BeforeWhile: false
79+
IndentBraces: false
80+
SplitEmptyFunction: true
81+
SplitEmptyRecord: true
82+
SplitEmptyNamespace: true
83+
BreakAdjacentStringLiterals: true
84+
BreakAfterAttributes: Leave
85+
BreakAfterJavaFieldAnnotations: false
86+
BreakArrays: true
87+
BreakBeforeBinaryOperators: None
88+
BreakBeforeBraces: Attach
89+
BreakBeforeConceptDeclarations: Always
90+
BreakBeforeInlineASMColon: OnlyMultiline
91+
BreakBeforeTernaryOperators: true
92+
BreakConstructorInitializers: BeforeColon
93+
BreakInheritanceList: BeforeColon
94+
BreakStringLiterals: true
95+
ColumnLimit: 80
96+
CommentPragmas: "^ IWYU pragma:"
97+
CompactNamespaces: false
98+
ConstructorInitializerIndentWidth: 4
99+
ContinuationIndentWidth: 4
100+
Cpp11BracedListStyle: true
101+
DerivePointerAlignment: true
102+
DisableFormat: false
103+
EmptyLineAfterAccessModifier: Never
104+
EmptyLineBeforeAccessModifier: LogicalBlock
105+
ExperimentalAutoDetectBinPacking: false
106+
FixNamespaceComments: true
107+
ForEachMacros:
108+
- foreach
109+
- Q_FOREACH
110+
- BOOST_FOREACH
111+
IfMacros:
112+
- KJ_IF_MAYBE
113+
IncludeBlocks: Regroup
114+
IncludeCategories:
115+
- Regex: ^<ext/.*\.h>
116+
Priority: 2
117+
SortPriority: 0
118+
CaseSensitive: false
119+
- Regex: ^<.*\.h>
120+
Priority: 1
121+
SortPriority: 0
122+
CaseSensitive: false
123+
- Regex: ^<.*
124+
Priority: 2
125+
SortPriority: 0
126+
CaseSensitive: false
127+
- Regex: .*
128+
Priority: 3
129+
SortPriority: 0
130+
CaseSensitive: false
131+
IncludeIsMainRegex: ([-_](test|unittest))?$
132+
IncludeIsMainSourceRegex: ""
133+
IndentAccessModifiers: false
134+
IndentCaseBlocks: false
135+
IndentCaseLabels: true
136+
IndentExternBlock: AfterExternBlock
137+
IndentGotoLabels: true
138+
IndentPPDirectives: None
139+
IndentRequiresClause: true
140+
IndentWidth: 2
141+
IndentWrappedFunctionNames: false
142+
InsertBraces: false
143+
InsertNewlineAtEOF: false
144+
InsertTrailingCommas: None
145+
IntegerLiteralSeparator:
146+
Binary: 0
147+
BinaryMinDigits: 0
148+
Decimal: 0
149+
DecimalMinDigits: 0
150+
Hex: 0
151+
HexMinDigits: 0
152+
JavaScriptQuotes: Leave
153+
JavaScriptWrapImports: true
154+
KeepEmptyLinesAtEOF: false
155+
KeepEmptyLinesAtTheStartOfBlocks: false
156+
LambdaBodyIndentation: Signature
157+
Language: Cpp
158+
LineEnding: DeriveLF
159+
MacroBlockBegin: ""
160+
MacroBlockEnd: ""
161+
MaxEmptyLinesToKeep: 1
162+
NamespaceIndentation: None
163+
ObjCBinPackProtocolList: Never
164+
ObjCBlockIndentWidth: 2
165+
ObjCBreakBeforeNestedBlockParam: true
166+
ObjCSpaceAfterProperty: false
167+
ObjCSpaceBeforeProtocolList: true
168+
PPIndentWidth: -1
169+
PackConstructorInitializers: NextLine
170+
PenaltyBreakAssignment: 2
171+
PenaltyBreakBeforeFirstCallParameter: 1
172+
PenaltyBreakComment: 300
173+
PenaltyBreakFirstLessLess: 120
174+
PenaltyBreakOpenParenthesis: 0
175+
PenaltyBreakScopeResolution: 500
176+
PenaltyBreakString: 1000
177+
PenaltyBreakTemplateDeclaration: 10
178+
PenaltyExcessCharacter: 1000000
179+
PenaltyIndentedWhitespace: 0
180+
PenaltyReturnTypeOnItsOwnLine: 200
181+
PointerAlignment: Left
182+
QualifierAlignment: Leave
183+
RawStringFormats:
184+
- Language: Cpp
185+
Delimiters:
186+
- cc
187+
- CC
188+
- cpp
189+
- Cpp
190+
- CPP
191+
- c++
192+
- C++
193+
CanonicalDelimiter: ""
194+
BasedOnStyle: google
195+
- Language: TextProto
196+
Delimiters:
197+
- pb
198+
- PB
199+
- proto
200+
- PROTO
201+
EnclosingFunctions:
202+
- EqualsProto
203+
- EquivToProto
204+
- PARSE_PARTIAL_TEXT_PROTO
205+
- PARSE_TEST_PROTO
206+
- PARSE_TEXT_PROTO
207+
- ParseTextOrDie
208+
- ParseTextProtoOrDie
209+
- ParseTestProto
210+
- ParsePartialTestProto
211+
CanonicalDelimiter: pb
212+
BasedOnStyle: google
213+
ReferenceAlignment: Pointer
214+
ReflowComments: true
215+
RemoveBracesLLVM: false
216+
RemoveParentheses: Leave
217+
RemoveSemicolon: false
218+
RequiresClausePosition: OwnLine
219+
RequiresExpressionIndentation: OuterScope
220+
SeparateDefinitionBlocks: Leave
221+
ShortNamespaceLines: 1
222+
SkipMacroDefinitionBody: false
223+
SortIncludes: CaseSensitive
224+
SortJavaStaticImport: Before
225+
SortUsingDeclarations: LexicographicNumeric
226+
SpaceAfterCStyleCast: false
227+
SpaceAfterLogicalNot: false
228+
SpaceAfterTemplateKeyword: true
229+
SpaceAroundPointerQualifiers: Default
230+
SpaceBeforeAssignmentOperators: true
231+
SpaceBeforeCaseColon: false
232+
SpaceBeforeCpp11BracedList: false
233+
SpaceBeforeCtorInitializerColon: false
234+
SpaceBeforeInheritanceColon: false
235+
SpaceBeforeJsonColon: false
236+
SpaceBeforeParens: ControlStatements
237+
SpaceBeforeParensOptions:
238+
AfterControlStatements: true
239+
AfterForeachMacros: true
240+
AfterFunctionDeclarationName: false
241+
AfterFunctionDefinitionName: false
242+
AfterIfMacros: true
243+
AfterOverloadedOperator: false
244+
AfterPlacementOperator: true
245+
AfterRequiresInClause: false
246+
AfterRequiresInExpression: false
247+
BeforeNonEmptyParentheses: false
248+
SpaceBeforeRangeBasedForLoopColon: true
249+
SpaceBeforeSquareBrackets: false
250+
SpaceInEmptyBlock: false
251+
SpacesBeforeTrailingComments: 2
252+
SpacesInAngles: Never
253+
SpacesInContainerLiterals: true
254+
SpacesInLineCommentPrefix:
255+
Minimum: 1
256+
Maximum: -1
257+
SpacesInParens: Never
258+
SpacesInParensOptions:
259+
InConditionalStatements: false
260+
InCStyleCasts: false
261+
InEmptyParentheses: false
262+
Other: false
263+
SpacesInSquareBrackets: false
264+
Standard: Auto
265+
StatementAttributeLikeMacros:
266+
- Q_EMIT
267+
StatementMacros:
268+
- Q_UNUSED
269+
- QT_REQUIRE_VERSION
270+
TabWidth: 8
271+
UseTab: Never
272+
VerilogBreakBetweenInstancePorts: true
273+
WhitespaceSensitiveMacros:
274+
- BOOST_PP_STRINGIZE
275+
- CF_SWIFT_NAME
276+
- NS_SWIFT_NAME
277+
- PP_STRINGIZE
278+
- STRINGIZE

ABC313_A.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#include<bits/extc++.h>
1+
#include <bits/extc++.h>
22
using namespace std;
3-
namespace pbds=__gnu_pbds;
4-
using ui=unsigned int;
5-
int main(void){
6-
ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
7-
size_t n;
8-
cin>>n;
9-
ui x;
10-
cin>>x;
11-
ui ans=0;
12-
for (size_t i=1;i<n;i++){
13-
ui val;
14-
cin>>val;
15-
if (x+ans<=val) ans=val+1-x;
16-
}
17-
cout<<ans;
18-
return 0;
3+
namespace pbds = __gnu_pbds;
4+
using ui = unsigned int;
5+
int main(void) {
6+
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
7+
size_t n;
8+
cin >> n;
9+
ui x;
10+
cin >> x;
11+
ui ans = 0;
12+
for (size_t i = 1; i < n; i++) {
13+
ui val;
14+
cin >> val;
15+
if (x + ans <= val) ans = val + 1 - x;
16+
}
17+
cout << ans;
18+
return 0;
1919
}

ABC313_B.cpp

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
#include<bits/extc++.h>
1+
#include <bits/extc++.h>
22
using namespace std;
3-
namespace pbds=__gnu_pbds;
4-
using ui=unsigned int;
5-
using graph=vector<vector<size_t>>;
6-
int main(void){
7-
ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
8-
size_t n,m;
9-
cin>>n>>m;
10-
graph mp(n);
11-
while (m--){
12-
size_t x,y;
13-
cin>>x>>y;
14-
mp[--y].push_back(--x);
15-
}
16-
size_t ans=0,cnt=0;
17-
for (size_t i=0;i<n;i++) if (mp[i].empty()) ans=i,cnt++;
18-
if (cnt!=1) cout<<"-1";
19-
else cout<<ans+1;
20-
return 0;
3+
namespace pbds = __gnu_pbds;
4+
using ui = unsigned int;
5+
using graph = vector<vector<size_t>>;
6+
int main(void) {
7+
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
8+
size_t n, m;
9+
cin >> n >> m;
10+
graph mp(n);
11+
while (m--) {
12+
size_t x, y;
13+
cin >> x >> y;
14+
mp[--y].push_back(--x);
15+
}
16+
size_t ans = 0, cnt = 0;
17+
for (size_t i = 0; i < n; i++)
18+
if (mp[i].empty()) ans = i, cnt++;
19+
if (cnt != 1)
20+
cout << "-1";
21+
else
22+
cout << ans + 1;
23+
return 0;
2124
}

ABC313_C.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#include<bits/extc++.h>
1+
#include <bits/extc++.h>
22
using namespace std;
3-
namespace pbds=__gnu_pbds;
4-
using uli=long long int;
5-
int main(void){
6-
ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
7-
size_t n;
8-
cin>>n;
9-
vector<uli> a(n);
10-
uli sum=0;
11-
for (uli& i:a) cin>>i,sum+=i;
12-
sort(a.begin(),a.end());
13-
size_t small_count=n-sum%n;uli small=sum/n;
14-
uli ans=0;
15-
for (size_t i=0;i<n;i++)
16-
ans+=abs(small+(i>=small_count)-a[i]);
17-
cout<<(ans>>1);
18-
return 0;
3+
namespace pbds = __gnu_pbds;
4+
using uli = long long int;
5+
int main(void) {
6+
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
7+
size_t n;
8+
cin >> n;
9+
vector<uli> a(n);
10+
uli sum = 0;
11+
for (uli& i : a) cin >> i, sum += i;
12+
sort(a.begin(), a.end());
13+
size_t small_count = n - sum % n;
14+
uli small = sum / n;
15+
uli ans = 0;
16+
for (size_t i = 0; i < n; i++) ans += abs(small + (i >= small_count) - a[i]);
17+
cout << (ans >> 1);
18+
return 0;
1919
}

0 commit comments

Comments
 (0)