提出 #67759992
ソースコード 拡げる
// Problem: AT ABC415 E
// Contest: AtCoder - Japan Registry Services (JPRS) Programming Contest 2025#2 (AtCoder Beginner Contest 415)
// URL: https://atcoder.jp/contests/abc415/tasks/abc415_e
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// Date: 2025.07.19 20:00:16
//
// Powered by CP Editor (https://cpeditor.org)
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<limits.h>
#include<list>
#include<typeinfo>
#include<array>
using namespace std;
template < typename T > void IntRead(T &a) { a = 0; unsigned long long A = 0; bool sign = 0; char ch = getchar(); while(!(ch >= 48 && ch <= 57) && ch != EOF) { if(ch == '-') sign = 1; ch = getchar(); } while(ch >= 48 && ch <= 57) { A = (A << 1) + (A << 3) + (ch - 48); ch = getchar(); } a = A; if(sign) a = -a; }
template < typename T > void IntWrite(T a) { char st[40]; int top = 0; if(a < 0) { putchar('-'); a *= -1; } unsigned long long A = a; do { st[++top] = (A % 10 + 48); A /= 10; } while(A != 0); while(top != 0) putchar(st[top--]); }
template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
template < typename T > void readarray(T a[] , int start , int len) { for(int i = start ; i < start + len ; read(a[i]) , i++); }
template < typename T , typename ... L > void read(T &a , L && ... b) { read(a); read(b ...); }
template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
template < typename T , typename ... L > void print(T a , L ... b) { print(a); print(b ...); }
template < typename T , typename L > void printarray(T a[] , int start , int len , L x) { for(int i = start ; i < start + len ; print(a[i] , x) , i++); }
template < typename T > void printsp(T a) { print(a); print(' ');}
template < typename T , typename ... L > void printsp(T a , L ... b) { printsp(a); printsp(b ...); }
template < typename T > void printnl(T a) { print(a); print('\n');}
template < typename T , typename ... L > void printnl(T a , L ... b) { printnl(a); printnl(b ...); }
long long ksm(long long a , long long b , long long p , long long ans = 1) { while(b) { if(b & 1) (ans *= a) %= p; (a *= a) %= p; b >>= 1; } return ans; }
#define int long long
long long p[400005];
long long h , w;
long long turn(long long x , long long y)
{
return (x - 1) * w + y;
}
long long to[400005];
long long find(long long now)
{
return (to[now] == now ? now : to[now] = find(to[now]));
}
pair < pair < long long , long long > , long long > v[5000005];
bool cmp(pair < pair < long long , long long > , long long > a , pair < pair < long long , long long > , long long > b)
{
return a.second < b.second;
}
signed main()
{
read(h , w);
vector < vector < long long > > a(h + 5 , vector < long long > (w + 5));
vector < vector < long long > > dp1(h + 5 , vector < long long > (w + 5 , (long long) -1e18));
for(int i = 1 ; i <= h * w + 3 ; i++)
{
to[i] = i;
}
for(int i = 1 ; i <= h ; i++)
{
for(int j = 1 ; j <= w ; j++)
{
read(a[i][j]);
}
}
readarray(p , 1 , h + w - 1);
if(h == 1 && w == 1)
{
printnl(max(0ll , p[1] - a[1][1]));
return 0;
}
dp1[1][1] = 0;
for(int i = 1 ; i <= h ; i++)
{
for(int j = 1 ; j <= w ; j++)
{
dp1[i][j] += a[i][j];
dp1[i][j] -= p[i + j - 1];
if(i != h)
{
dp1[i + 1][j] = max(dp1[i][j] , dp1[i + 1][j]);
}
if(j != w)
{
dp1[i][j + 1] = max(dp1[i][j] , dp1[i][j + 1]);
}
//printsp(dp1[i][j]);
}
//print("\n");
}
int cnt = 0;
for(int i = 1 ; i <= h ; i++)
{
for(int j = 1 ; j <= w ; j++)
{
if(i != h)
{
v[++cnt] = make_pair(make_pair(turn(i , j) , turn(i + 1 , j)) , -min(dp1[i][j] , dp1[i + 1][j]));
}
if(j != w)
{
v[++cnt] = make_pair(make_pair(turn(i , j) , turn(i , j + 1)) , -min(dp1[i][j] , dp1[i][j + 1]));
}
}
}
sort(v + 1 , v + cnt + 1 , cmp);
for(int i = 1 ; i <= cnt ; i++)
{
to[v[i].first.first] = to[v[i].first.second];
if(find(to[1]) == find(to[h * w]))
{
printnl(max(0ll , v[i].second));
return 0;
}
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | E - Hungry Takahashi |
| ユーザ | I_am_kunzi |
| 言語 | C++ 17 (gcc 12.2) |
| 得点 | 0 |
| コード長 | 5692 Byte |
| 結果 | WA |
| 実行時間 | 95 ms |
| メモリ | 46204 KiB |
コンパイルエラー
Main.cpp: In instantiation of ‘void read(T&) [with T = long long int]’:
Main.cpp:70:8: required from here
Main.cpp:29:182: warning: format ‘%hd’ expects argument of type ‘short int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| short int*
| %lld
Main.cpp:29:246: warning: format ‘%hu’ expects argument of type ‘short unsigned int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| short unsigned int*
| %llu
Main.cpp:29:298: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~^ ~~
| | |
| int* long long int*
| %lld
Main.cpp:29:359: warning: format ‘%u’ expects argument of type ‘unsigned int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~^ ~~
| | |
| | long long int*
| unsigned int*
| %llu
Main.cpp:29:413: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| long int*
| %lld
Main.cpp:29:476: warning: format ‘%lu’ expects argument of type ‘long unsigned int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| long unsigned int*
| %llu
Main.cpp:29:659: warning: format ‘%f’ expects argument of type ‘float*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~^ ~~
| | |
| | long long int*
| float*
| %lld
Main.cpp:29:715: warning: format ‘%lf’ expects argument of type ‘double*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| double*
| %lld
Main.cpp:29:776: warning: format ‘%Lf’ expects argument of type ‘long double*’, but argument 2 has type ‘long long int*’ [-Wformat=]
29 | template < typename T > void read(T &a) { if(typeid(a) == typeid(char)) cin >> a; else if(typeid(a) == typeid(unsigned char)) cin >> a; else if(typeid(a) == typeid(short)) scanf("%hd" , &a); else if(typeid(a) == typeid(unsigned short)) scanf("%hu" , &a); else if(typeid(a) == typeid(int)) scanf("%d" , &a); else if(typeid(a) == typeid(unsigned int)) scanf("%u" , &a); else if(typeid(a) == typeid(long)) scanf("%ld" , &a); else if(typeid(a) == typeid(unsigned long)) scanf("%lu" , &a); else if(typeid(a) == typeid(long long)) scanf("%lld" , &a); else if(typeid(a) == typeid(unsigned long long)) scanf("%llu" , &a); else if(typeid(a) == typeid(float)) scanf("%f" , &a); else if(typeid(a) == typeid(double)) scanf("%lf" , &a); else if(typeid(a) == typeid(long double)) scanf("%Lf" , &a); else cin >> a; }
| ~~^ ~~
| | |
| | long long int*
| long double*
| %lld
Main.cpp: In instantiation of ‘void print(T) [with T = long long int]’:
Main.cpp:37:50: required from ‘void printnl(T) [with T = long long int]’
Main.cpp:76:10: required from here
Main.cpp:32:185: warning: format ‘%hd’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| int long long int
| %lld
Main.cpp:32:249: warning: format ‘%hu’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| int long long int
| %llu
Main.cpp:32:301: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~^ ~
| | |
| int long long int
| %lld
Main.cpp:32:362: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~^ ~
| | |
| | long long int
| unsigned int
| %llu
Main.cpp:32:416: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | long long int
| long int
| %lld
Main.cpp:32:479: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | long long int
| long unsigned int
| %llu
Main.cpp:32:662: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~^ ~
| | |
| | long long int
| double
| %lld
Main.cpp:32:718: warning: format ‘%lf’ expects argument of type ‘double’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | long long int
| double
| %lld
Main.cpp:32:779: warning: format ‘%Lf’ expects argument of type ‘long double’, but argument 2 has type ‘long long int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | long long int
| long double
| %lld
Main.cpp: In instantiation of ‘void print(T) [with T = char]’:
Main.cpp:37:60: required from ‘void printnl(T) [with T = long long int]’
Main.cpp:76:10: required from here
Main.cpp:32:416: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | int
| long int
| %d
Main.cpp:32:479: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
32 | template < typename T > void print(T a) { if(typeid(a) == typeid(char)) cout << a; else if(typeid(a) == typeid(unsigned char)) cout << a; else if(typeid(a) == typeid(short)) printf("%hd" , a); else if(typeid(a) == typeid(unsigned short)) printf("%hu" , a); else if(typeid(a) == typeid(int)) printf("%d" , a); else if(typeid(a) == typeid(unsigned int)) printf("%u" , a); else if(typeid(a) == typeid(long)) printf("%ld" , a); else if(typeid(a) == typeid(unsigned long)) printf("%lu" , a); else if(typeid(a) == typeid(long long)) printf("%lld" , a); else if(typeid(a) == typeid(unsigned long long)) printf("%llu" , a); else if(typeid(a) == typeid(float)) printf("%f" , a); else if(typeid(a) == typeid(double)) printf("%lf" , a); else if(typeid(a) == typeid(long double)) printf("%Lf" , a); else cout << a; }
| ~~^ ~
| | |
| | int
| long unsigned int
| ...
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 450 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt, 03_handmade_05.txt, 03_handmade_06.txt, 03_handmade_07.txt, 03_handmade_08.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3700 KiB |
| 00_sample_01.txt | AC | 1 ms | 3780 KiB |
| 00_sample_02.txt | AC | 1 ms | 3900 KiB |
| 01_random_00.txt | AC | 79 ms | 31772 KiB |
| 01_random_01.txt | AC | 65 ms | 31520 KiB |
| 01_random_02.txt | AC | 67 ms | 31548 KiB |
| 01_random_03.txt | AC | 70 ms | 32516 KiB |
| 01_random_04.txt | AC | 68 ms | 18844 KiB |
| 01_random_05.txt | AC | 61 ms | 18656 KiB |
| 01_random_06.txt | AC | 58 ms | 18816 KiB |
| 01_random_07.txt | AC | 59 ms | 18988 KiB |
| 01_random_08.txt | AC | 66 ms | 17520 KiB |
| 01_random_09.txt | AC | 64 ms | 17492 KiB |
| 01_random_10.txt | AC | 61 ms | 17584 KiB |
| 01_random_11.txt | AC | 59 ms | 17428 KiB |
| 01_random_12.txt | AC | 68 ms | 17788 KiB |
| 01_random_13.txt | AC | 66 ms | 17964 KiB |
| 01_random_14.txt | AC | 63 ms | 17968 KiB |
| 01_random_15.txt | AC | 63 ms | 17972 KiB |
| 01_random_16.txt | AC | 74 ms | 18624 KiB |
| 01_random_17.txt | AC | 65 ms | 18604 KiB |
| 01_random_18.txt | AC | 61 ms | 18532 KiB |
| 01_random_19.txt | AC | 72 ms | 18804 KiB |
| 01_random_20.txt | WA | 83 ms | 30148 KiB |
| 01_random_21.txt | AC | 71 ms | 29904 KiB |
| 01_random_22.txt | AC | 68 ms | 29896 KiB |
| 01_random_23.txt | WA | 75 ms | 30180 KiB |
| 01_random_24.txt | AC | 95 ms | 46204 KiB |
| 01_random_25.txt | AC | 81 ms | 45408 KiB |
| 01_random_26.txt | AC | 82 ms | 45504 KiB |
| 01_random_27.txt | AC | 86 ms | 45988 KiB |
| 02_random2_00.txt | AC | 56 ms | 17924 KiB |
| 02_random2_01.txt | AC | 59 ms | 17684 KiB |
| 02_random2_02.txt | AC | 63 ms | 17904 KiB |
| 02_random2_03.txt | AC | 59 ms | 17912 KiB |
| 02_random2_04.txt | AC | 62 ms | 17976 KiB |
| 02_random2_05.txt | AC | 65 ms | 17976 KiB |
| 03_handmade_00.txt | AC | 1 ms | 3712 KiB |
| 03_handmade_01.txt | AC | 1 ms | 3644 KiB |
| 03_handmade_02.txt | AC | 1 ms | 3900 KiB |
| 03_handmade_03.txt | AC | 42 ms | 17848 KiB |
| 03_handmade_04.txt | AC | 48 ms | 17784 KiB |
| 03_handmade_05.txt | AC | 41 ms | 17976 KiB |
| 03_handmade_06.txt | AC | 52 ms | 31544 KiB |
| 03_handmade_07.txt | AC | 50 ms | 31600 KiB |
| 03_handmade_08.txt | AC | 60 ms | 32824 KiB |