-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# CMakeList.txt : CMake project for Codeforces_Round_740_Div.2, include source and define | ||
# project specific logic here. | ||
# | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
project ("Codeforces_Round_740_Div.2") | ||
|
||
# Add source to this project's executable. | ||
add_executable (Codeforces_Round_740_Div.2 "Codeforces_Round_740_Div.2.cpp" "Codeforces_Round_740_Div.2.h") | ||
|
||
# TODO: Add tests and install targets if needed. |
12 changes: 12 additions & 0 deletions
12
oj/codeforces/Codeforces_Round_740_Div.2/Codeforces_Round_740_Div.2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Codeforces_Round_740_Div.2.cpp : Defines the entry point for the application. | ||
// | ||
|
||
#include "Codeforces_Round_740_Div.2.h" | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
cout << "Hello CMake." << endl; | ||
return 0; | ||
} |
8 changes: 8 additions & 0 deletions
8
oj/codeforces/Codeforces_Round_740_Div.2/Codeforces_Round_740_Div.2.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Codeforces_Round_740_Div.2.h : Include file for standard system include files, | ||
// or project specific include files. | ||
|
||
#pragma once | ||
|
||
#include <iostream> | ||
|
||
// TODO: Reference additional headers your program requires here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include<iostream> | ||
using namespace std; | ||
|
||
int main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# CMakeList.txt : CMake project for ccpc_online_pre, include source and define | ||
# project specific logic here. | ||
# | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
project ("ccpc_online_pre") | ||
|
||
# Add source to this project's executable. | ||
add_executable (ccpc_online_pre "F.cpp") | ||
|
||
# TODO: Add tests and install targets if needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include<iostream> | ||
#include<queue> | ||
|
||
using namespace std; | ||
|
||
int arr[1000010000]; | ||
int ark[1000010]; | ||
int arx[5500][5500]; | ||
|
||
|
||
int dfs(int last,int sum,int laststate) { | ||
int th = last + 1; | ||
int sum1 = dfs(sum + th * th); | ||
} | ||
|
||
void solve() { | ||
int n; | ||
cin >> n; | ||
int i = 0; | ||
while (1) { | ||
i++; | ||
|
||
} | ||
} | ||
|
||
int main() { | ||
int n; | ||
cin >> n; | ||
for (int i = 0; i < n; i++) { | ||
solve(); | ||
} | ||
return 1; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include<cstdio> | ||
#include<iostream> | ||
#include<algorithm> | ||
using namespace std; | ||
const int maxn = 1e5 + 10; | ||
char s[maxn]; | ||
struct node { | ||
int x, y; | ||
}pos[maxn]; | ||
|
||
|
||
|
||
|
||
int main() | ||
{ | ||
int t, n, i, j, minm; | ||
scanf("%d", &t); | ||
while (t--) | ||
{ | ||
scanf("%d", &n); | ||
scanf("%s", s); | ||
for (i = 0; i <= n; i++) | ||
pos[i].x = 0, pos[i].y = 0; | ||
for (i = 0; i < n; i++) | ||
{ | ||
pos[i + 1].x = pos[i].x; | ||
pos[i + 1].y = pos[i].y; | ||
if (s[i] == 'U') | ||
pos[i + 1].y++; | ||
else if (s[i] == 'D') | ||
pos[i + 1].y--; | ||
else if (s[i] == 'R') | ||
pos[i + 1].x++; | ||
else if (s[i] == 'L') | ||
pos[i + 1].x--; | ||
} | ||
minm = n; | ||
pos[0].x = 0, pos[0].y = 0; | ||
for (i = 1; i <= n - 2; i++) | ||
{ | ||
for (j = i + 1; j <= n - 1; j++) | ||
{ | ||
if (pos[i - 1].x == pos[j].x && pos[i - 1].y == pos[j].y) | ||
{ | ||
minm = min(minm, j - i + 1); | ||
break; | ||
} | ||
} | ||
} | ||
printf("%d\n", minm); | ||
} | ||
return 0; | ||
} |