File tree Expand file tree Collapse file tree 11 files changed +146
-0
lines changed
out/production/AlgorithmDrills Expand file tree Collapse file tree 11 files changed +146
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <module type =" JAVA_MODULE" version =" 4" >
3+ <component name =" NewModuleRootManager" inherit-compiler-output =" true" >
4+ <exclude-output />
5+ <content url =" file://$MODULE_DIR$" >
6+ <sourceFolder url =" file://$MODULE_DIR$/src" isTestSource =" false" />
7+ </content >
8+ <orderEntry type =" inheritedJdk" />
9+ <orderEntry type =" sourceFolder" forTests =" false" />
10+ </component >
11+ </module >
Original file line number Diff line number Diff line change 1+ package Baekjoon ;
2+ import java .io .*;
3+ import java .util .Arrays ;
4+ import java .util .StringTokenizer ;
5+
6+ public class No1940 {
7+ public static void main (String [] args ) throws IOException {
8+ BufferedReader bf = new BufferedReader (new InputStreamReader (System .in ));
9+
10+ int material = Integer .parseInt (bf .readLine ());
11+ int armour = Integer .parseInt (bf .readLine ());
12+
13+ int [] A = new int [material ];
14+ StringTokenizer st = new StringTokenizer (bf .readLine ());
15+ for (int i = 0 ; i < material ; i ++) {
16+ A [i ] = Integer .parseInt (st .nextToken ());
17+ }
18+
19+ Arrays .sort (A );
20+ int count = 0 ;
21+ int left = 0 ;
22+ int right = material - 1 ;
23+
24+ while (left < right ) {
25+ if (A [left ] + A [right ] < armour ) {
26+ left ++;
27+ } else if (A [left ] + A [right ] > armour ) {
28+ right --;
29+ } else {
30+ count ++;
31+ left ++;
32+ right --;
33+ }
34+ }
35+ System .out .println (count );
36+ bf .close ();
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ package Baekjoon ;
2+
3+ public class No2750_1 {
4+ public static void main (String [] args ) {
5+ int N = 100000 ;
6+ int cnt = 0 ;
7+ for (int i = 0 ; i < N ; i ++) {
8+ System .out .println ("연산 횟수:" + cnt ++);
9+ }
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ package Baekjoon ;
2+
3+ public class No2750_2 {
4+ public static void main (String [] args ) {
5+ int N = 100000 ;
6+ int cnt = 0 ;
7+
8+ for (int i = 0 ; i < N ; i ++) {
9+ System .out .println ("연산 횟수: " + cnt ++);
10+ }
11+ for (int i = 0 ; i < N ; i ++) {
12+ System .out .println ("연산 횟수: " + cnt ++);
13+ }
14+ for (int i = 0 ; i < N ; i ++) {
15+ System .out .println ("연산 횟수: " + cnt ++);
16+ }
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ package Baekjoon ;
2+
3+ public class No2750_3 {
4+ public static void main (String [] args ) {
5+ int N = 100000 ;
6+ int cnt = 0 ;
7+ for (int i = 0 ; i < N ; i ++) {
8+ for (int j = 0 ; j < N ; j ++) {
9+ System .out .println ("연산 횟수: " + cnt ++);
10+ }
11+ }
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments