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

推荐订阅源

V
Vulnerabilities – Threatpost
V
V2EX
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
Y
Y Combinator Blog
C
Check Point Blog
爱范儿
爱范儿
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
雷峰网
雷峰网
IT之家
IT之家
WordPress大学
WordPress大学
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
罗磊的独立博客
S
SegmentFault 最新的问题
S
Security Affairs
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
B
Blog
O
OpenAI News
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
Hacker News: Ask HN
Hacker News: Ask HN
博客园_首页
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
月光博客
月光博客
J
Java Code Geeks
L
LangChain Blog
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 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;