Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
npofsi committed Aug 29, 2021
1 parent ed9de78 commit c74309c
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ members: npofsi, FocusMercial, Lusien1
| Name | A | B | C | D | E | F | G | H | I | J | K | L | M |
| ------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Example |
| [2021中国大学生程序设计竞赛(CCPC)- 网络选拔赛](https://acm.hdu.edu.cn/contests/contest_show.php?cid=1031) | 2021.8.19 | O | - | - | - | - | O | X | - | X | - | - | - | - |

---
11 changes: 11 additions & 0 deletions oj/codeforces/Codeforces_Round_740_Div.2/CMakeLists.txt
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.
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;
}
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.
4 changes: 4 additions & 0 deletions oj/hdu/hdu_contest_1031_ccpc_online/A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include<iostream>
using namespace std;

int main
11 changes: 11 additions & 0 deletions oj/hdu/hdu_contest_1031_ccpc_online/CMakeLists.txt
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.
33 changes: 33 additions & 0 deletions oj/hdu/hdu_contest_1031_ccpc_online/F.cpp
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.
53 changes: 53 additions & 0 deletions oj/hdu/hdu_contest_1031_ccpc_online/I.cpp
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;
}

0 comments on commit c74309c

Please sign in to comment.