惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
H
Help Net Security
Recorded Future
Recorded Future
The Register - Security
The Register - Security
F
Full Disclosure
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
T
Tenable Blog
T
Tor Project blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
B
Blog
V
V2EX
Jina AI
Jina AI
L
LangChain Blog
月光博客
月光博客
W
WeLiveSecurity
U
Unit 42
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 聂微东
V
Visual Studio Blog
A
Arctic Wolf
T
Tailwind CSS Blog
The Cloudflare Blog
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
雷峰网
雷峰网

博客园 - Jeff

4个月 C++ 有限状态机 POJ1019 POJ1035 POJ1005 ONLINE_JUDGE Linux shell定时器 怪异的grep结果 URL2FILE C primer笔记 Vxworks增加system call C语言常用宏定义技巧 分苹果 Socket 为什么选择SMP而不是AMP RTP memory in Vxworks Windriver的项目类型 RTP affinity Symmetric multiprocessing (SMP)
POJ1007
Jeff · 2012-01-05 · via 博客园 - Jeff

2012-01-05 15:03  Jeff  阅读(538)  评论()    收藏  举报

#include "stdio.h"
int main(void) {
    int num;
    int length;
    char str_out[100][51];
    int index;
    int index1;
    int result[100];
    int a=0;
    int b=0;
    int min=0;
    int num2=0;
    int temp;
    int min_index;
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    #else
    #endif

    scanf("%d%d",&length,&num);
    num2=num;
    temp=num2;
    while(num>0){
        scanf("%s", str_out[a]);
        if(num2 == 1){
           printf("%sn",str_out[a]);
           return 0;
        }
        result[a] = 0;
        for(index=0;index<length-1;index++){
            if(str_out[a][index] == 'A')continue;
            else{
               for(index1=index+1;index1<=length-1;index1++){
                   if(str_out[a][index] > str_out[a][index1])result[a]++;
               }
            }

        }
    num--;
    a++;
    }
    while(num2>0){
    if(result[b]==5000)
    {
        b++;
        continue;
    }
    min = result[b];
    min_index = b;

    for(index=0;index<temp-1;index++){
        if(min > result[index+1]){
           min = result[index+1];
           min_index =index+1;
        }
    }
    result[min_index] = 5000;
    num2--;
    printf("%sn",str_out[min_index]);
    min_index = 0;
}
    #ifndef ONLINE_JUDGE
    fclose(stdin);
    #else
    #endif
    return 0;