Submission #14289

# Submission time Handle Problem Language Result Execution time Memory
14289 2015-05-10T03:50:10 Z tjdals1865 공장 (KOI13_factory) C++
5.6 / 20
1000 ms 40024 KB
#include <stdio.h>
 
#include <stdlib.h>
 
long long machine1[1000000][2],machine2[1000000][2],cnt;
long long n,i,j;
void input(){
    long long tmp[1000000];
    scanf("%lld",&n);
    for(i=0;i<n;i++){
        scanf("%lld",&machine1[i][0]);
        tmp[machine1[i][0]]=i;
    }
    for(i=0;i<n;i++){
        scanf("%lld",&machine2[i][0]);
        machine2[i][1]=tmp[machine2[i][0]]+1;
        machine1[machine2[i][1]-1][1]=i+1;
    }
}
void process(){
    for(i=0;i<n-1;i++)
        for(j=i+1;j<n;j++)
            if(machine2[i][1]>machine2[j][1]) cnt++;
}
int main(void){
    input();
    process();
    printf("%lld",cnt);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 40024 KB Output is correct
2 Correct 0 ms 40024 KB Output is correct
3 Correct 0 ms 40016 KB Output is correct
4 Correct 0 ms 40016 KB Output is correct
5 Correct 0 ms 40020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 40024 KB Output is correct
2 Correct 18 ms 40020 KB Output is correct
3 Correct 65 ms 40020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 593 ms 40016 KB Output is correct
2 Execution timed out 1000 ms 40024 KB Program timed out
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 40016 KB Program timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 40016 KB Program timed out
2 Halted 0 ms 0 KB -