Submission #19849

# Submission time Handle Problem Language Result Execution time Memory
19849 2016-02-25T06:15:09 Z inspire12 괄호 (kriii4_R) C++
Compilation error
0 ms 0 KB
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
vector<pair<long long, long long> > x;
unsigned long long res = 1;
priority_queue<long long > q;
vector<vector<long long> > v;
vector<long long> t;
int main() {
    int n, s; long long res = 0;
    long long m;
    unsigned long long temp;
    pair<long long, long long> p;
     
    scanf("%d %d", &s, &n);
    t.push_back(1);
    v.push_back(t);
    t.pop_back();
     
    p.first = s;
    p.second = 1;
    x.push_back(p);
 
    for (int i = 2; i <= n; i++) {
        t = v.back(); v.pop_back();
        for (int j = 1; j < i; j++) {
            q.push(t[j - 1]);
            if (j == 1 && i % 2 == 0)
                continue;
            t[j - 1]++;
        }
        if (i == 2) t.push_back(i);
        else t.push_back(i - 1);
        v.push_back(t);
    }
     
    long long re = q.top(); int  y = 2;
    while(re--) {
        p.first = (p.first % 1000000007) * (s % 1000000007) % 1000000007;
        p.second = y++;
        x.push_back(p);
    } long long a = 0; t = v[0]; int d = 0;
    while (d < v[0].size()) {
        a += (x[t[d]-1].first);
        d++;
    }printf("%lld", a);

Compilation message

R.cpp: In function ‘int main()’:
R.cpp:44:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (d < v[0].size()) {
              ^
R.cpp:11:25: warning: unused variable ‘res’ [-Wunused-variable]
     int n, s; long long res = 0;
                         ^
R.cpp:12:15: warning: unused variable ‘m’ [-Wunused-variable]
     long long m;
               ^
R.cpp:13:24: warning: unused variable ‘temp’ [-Wunused-variable]
     unsigned long long temp;
                        ^
R.cpp:47:23: error: expected ‘}’ at end of input
     }printf("%lld", a);
                       ^
R.cpp:16:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &s, &n);
                           ^