Submission #52015

# Submission time Handle Problem Language Result Execution time Memory
52015 2018-06-23T08:50:27 Z hyunuk(#1332) Fortune Telling 2 (JOI14_fortune_telling2) C++11
Compilation error
0 ms 0 KB
��#include <stdio.h>

#include <vector>

#include <queue>

#include <algorithm>

#include <iostream>

#include <string>

#include <bitset>

#include <map>

#include <set>

#include <tuple>

#include <string.h>

#include <math.h>

#include <random>

#include <functional>

#include <assert.h>

#include <math.h>

#include <sstream>

#include <iterator>

#include <numeric>



using namespace std;



using i64 = long long int;

using ii = pair<int, int>;

using ii64 = pair<i64, i64>;



int card[200005][2];

int view[200005];



int main()

{

	int n, k;



	scanf("%d %d", &n, &k);



	for (int i = 0; i < n; i++)

		scanf("%d %d", &card[i][0], &card[i][1]);



	for (int i = 0; i < k; i++)

	{

		int t;

		scanf("%d", &t);



		for (int j = 0; j < n; j++)

		{

			if (card[j][view[j]] <= t)

				view[j] = (view[j] + 1) % 2;

		}

	}



	i64 ans = 0;



	for (int i = 0; i < n; i++)

		ans += card[i][view[i]];



	printf("%lld\n", ans);



	return 0;

}

Compilation message

fortune_telling2.cpp:1:1: error: stray '\377' in program
 # i n c l u d e   < s t d i o . h > 
 
 ^
fortune_telling2.cpp:1:2: error: stray '\376' in program
 # i n c l u d e   < s t d i o . h > 
 
  ^
fortune_telling2.cpp:1:3: error: stray '#' in program
 # i n c l u d e   < s t d i o . h > 
 
   ^
fortune_telling2.cpp:1:4: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
    ^
fortune_telling2.cpp:1:6: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
      ^
fortune_telling2.cpp:1:8: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
        ^
fortune_telling2.cpp:1:10: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
          ^
fortune_telling2.cpp:1:12: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
            ^
fortune_telling2.cpp:1:14: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
              ^
fortune_telling2.cpp:1:16: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                ^
fortune_telling2.cpp:1:18: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                  ^
fortune_telling2.cpp:1:22: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                      ^
fortune_telling2.cpp:1:24: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                        ^
fortune_telling2.cpp:1:26: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                          ^
fortune_telling2.cpp:1:28: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                            ^
fortune_telling2.cpp:1:30: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                              ^
fortune_telling2.cpp:1:32: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                                ^
fortune_telling2.cpp:1:34: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                                  ^
fortune_telling2.cpp:1:36: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                                    ^
fortune_telling2.cpp:1:38: warning: null character(s) ignored
 # i n c l u d e   < s t d i o . h > 
 
                                      ^
fortune_telling2.cpp:2:1: warning: null character(s) ignored
  # i n c l u d e   < v e c t o r > 
 
 ^
fortune_telling2.cpp:3:1: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
 ^
fortune_telling2.cpp:3:3: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
   ^
fortune_telling2.cpp:3:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < q u e u e > 
 
    ^
    if
fortune_telling2.cpp:3:5: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
     ^
fortune_telling2.cpp:3:7: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
       ^
fortune_telling2.cpp:3:9: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
         ^
fortune_telling2.cpp:3:11: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
           ^
fortune_telling2.cpp:3:13: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
             ^
fortune_telling2.cpp:3:15: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
               ^
fortune_telling2.cpp:3:17: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                 ^
fortune_telling2.cpp:3:21: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                     ^
fortune_telling2.cpp:3:23: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                       ^
fortune_telling2.cpp:3:25: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                         ^
fortune_telling2.cpp:3:27: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                           ^
fortune_telling2.cpp:3:29: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                             ^
fortune_telling2.cpp:3:31: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                               ^
fortune_telling2.cpp:3:33: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                                 ^
fortune_telling2.cpp:3:35: warning: null character(s) ignored
  # i n c l u d e   < q u e u e > 
 
                                   ^
fortune_telling2.cpp:4:1: warning: null character(s) ignored
  # i n c l u d e   < a l g o r i t h m > 
 
 ^
fortune_telling2.cpp:5:1: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
 ^
fortune_telling2.cpp:5:3: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
   ^
fortune_telling2.cpp:5:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < i o s t r e a m > 
 
    ^
    if
fortune_telling2.cpp:5:5: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
     ^
fortune_telling2.cpp:5:7: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
       ^
fortune_telling2.cpp:5:9: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
         ^
fortune_telling2.cpp:5:11: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
           ^
fortune_telling2.cpp:5:13: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
             ^
fortune_telling2.cpp:5:15: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
               ^
fortune_telling2.cpp:5:17: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                 ^
fortune_telling2.cpp:5:21: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                     ^
fortune_telling2.cpp:5:23: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                       ^
fortune_telling2.cpp:5:25: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                         ^
fortune_telling2.cpp:5:27: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                           ^
fortune_telling2.cpp:5:29: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                             ^
fortune_telling2.cpp:5:31: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                               ^
fortune_telling2.cpp:5:33: warning: null character(s) ignored
  # i n c l u d e   < i o s t r e a m > 
 
                                 ^
fortune_telling2.cpp:6:1: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g > 
 
 ^
fortune_telling2.cpp:7:1: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
 ^
fortune_telling2.cpp:7:3: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
   ^
fortune_telling2.cpp:7:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < b i t s e t > 
 
    ^
    if
fortune_telling2.cpp:7:5: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
     ^
fortune_telling2.cpp:7:7: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
       ^
fortune_telling2.cpp:7:9: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
         ^
fortune_telling2.cpp:7:11: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
           ^
fortune_telling2.cpp:7:13: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
             ^
fortune_telling2.cpp:7:15: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
               ^
fortune_telling2.cpp:7:17: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                 ^
fortune_telling2.cpp:7:21: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                     ^
fortune_telling2.cpp:7:23: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                       ^
fortune_telling2.cpp:7:25: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                         ^
fortune_telling2.cpp:7:27: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                           ^
fortune_telling2.cpp:7:29: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                             ^
fortune_telling2.cpp:7:31: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                               ^
fortune_telling2.cpp:7:33: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                                 ^
fortune_telling2.cpp:7:35: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                                   ^
fortune_telling2.cpp:7:37: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                                     ^
fortune_telling2.cpp:7:39: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                                       ^
fortune_telling2.cpp:7:41: warning: null character(s) ignored
  # i n c l u d e   < b i t s e t > 
 
                                         ^
fortune_telling2.cpp:8:1: warning: null character(s) ignored
  # i n c l u d e   < m a p > 
 
 ^
fortune_telling2.cpp:9:1: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
 ^
fortune_telling2.cpp:9:3: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
   ^
fortune_telling2.cpp:9:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < s e t > 
 
    ^
    if
fortune_telling2.cpp:9:5: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
     ^
fortune_telling2.cpp:9:7: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
       ^
fortune_telling2.cpp:9:9: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
         ^
fortune_telling2.cpp:9:11: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
           ^
fortune_telling2.cpp:9:13: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
             ^
fortune_telling2.cpp:9:15: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
               ^
fortune_telling2.cpp:9:17: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                 ^
fortune_telling2.cpp:9:21: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                     ^
fortune_telling2.cpp:9:23: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                       ^
fortune_telling2.cpp:9:25: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                         ^
fortune_telling2.cpp:9:27: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                           ^
fortune_telling2.cpp:9:29: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                             ^
fortune_telling2.cpp:9:31: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                               ^
fortune_telling2.cpp:9:33: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                                 ^
fortune_telling2.cpp:9:35: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                                   ^
fortune_telling2.cpp:9:37: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                                     ^
fortune_telling2.cpp:9:39: warning: null character(s) ignored
  # i n c l u d e   < s e t > 
 
                                       ^
fortune_telling2.cpp:10:1: warning: null character(s) ignored
  # i n c l u d e   < t u p l e > 
 
 ^
fortune_telling2.cpp:11:1: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
 ^
fortune_telling2.cpp:11:3: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
   ^
fortune_telling2.cpp:11:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < s t r i n g . h > 
 
    ^
    if
fortune_telling2.cpp:11:5: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
     ^
fortune_telling2.cpp:11:7: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
       ^
fortune_telling2.cpp:11:9: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
         ^
fortune_telling2.cpp:11:11: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
           ^
fortune_telling2.cpp:11:13: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
             ^
fortune_telling2.cpp:11:15: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
               ^
fortune_telling2.cpp:11:17: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                 ^
fortune_telling2.cpp:11:21: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                     ^
fortune_telling2.cpp:11:23: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                       ^
fortune_telling2.cpp:11:25: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                         ^
fortune_telling2.cpp:11:27: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                           ^
fortune_telling2.cpp:11:29: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                             ^
fortune_telling2.cpp:11:31: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                               ^
fortune_telling2.cpp:11:33: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                                 ^
fortune_telling2.cpp:11:35: warning: null character(s) ignored
  # i n c l u d e   < s t r i n g . h > 
 
                                   ^
fortune_telling2.cpp:12:1: warning: null character(s) ignored
  # i n c l u d e   < m a t h . h > 
 
 ^
fortune_telling2.cpp:13:1: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
 ^
fortune_telling2.cpp:13:3: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
   ^
fortune_telling2.cpp:13:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < r a n d o m > 
 
    ^
    if
fortune_telling2.cpp:13:5: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
     ^
fortune_telling2.cpp:13:7: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
       ^
fortune_telling2.cpp:13:9: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
         ^
fortune_telling2.cpp:13:11: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
           ^
fortune_telling2.cpp:13:13: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
             ^
fortune_telling2.cpp:13:15: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
               ^
fortune_telling2.cpp:13:17: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                 ^
fortune_telling2.cpp:13:21: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                     ^
fortune_telling2.cpp:13:23: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                       ^
fortune_telling2.cpp:13:25: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                         ^
fortune_telling2.cpp:13:27: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                           ^
fortune_telling2.cpp:13:29: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                             ^
fortune_telling2.cpp:13:31: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                               ^
fortune_telling2.cpp:13:33: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                                 ^
fortune_telling2.cpp:13:35: warning: null character(s) ignored
  # i n c l u d e   < r a n d o m > 
 
                                   ^
fortune_telling2.cpp:14:1: warning: null character(s) ignored
  # i n c l u d e   < f u n c t i o n a l > 
 
 ^
fortune_telling2.cpp:15:1: warning: null character(s) ignored
  # i n c l u d e   < a s s e r t . h > 
 
 ^
fortune_telling2.cpp:15:3: warning: null character(s) ignored
  # i n c l u d e   < a s s e r t . h > 
 
   ^
fortune_telling2.cpp:15:4: error: invalid preprocessing directive #i; did you mean #if?
  # i n c l u d e   < a s s e r t . h > 
 
    ^
    if
fortune_telling2.cpp:15:5: warning: null character(s) ignored
  # i n c l u d e   < a s s e r t . h > 
 
     ^
fortune_telling2.cpp:15:7: warning: null character(