Submission #98741

# Submission time Handle Problem Language Result Execution time Memory
98741 2019-02-25T14:37:06 Z pamaj Kronican (COCI16_kronican) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 20;
#define int uint_fast32_t
 
#pragma GCC optimize ("Ofast")
 
int n, k;
int c[maxn][maxn];
int dp[1 << 20];
 
int32_t main()
{	
	ios::sync_with_stdio(false), cin.tie(nullptr);
	cin >> n >> k;
 
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < n; j++)
			cin >> c[i][j];
	}
 
 
	for(int mask = 0; mask < (1 << n); mask++)
	{
		if(__builtin_popcount(mask) <= k) {dp[mask] = 0; continue;}
 
		int ans = 1e7;
 
		for(int i = 0; i < n; i++)
		{
          if(!(mask & (1 << i))) continue;			
            for(int j = 0; j < n; j++)
			{
				if(i == j or !(mask & (1 << j))) continue;
 
				ans = min(ans, dp[mask ^ (1 << i)] + c[i][j]);
			}
		}
 
		dp[mask] = ans;
	}
 
	cout << dp[(1 << n) - 1] << "\n";
}

Compilation message

kronican.cpp:32:2: error: stray '\302' in program
           if(!(mask & (1 << i))) continue;   
  ^
kronican.cpp:32:3: error: stray '\240' in program
           if(!(mask & (1 << i))) continue;   
   ^
kronican.cpp:32:5: error: stray '\302' in program
           if(!(mask & (1 << i))) continue;   
     ^
kronican.cpp:32:6: error: stray '\240' in program
           if(!(mask & (1 << i))) continue;   
      ^
kronican.cpp:32:8: error: stray '\302' in program
           if(!(mask & (1 << i))) continue;   
        ^
kronican.cpp:32:9: error: stray '\240' in program
           if(!(mask & (1 << i))) continue;   
         ^
kronican.cpp:32:11: error: stray '\302' in program
           if(!(mask & (1 << i))) continue;   
           ^
kronican.cpp:32:12: error: stray '\240' in program
           if(!(mask & (1 << i))) continue;   
            ^
kronican.cpp:32:14: error: stray '\302' in program
           if(!(mask & (1 << i))) continue;   
              ^
kronican.cpp:32:15: error: stray '\240' in program
           if(!(mask & (1 << i))) continue;   
               ^
kronican.cpp:33:2: error: stray '\302' in program
             for(int j = 0; j < n; j++)
  ^
kronican.cpp:33:3: error: stray '\240' in program
             for(int j = 0; j < n; j++)
   ^
kronican.cpp:33:5: error: stray '\302' in program
             for(int j = 0; j < n; j++)
     ^
kronican.cpp:33:6: error: stray '\240' in program
             for(int j = 0; j < n; j++)
      ^
kronican.cpp:33:8: error: stray '\302' in program
             for(int j = 0; j < n; j++)
        ^
kronican.cpp:33:9: error: stray '\240' in program
             for(int j = 0; j < n; j++)
         ^
kronican.cpp:33:11: error: stray '\302' in program
             for(int j = 0; j < n; j++)
           ^
kronican.cpp:33:12: error: stray '\240' in program
             for(int j = 0; j < n; j++)
            ^
kronican.cpp:33:14: error: stray '\302' in program
             for(int j = 0; j < n; j++)
              ^
kronican.cpp:33:15: error: stray '\240' in program
             for(int j = 0; j < n; j++)
               ^
kronican.cpp: In function 'int32_t main()':
kronican.cpp:24:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int mask = 0; mask < (1 << n); mask++)
                    ~~~~~^~~~~~~~~~