Submission #401378


Source Code Expand

#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <utility>
#include <queue>
#include <stdio.h>
#include <string>
#define INF 1000000007
using namespace std;

int R,C,K,N;
int G[100001][100001];
int r[100001],c[100001];

int main(){
    int ans=0;
    cin >> R >> C >>K>> N;
    for (int i=0;i<R; i++) {
        for (int j=0; j<C; j++) {
            G[i][j]=0;
        }
    }
    for (int i=0; i<R;i++) {
        r[i]=0;
    }
    for (int i=0; i<C;i++) {
        c[i]=0;
    }
    for (int i=0; i<N; i++) {
        int hoge,fuga;
        cin >> hoge >> fuga;
        G[hoge-1][fuga-1]=1;
        r[hoge-1]+=1;
        c[fuga-1]+=1;
    }
    for (int i=0;i<R; i++) {
        if (r[i]<=K) {
            for (int j=0; j<C; j++) {
                if(r[i]+c[j]-G[i][j]==K){
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
    /*for (int i=0; i<R;i++) {
        cout << r[i]<<"¥";
    }
    cout << endl;
    for (int i=0; i<C;i++) {
        cout << c[i]<<"¥";
    }
    cout << endl;
    for (int i=0;i<R; i++) {
        for (int j=0; j<C; j++) {
            cout << G[i][j]<<"|";
        }
        cout << endl;
    }*/
}

Submission Info

Submission Time
Task C - 収集王
User wkwk
Language C++ (GCC 4.9.2)
Score 0
Code Size 1272 Byte
Status CE

Compile Error

/tmp/ccOlhiid.o: In function `main':
Main.cpp:(.text.startup+0x2): relocation truncated to fit: R_X86_64_32 against symbol `R' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x15): relocation truncated to fit: R_X86_64_32 against symbol `C' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x22): relocation truncated to fit: R_X86_64_32 against symbol `K' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x2f): relocation truncated to fit: R_X86_64_32 against symbol `N' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x3d): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x43): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccOlhiid.o
Main.cpp:(.text.startup+0x141): relocation t...