Submission #401372
Source Code Expand
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;
/**
* vector<int>ar(3);
* for(auto&e:ar){
* scanf("%d",&e);
* }
* sort(ar.begin(),ar.end())
* int sum=accumulate(ar.begin(),ar.end(),0);
***/
int main(){
double pai=3.141592653589;
long a,b,r,c,k,n,tmp;
long long ans=0;
scanf("%ld %ld %ld",&r,&c,&k);
long x[c],y[r],chk[r][c];
for(long i=0;i<r;i++){
y[i]=0;
for(long j=0;j<c;j++){
x[j]=0;
chk[i][j]=0;
}
}
scanf("%ld",&n);
for(long i=0;i<n;i++){
scanf("%ld %ld",&a,&b);
y[a-1]+=1;
x[b-1]+=1;
chk[a-1][b-1]=1;
}
for(long i=0;i<r;i++){
for(long j=0;j<c;j++){
if(chk[i][j]==1){
tmp=x[j]+y[i]-1;
}else{
tmp=x[j]+y[i];
}
if(tmp==k) ans++;
}
}
printf("%lld\n",ans);
return 0;
}
Submission Info
Submission Time |
|
Task |
A - 加算王 |
User |
nyon |
Language |
C++11 (GCC 4.9.2) |
Score |
0 |
Code Size |
994 Byte |
Status |
RE |
Exec Time |
299 ms |
Memory |
948 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:19:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%ld %ld %ld",&r,&c,&k);
^
./Main.cpp:28:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%ld",&n);
^
./Main.cpp:30:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%ld %ld",&a,&b);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 100 |
Status |
|
|
Set Name |
Test Cases |
Sample |
subtask0-sample01.txt, subtask0-sample02.txt, subtask0-sample03.txt |
All |
subtask0-sample01.txt, subtask0-sample02.txt, subtask0-sample03.txt, subtask1-01.txt, subtask1-02.txt, subtask1-03.txt, subtask1-04.txt, subtask1-05.txt, subtask1-06.txt, subtask1-07.txt, subtask1-08.txt, subtask1-09.txt, subtask1-10.txt, subtask1-11.txt, subtask1-12.txt |
Case Name |
Status |
Exec Time |
Memory |
subtask0-sample01.txt |
RE |
298 ms |
944 KB |
subtask0-sample02.txt |
RE |
297 ms |
940 KB |
subtask0-sample03.txt |
RE |
291 ms |
936 KB |
subtask1-01.txt |
RE |
292 ms |
936 KB |
subtask1-02.txt |
RE |
290 ms |
932 KB |
subtask1-03.txt |
RE |
294 ms |
932 KB |
subtask1-04.txt |
RE |
290 ms |
928 KB |
subtask1-05.txt |
RE |
290 ms |
932 KB |
subtask1-06.txt |
RE |
292 ms |
932 KB |
subtask1-07.txt |
RE |
293 ms |
936 KB |
subtask1-08.txt |
RE |
289 ms |
940 KB |
subtask1-09.txt |
RE |
299 ms |
948 KB |
subtask1-10.txt |
RE |
296 ms |
936 KB |
subtask1-11.txt |
RE |
297 ms |
944 KB |
subtask1-12.txt |
RE |
291 ms |
944 KB |