๐งฌ ์๊ณ ๋ฆฌ์ฆ
[Leetcode][JS] 1630. Arithmetic Subarrays
1630. Arithmetic Subarrays ๋ฌธ์ ์ต์ ๋ ๊ฐ์ ์์๋ก ๊ตฌ์ฑ๋์ด์๋ ๊ฒฝ์ฐ, ์ฐ์์ ์ธ ๋๊ฐ์ ์์์ ์ฐจ์ด๊ฐ ๋์ผํ๋ฉด arithmeticํ๋ค๊ณ ํ๋ค s[i + 1] - s[i] == s[1] - s[0] ์ธ ๊ฒฝ์ฐ, artimeticํ๋ค ๋๋ณด๊ธฐ A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if and only if s[i+1] - s[i] == s[1] - s[0] for all vali..
[C์ธ์ด][์๊ณ ๋ฆฌ์ฆ] ์ฐ๊ฒฐ๋ฆฌ์คํธ ์ธ์ ๋ฆฌ์คํธ ๊ทธ๋ํ ํํ
#include #include #include #pragma warning (disable:4996) typedef struct graphNode { int vertex; int weight; struct graphNode* link; }graphNode; typedef struct Graph { struct graphNode* adjList[21]; // ์ธ์ ๋ฆฌ์คํธ }Graph; void insertEdge(Graph* G, int a, int b, int weight); void printAdjList(Graph* G); void printNode(Graph* G, int num); void modifyWeight(Graph* G, int a, int b, int weight); int main()..